diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-29 16:12:19 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-29 16:12:57 +1200 |
commit | 6c82282da3b35b2acf46f69655cd0d097058af24 (patch) | |
tree | a8c802590896ed7c49e374167a8a7212ef6bb06b /src/org/traccar/database/StatisticsManager.java | |
parent | 4f235bcac5b13733684fed8e0ef05968123f6e10 (diff) | |
download | trackermap-server-6c82282da3b35b2acf46f69655cd0d097058af24.tar.gz trackermap-server-6c82282da3b35b2acf46f69655cd0d097058af24.tar.bz2 trackermap-server-6c82282da3b35b2acf46f69655cd0d097058af24.zip |
Save more statistics info
Diffstat (limited to 'src/org/traccar/database/StatisticsManager.java')
-rw-r--r-- | src/org/traccar/database/StatisticsManager.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/org/traccar/database/StatisticsManager.java b/src/org/traccar/database/StatisticsManager.java index 5b0aa5f41..8abadddc5 100644 --- a/src/org/traccar/database/StatisticsManager.java +++ b/src/org/traccar/database/StatisticsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,10 @@ public class StatisticsManager { private int requests; private int messagesReceived; private int messagesStored; + private int mailSent; + private int smsSent; + private int geocoderRequests; + private int geolocationRequests; private void checkSplit() { int currentUpdate = Calendar.getInstance().get(SPLIT_MODE); @@ -48,6 +52,10 @@ public class StatisticsManager { statistics.setRequests(requests); statistics.setMessagesReceived(messagesReceived); statistics.setMessagesStored(messagesStored); + statistics.setMailSent(mailSent); + statistics.setSmsSent(smsSent); + statistics.setGeocoderRequests(geocoderRequests); + statistics.setGeolocationRequests(geolocationRequests); try { Context.getDataManager().addStatistics(statistics); @@ -60,6 +68,10 @@ public class StatisticsManager { requests = 0; messagesReceived = 0; messagesStored = 0; + mailSent = 0; + smsSent = 0; + geocoderRequests = 0; + geolocationRequests = 0; lastUpdate = currentUpdate; } } @@ -85,4 +97,24 @@ public class StatisticsManager { } } + public synchronized void registerMail() { + checkSplit(); + mailSent += 1; + } + + public synchronized void registerSms() { + checkSplit(); + smsSent += 1; + } + + public synchronized void registerGeocoderRequest() { + checkSplit(); + geocoderRequests += 1; + } + + public synchronized void registerGeolocationRequest() { + checkSplit(); + geolocationRequests += 1; + } + } |