aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-09-25 14:51:16 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-09-25 14:51:16 +1300
commit53bcb5c788e6b24bf8f6f631445b61a87c5f715f (patch)
treebffd421a1e538090ba868ff981635b1b5a01da65 /src/org/traccar/api
parentd8dd2091c36099e5f2e5eeb00734cad54f342cbb (diff)
downloadtraccar-server-53bcb5c788e6b24bf8f6f631445b61a87c5f715f.tar.gz
traccar-server-53bcb5c788e6b24bf8f6f631445b61a87c5f715f.tar.bz2
traccar-server-53bcb5c788e6b24bf8f6f631445b61a87c5f715f.zip
Implement server statistics collection
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/SecurityRequestFilter.java1
-rw-r--r--src/org/traccar/api/resource/SessionResource.java2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java
index f0dd363db..ff4241b97 100644
--- a/src/org/traccar/api/SecurityRequestFilter.java
+++ b/src/org/traccar/api/SecurityRequestFilter.java
@@ -55,6 +55,7 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext requestContext) {
+ Context.getStatisticsManager().registerRequest();
if (requestContext.getMethod().equals("OPTIONS")) {
return;
diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java
index deed70b37..4ab1960c9 100644
--- a/src/org/traccar/api/resource/SessionResource.java
+++ b/src/org/traccar/api/resource/SessionResource.java
@@ -73,6 +73,7 @@ public class SessionResource extends BaseResource {
}
if (userId != null) {
+ Context.getStatisticsManager().registerUser(userId);
return Context.getPermissionsManager().getUser(userId);
} else {
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build());
@@ -85,6 +86,7 @@ public class SessionResource extends BaseResource {
@FormParam("email") String email, @FormParam("password") String password) throws SQLException {
User user = Context.getPermissionsManager().login(email, password);
if (user != null) {
+ Context.getStatisticsManager().registerUser(user.getId());
request.getSession().setAttribute(USER_ID_KEY, user.getId());
return user;
} else {