public void stop ( Map < String , String > additionalMetadata ) { if ( this . stopped ) { return ; } this . stopped = true ; long endTime = System . currentTimeMillis ( ) ; long duration = endTime - this . startTime ; Map < String , String > finalMetadata = Maps . newHashMap ( ) ; finalMetadata . putAll ( additionalMetadata ) ; finalMetadata . put ( EventSubmitter . EVENT_TYPE , METADATA_TIMING_EVENT ) ; finalMetadata . put ( METADATA_START_TIME , Long . toString ( this . startTime ) ) ; finalMetadata . put ( METADATA_END_TIME , Long . toString ( endTime ) ) ; finalMetadata . put ( METADATA_DURATION , Long . toString ( duration ) ) ; this . submitter . submit ( this . name , finalMetadata ) ; }
Stop the timer and submit the event along with the additional metadata specified . If the timer was already stopped before this is a no - op .