-
1. Re: How to count active session in JBoss AS 7
nickarls Jan 14, 2013 4:29 PM (in response to erasmomarciano)Active what sessions? HTTP?
-
2. Re: How to count active session in JBoss AS 7
erasmomarciano Jan 14, 2013 4:41 PM (in response to nickarls)JsessionID
-
3. Re: How to count active session in JBoss AS 7
nickarls Jan 14, 2013 5:10 PM (in response to erasmomarciano)I must say I'm not convinced the "current active session count" statistics is exposed anywhere I'm aware of...
-
4. Re: How to count active session in JBoss AS 7
ctomc Jan 14, 2013 5:48 PM (in response to nickarls)Nicklas Karlsson wrote:
I must say I'm not convinced the "current active session count" statistics is exposed anywhere I'm aware of...
Ofcourse it is
/subsystem=web/connector=http:read-resource
or any other connector there is.
and you also have
/deployment=name-of-your-app.war/:read-resource
or
/deployment=name-of-your-app.ear/subdeployment=name-of-web.war:read-resource
and then you can go even deeper
/deployment=name-of-your-app.war/servlet=myservlet:read-resource
--
tomaz
-
5. Re: How to count active session in JBoss AS 7
ssilvert Jan 14, 2013 7:29 PM (in response to ctomc)I don't see it on the http connector, but with AS7.2, you can see the active HttpSessions on a per-deployment basis:
/deployment=myapp.war/subsystem=web/:read-attribute(name=active-sessions) { "outcome" => "success", "result" => 1 }
Stan
-
6. Re: How to count active session in JBoss AS 7
nickarls Jan 15, 2013 2:19 AM (in response to ctomc)Some stats are shown but as Stan pointed out at least on 7.1.1 the active sessions are not among them.
But the feature in 7.2 is welcome, it would be good if they could be summed up on connector basis though.
I tried the servlet level (you apparently need the subsystem in the command, too) but I get a
]): java.lang.UnsupportedOperationException
at org.jboss.dmr.ModelNode.checkProtect(ModelNode.java:1560) [jboss-dmr-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.dmr.ModelNode.get(ModelNode.java:795) [jboss-dmr-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.web.WebDeploymentServletDefinition$AbstractMetricsHandler$1.execute(WebDeploymentServletDefinition.java:95) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
I haven't verified with a clean AS or checked JIRA if it's known/fixed already.
-
7. Re: How to count active session in JBoss AS 7
ssilvert Jan 15, 2013 8:10 AM (in response to nickarls)1 of 1 people found this helpfulI don't think the HttpSession can really be tied to the connector. You should be able to hit the same app using different connectors.
It's easy enough to sum these up though. Here is the CLI command that displays active-session for all deployments:
/deployment=*/subsystem=web/:read-attribute(name=active-sessions) { "outcome" => "success", "result" => [ { "address" => [ ("deployment" => "AS7-6262.war"), ("subsystem" => "web") ], "outcome" => "success", "result" => 1 }, { "address" => [ ("deployment" => "metamer-jbas71.war"), ("subsystem" => "web") ], "outcome" => "success", "result" => 1 } ] }
If you want to see all these new 7.2 stats in a web app, take a look at my "Do it yourself console" demo:
https://github.com/ssilvert/diycdemo
It lets you call CLI commands from a JSF Facelets page.
I added something new to the demo to show how easy it is to sum these things up. I just used <c:forEach> and <c:set> to get the Total HTTP Sessions.
Stan
-
8. Re: How to count active session in JBoss AS 7
nickarls Jan 15, 2013 8:35 AM (in response to ssilvert)Perhaps the current active requests would be a better measurement for current http connector load indication?
-
9. Re: How to count active session in JBoss AS 7
ssilvert Jan 15, 2013 8:49 AM (in response to nickarls)Nicklas Karlsson wrote:
Perhaps the current active requests would be a better measurement for current http connector load indication?
Probably. I don't see any way to get that though.
Of course, it depends on what you are trying to measure.
Stan
-
10. Re: How to count active session in JBoss AS 7
erasmomarciano Jan 15, 2013 3:14 PM (in response to erasmomarciano)I'm using 7.1.1
I tried so:
[standalone@localhost:9999 /] /deployment=*/subsystem=web/:read-attribute(name=active-sessions)
{
"outcome" => "failed",
"result" => [
{
"address" => [
("deployment" => "javamelody-1.41.0.war"),
("subsystem" => "web")
],
"outcome" => undefined
},
{
"address" => [
("deployment" => "miocorso.war"),
("subsystem" => "web")
],
"outcome" => undefined
},
{
"address" => [
("deployment" => "demo_database.war"),
("subsystem" => "web")
],
"outcome" => "failed",
"failure-description" => "JBAS014792: Unknown attribute active-sessions",
"rolled-back" => true
}
],
"rolled-back" => true
}
doesn't work "failure-description" => "JBAS014792: Unknown attribute active-sessions",
Why I get this error?
tnks
-
11. Re: How to count active session in JBoss AS 7
nickarls Jan 15, 2013 3:46 PM (in response to erasmomarciano)1 of 1 people found this helpfulIt's only for 7.2
-
12. Re: How to count active session in JBoss AS 7
ctomc Jan 15, 2013 5:14 PM (in response to nickarls)most of it is also already in 7.1.2
-
13. Re: How to count active session in JBoss AS 7
erasmomarciano Jan 16, 2013 6:11 AM (in response to erasmomarciano)Thank