-
Notifications
You must be signed in to change notification settings - Fork 30
Calculate running sessions per user #19
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
Conversation
This reverts commit acdbc06.
call @baev @eroshenkoam @smecsia |
@@ -64,7 +63,7 @@ | |||
private HostSelectionStrategy hostSelectionStrategy; | |||
|
|||
@Autowired | |||
private GridStats stats; | |||
private SessionStorage sessionStorage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sonar finally noticed that we have a 100+ lines long method in RouteServlet :) |
And also it finally has noticed that all our |
@baev Sonar is right. Servlet fields must be |
Despite these persisting Sonar issues PR is finally ready to merge. |
Test this please |
These quota reload tests again... >_< |
Respond to the client with the error message returned by the last hub tried, when unable to create new session on any hub. Instead of just responding with the default error message which does not help a lot.
@@ -116,7 +117,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) | |||
|
|||
String target = route + request.getRequestURI(); | |||
HttpResponse hubResponse = client.execute(post(target, message)); | |||
JsonMessage hubMessage = JsonMessageFactory.from(hubResponse.getEntity().getContent()); | |||
hubMessage = JsonMessageFactory.from(hubResponse.getEntity().getContent()); | |||
|
|||
if (hubResponse.getStatusLine().getStatusCode() == SC_OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test this please |
2 similar comments
test this please |
test this please |
SonarQube analysis reported 5 issues: Watch the comments in this conversation to review them. |
1. Calculate running sessions for each (user; browser; version)
Change the behavior of the
/stats
: accept only logged in users and return a json as the result which maps browser names to browser versions and then to the number of sessions that users has currently running. Like that:⬇︎
The old sessions that are not updated are evicted from the map after the timeout that can be configured by property
grid.router.evict.sessions.timeout.seconds
with defaults to 2 minutes.Providing a different session storage than default in-memory implementation should work in a distributed multi-headed Grid Router runtime if properly synchronized via any library chosen.
2. Provide hub error message to client
Respond to the client with the error message returned by the last hub tried, when unable to create new session on any hub. Instead of just responding with the default error message which does not help a lot.