Skip to content

Commit 8c679de

Browse files
authored
Merge pull request #2289 from digma-ai/report-api-performance-only-when-connection-ok
report-api-performance-only-when-connection-ok
2 parents a2790b3 + b75d491 commit 8c679de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ide-common/src/main/java/org/digma/intellij/plugin/analytics/AnalyticsService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,9 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
724724
throw e;
725725
} finally {
726726
stopWatch.stop();
727-
project.getService(ApiPerformanceMonitor.class).addPerformance(method.getName(),stopWatch.getTime(TimeUnit.MILLISECONDS));
727+
if (BackendConnectionMonitor.getInstance(project).isConnectionOk()) {
728+
project.getService(ApiPerformanceMonitor.class).addPerformance(method.getName(), stopWatch.getTime(TimeUnit.MILLISECONDS));
729+
}
728730
if (LOGGER.isTraceEnabled()) {
729731
Log.log(LOGGER::trace, "Api call {} took {} milliseconds", method.getName(), stopWatch.getTime(TimeUnit.MILLISECONDS));
730732
}

0 commit comments

Comments
 (0)