Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect performance stats in oxAuth #393

Open
nynymike opened this issue Dec 12, 2016 · 0 comments

Comments

@nynymike
Copy link
Contributor

commented Dec 12, 2016

From Yura:
I've on idea about calculating performance of server. In oxAuth we already
have internal metric mechanism. We can calculate statistic for all required
peace of code. It's not overkill the server. We store counters in memory and
persist them every 60 seconds by default. We do this in:
https://github.com/GluuFederation/oxCore/blob/master/oxService/src/main/java
/org/xdi/service/metric/MetricService.java

Now we gather statistic only for LDAP authentications:
https://github.com/GluuFederation/oxAuth/blob/master/Server/src/main/java/or
g/xdi/oxauth/service/AuthenticationService.java#L113

But it's very easy to add it to each our API methods. Here is the pattern:

com.codahale.metrics.Timer.Context timerContext =
metricService.getTimer(MetricType.OXAUTH_USER_AUTHENTICATION_RATE).time();
try {

} finally
timerContext.stop();
}
This timer will measure the amount of time it takes to process each request
in nanoseconds and provide a rate of requests in requests per second.

As result we will get data with 60 seconds snapshot.

Later we can display this statistic in oxTrust.

@nynymike nynymike added this to the CE 3.1.0 milestone Dec 12, 2016

@yurem yurem modified the milestones: CE 3.1.0, CE 3.2.0 Aug 15, 2017

@yurem yurem modified the milestones: 4.0, 4.1 Mar 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.