mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 02:57:49 +00:00
remove metrics from ClientSession
This commit is contained in:
@@ -1708,50 +1708,9 @@ public class MqttStatsPublisher {
|
|||||||
txErrors += client.getStats().getTxErrors();
|
txErrors += client.getStats().getTxErrors();
|
||||||
lastRssi = client.getStats().getRssi();
|
lastRssi = client.getStats().getRssi();
|
||||||
|
|
||||||
try {
|
if (client.hasConnected() && client.getConnected() && client.hasMacAddress()) {
|
||||||
|
numConnectedClients += 1;
|
||||||
if (client.hasConnected() && client.getConnected() && client.hasMacAddress()) {
|
|
||||||
// update service_metrics_collection_config for
|
|
||||||
// connected client
|
|
||||||
ClientSession session =
|
|
||||||
handleClientSessionMetricsUpdate(customerId, equipmentId, locationId, radioType, clientReport.getTimestampMs(), client);
|
|
||||||
if (session != null) {
|
|
||||||
numConnectedClients += 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Make sure, if we have a session for this client,
|
|
||||||
// it
|
|
||||||
// shows disconnected.
|
|
||||||
// update any service_metrics_collection_config that
|
|
||||||
// need update if the
|
|
||||||
// disconnect occured during this window
|
|
||||||
if (client.hasMacAddress()) {
|
|
||||||
ClientSession session =
|
|
||||||
clientServiceInterface.getSessionOrNull(customerId, equipmentId, MacAddress.valueOf(client.getMacAddress()));
|
|
||||||
|
|
||||||
if (session != null) {
|
|
||||||
|
|
||||||
ClientSessionDetails latestSessionDetails = new ClientSessionDetails();
|
|
||||||
|
|
||||||
// could still be values from before
|
|
||||||
// disconnect occured.
|
|
||||||
latestSessionDetails.setMetricDetails(calculateClientSessionMetricDetails(client, clientReport.getTimestampMs()));
|
|
||||||
|
|
||||||
session.getDetails().mergeSession(latestSessionDetails);
|
|
||||||
|
|
||||||
clientServiceInterface.updateSession(session);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
continue; // not connected
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.error("Unabled to update client {}", client, e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user