Add WS subscribe latency monitoring
This commit is contained in:
		
							parent
							
								
									af5f501cd4
								
							
						
					
					
						commit
						6efb2ab81f
					
				@ -17,8 +17,8 @@ package org.thingsboard.monitoring.data;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class Latencies {
 | 
					public class Latencies {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static final String WS_UPDATE = "wsUpdate";
 | 
					 | 
				
			||||||
    public static final String WS_CONNECT = "wsConnect";
 | 
					    public static final String WS_CONNECT = "wsConnect";
 | 
				
			||||||
 | 
					    public static final String WS_SUBSCRIBE = "wsSubscribe";
 | 
				
			||||||
    public static final String LOG_IN = "logIn";
 | 
					    public static final String LOG_IN = "logIn";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static String request(String key) {
 | 
					    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());
 | 
					            reporter.reportLatency(Latencies.LOG_IN, stopWatch.getTime());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            try (WsClient wsClient = wsClientFactory.createClient(accessToken)) {
 | 
					            try (WsClient wsClient = wsClientFactory.createClient(accessToken)) {
 | 
				
			||||||
 | 
					                stopWatch.start();
 | 
				
			||||||
                wsClient.subscribeForTelemetry(devices, TransportHealthChecker.TEST_TELEMETRY_KEY).waitForReply();
 | 
					                wsClient.subscribeForTelemetry(devices, TransportHealthChecker.TEST_TELEMETRY_KEY).waitForReply();
 | 
				
			||||||
 | 
					                reporter.reportLatency(Latencies.WS_SUBSCRIBE, stopWatch.getTime());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                for (BaseHealthChecker<C, T> healthChecker : healthCheckers) {
 | 
					                for (BaseHealthChecker<C, T> healthChecker : healthCheckers) {
 | 
				
			||||||
                    check(healthChecker, wsClient);
 | 
					                    check(healthChecker, wsClient);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user