Skip to content

Commit f66394e

Browse files
committed
api performance issue event
1 parent a954a7a commit f66394e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ide-common/src/main/kotlin/org/digma/intellij/plugin/analytics/ApiPerformanceMonitor.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ApiPerformanceMonitor(private val project:Project) {
2121
return
2222
}
2323

24-
durations[apiName] = max(duration, durations[apiName] ?: 0)
24+
durations[apiName] = max(duration, durations[apiName] ?: 0L)
2525

2626
durations[apiName]?.let {
2727
report(apiName, it)
@@ -33,6 +33,9 @@ class ApiPerformanceMonitor(private val project:Project) {
3333
return
3434
}
3535

36+
//reset the max duration before reporting, new one will be collected
37+
durations[apiName] = 0L
38+
3639
val details = mutableMapOf<String,Any>(
3740
"api name" to apiName,
3841
"duration" to duration

0 commit comments

Comments
 (0)