aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-08-19 10:32:35 -0700
committerAnton Tananaev <anton@traccar.org>2023-08-19 10:32:35 -0700
commit51712e33c363d5150cfd690d6f3c466a38ab6ba3 (patch)
treea7862e97ae493bb0be499b56b4cd01344bc458b2 /src/main
parenta1c12c50a8d0023d6ccfbf4eb0723a90eab55cc5 (diff)
downloadtrackermap-server-51712e33c363d5150cfd690d6f3c466a38ab6ba3.tar.gz
trackermap-server-51712e33c363d5150cfd690d6f3c466a38ab6ba3.tar.bz2
trackermap-server-51712e33c363d5150cfd690d6f3c466a38ab6ba3.zip
Support statistics attributes
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/database/StatisticsManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/database/StatisticsManager.java b/src/main/java/org/traccar/database/StatisticsManager.java
index e417c8901..0e9931fba 100644
--- a/src/main/java/org/traccar/database/StatisticsManager.java
+++ b/src/main/java/org/traccar/database/StatisticsManager.java
@@ -100,6 +100,8 @@ public class StatisticsManager {
statistics.setProtocols(protocols);
}
+ statistics.set("modern", config.getString(Keys.WEB_PATH).contains("modern"));
+
users.clear();
deviceProtocols.clear();
deviceMessages.clear();
@@ -141,6 +143,13 @@ public class StatisticsManager {
LOGGER.warn("Failed to serialize protocols", e);
}
}
+ if (!statistics.getAttributes().isEmpty()) {
+ try {
+ form.param("attributes", objectMapper.writeValueAsString(statistics.getAttributes()));
+ } catch (JsonProcessingException e) {
+ LOGGER.warn("Failed to serialize attributes", e);
+ }
+ }
client.target(url).request().async().post(Entity.form(form));
}