public void updateTime ( String streamId , String name , long start , long end , int count , boolean mergeTopology ) { if ( start > 0 && count > 0 ) { AsmMetric existingMetric = findMetric ( streamId , name , MetricType . HISTOGRAM , mergeTopology ) ; if ( existingMetric instanceof AsmHistogram ) { AsmHistogram histogram = ( AsmHistogram ) existingMetric ; if ( histogram . okToUpdate ( end ) ) { long elapsed = ( ( end - start ) * TimeUtils . US_PER_MS ) / count ; if ( elapsed >= 0 ) { histogram . update ( elapsed ) ; histogram . setLastUpdateTime ( end ) ; } } } } }
almost the same implementation of above update but improves performance for histograms