private MetricFamilySamples fromTimer ( List < Map . Entry < MetricName , Timer > > histogramsWithSameName ) { final SummaryMetricFamily summaryMetricFamily = getSummaryMetricFamily ( histogramsWithSameName , "_seconds" ) ; for ( Map . Entry < MetricName , Timer > entry : histogramsWithSameName ) { addSummaryMetric ( summaryMetricFamily , entry . getKey ( ) , entry . getValue ( ) . getSnapshot ( ) , SECONDS_IN_NANOS , entry . getValue ( ) . getCount ( ) ) ; } return summaryMetricFamily ; }
Export dropwizard Timer as a histogram . Use TIME_UNIT as time unit .