Browse Source
Merge pull request #11380 from thingsboard/improvements/monitoring
Add WS subscribe latency monitoring
pull/11389/head
Viacheslav Klimov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
1 deletions
-
monitoring/src/main/java/org/thingsboard/monitoring/data/Latencies.java
-
monitoring/src/main/java/org/thingsboard/monitoring/service/BaseMonitoringService.java
|
|
|
@ -17,8 +17,8 @@ package org.thingsboard.monitoring.data; |
|
|
|
|
|
|
|
public class Latencies { |
|
|
|
|
|
|
|
public static final String WS_UPDATE = "wsUpdate"; |
|
|
|
public static final String WS_CONNECT = "wsConnect"; |
|
|
|
public static final String WS_SUBSCRIBE = "wsSubscribe"; |
|
|
|
public static final String LOG_IN = "logIn"; |
|
|
|
|
|
|
|
public static String request(String key) { |
|
|
|
|
|
|
|
@ -100,7 +100,10 @@ public abstract class BaseMonitoringService<C extends MonitoringConfig<T>, T ext |
|
|
|
reporter.reportLatency(Latencies.LOG_IN, stopWatch.getTime()); |
|
|
|
|
|
|
|
try (WsClient wsClient = wsClientFactory.createClient(accessToken)) { |
|
|
|
stopWatch.start(); |
|
|
|
wsClient.subscribeForTelemetry(devices, TransportHealthChecker.TEST_TELEMETRY_KEY).waitForReply(); |
|
|
|
reporter.reportLatency(Latencies.WS_SUBSCRIBE, stopWatch.getTime()); |
|
|
|
|
|
|
|
for (BaseHealthChecker<C, T> healthChecker : healthCheckers) { |
|
|
|
check(healthChecker, wsClient); |
|
|
|
} |
|
|
|
|