aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-09-27 10:15:01 +1300
committerGitHub <noreply@github.com>2016-09-27 10:15:01 +1300
commit18499577b16a198762609075ff1846f354d3d712 (patch)
tree0d33302e1193724405099e1108ba04cad552a95e /src/org/traccar/api
parentaaec58aec04256845dc37afd713b488071b1406b (diff)
parentccd4a65a4954bcd7d2c38b806440bb766c51b0e2 (diff)
downloadtrackermap-server-18499577b16a198762609075ff1846f354d3d712.tar.gz
trackermap-server-18499577b16a198762609075ff1846f354d3d712.tar.bz2
trackermap-server-18499577b16a198762609075ff1846f354d3d712.zip
Merge pull request #2367 from tananaev/implement_statistics
Implement server statistics collection
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/SecurityRequestFilter.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java
index f0dd363db..9e0f03de7 100644
--- a/src/org/traccar/api/SecurityRequestFilter.java
+++ b/src/org/traccar/api/SecurityRequestFilter.java
@@ -69,6 +69,7 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
String[] auth = decodeBasicAuth(authHeader);
User user = Context.getDataManager().login(auth[0], auth[1]);
if (user != null) {
+ Context.getStatisticsManager().registerRequest(user.getId());
securityContext = new UserSecurityContext(new UserPrincipal(user.getId()));
}
} catch (SQLException e) {
@@ -79,6 +80,7 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
Long userId = (Long) request.getSession().getAttribute(SessionResource.USER_ID_KEY);
if (userId != null) {
+ Context.getStatisticsManager().registerRequest(userId);
securityContext = new UserSecurityContext(new UserPrincipal(userId));
}