File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
services/src/main/kotlin/spp/probe/services/common Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -331,8 +331,8 @@ object ContextReceiver {
331331
332332 fun startTimer (meterId : String ) {
333333 val liveMeter = LiveInstrumentService .getInstrument(meterId) as LiveMeter ? ? : return
334- if (log.isTraceEnabled) log.trace(" Live meter (startTimer): $liveMeter " )
335334 ProbeMemory .putLocal(" spp.active-timer:$meterId " , System .currentTimeMillis())
335+ if (log.isTraceEnabled) log.trace(" Live meter (startTimer): $liveMeter " )
336336
337337 ProbeMemory .computeGlobal(" spp.base-meter:$meterId :timer-meter" ) {
338338 MeterFactory .counter(liveMeter.toMetricIdWithoutPrefix() + " _timer_meter" ).apply {
@@ -343,10 +343,10 @@ object ContextReceiver {
343343
344344 fun stopTimer (meterId : String ) {
345345 val liveMeter = LiveInstrumentService .getInstrument(meterId) as LiveMeter ? ? : return
346+ val startTime = ProbeMemory .removeLocal(" spp.active-timer:$meterId " ) as Long? ? : return
346347 if (log.isTraceEnabled) log.trace(" Live meter (stopTimer): $liveMeter " )
347- val startTime = ProbeMemory .removeLocal(" spp.active-timer:$meterId " ) as Long
348- val duration = System .currentTimeMillis() - startTime
349348
349+ val duration = System .currentTimeMillis() - startTime
350350 ProbeMemory .computeGlobal(" spp.base-meter:$meterId :timer-sum" ) {
351351 MeterFactory .counter(liveMeter.toMetricIdWithoutPrefix() + " _timer_duration_sum" ).apply {
352352 mode(CounterMode .RATE )
You can’t perform that action at this time.
0 commit comments