Bug 1282660 - [GSS](6.4.z) Need localActiveSessions attribute on session state
[GSS](6.4.z) Need localActiveSessions attribute on session state
Status: CLOSED WONTFIX
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web (Show other bugs)
6.4.4
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: baranowb
Radim Hatlapatka
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-16 20:33 EST by Eiichi Nagai
Modified: 2016-12-26 17:06 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-19 09:14:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eiichi Nagai 2015-11-16 20:33:03 EST
Description of problem:
Counting method of active session was changed by BZ#1259522(https://bugzilla.redhat.com/show_bug.cgi?id=1259522) from EAP 6.4.4.
In the EAP 6.4.4, the active session of the distributable application returns same number in all nodes.
By this change, we cannot get local active session for each nodes.

Version-Release number of selected component (if applicable):
EAP 6.4.4

How reproducible:
We can confirm session state using following CLI command.
~~~
$ ./jboss-cli.sh --connect --controller=localhost:10099
[standalone@localhost:10099 /] /deployment=SessionTest.war/subsystem=web:read-resource(include-runtime=true)
{
    "outcome" => "success",
    "result" => {
        "active-sessions" => 0,
        "context-root" => "/SessionTest",
        "duplicated-session-ids" => 0,
        "expired-sessions" => 0,
        "max-active-sessions" => 0,
        "rejected-sessions" => 0,
        "session-avg-alive-time" => 0,
        "session-max-alive-time" => 0,
        "sessions-created" => 0,
        "virtual-host" => "default-host",
        "servlet" => {"TestSessionServlet" => undefined}
    }
}
~~~

Expected results:
Need localActiveSessions attribute on session state.

Additional info:
Suggest a draft.
~~~
jboss-eap-6.4.4-src/web/src/main/java/org/jboss/as/web/WebDeploymentDefinition.java 
@@ -36,6 +36,7 @@
 import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
 import org.jboss.as.controller.registry.ManagementResourceRegistration;
 import org.jboss.as.controller.registry.Resource;
+import org.jboss.as.web.session.DistributableSessionManager;
 import org.jboss.dmr.ModelNode;
 import org.jboss.dmr.ModelType;
 import org.jboss.msc.service.ServiceController;
@@ -134,6 +135,13 @@
                     case REJECTED_SESSIONS:
                         result.set(sm.getRejectedSessions());
                         break;
+                    case LOCAL_ACTIVE_SESSIONS:
+                        if(sm.getDistributable() && (sm instanceof DistributableSessionManager)) {
+                            result.set(((DistributableSessionManager)sm).getLocalActiveSessionCount());
+                        } else {
+                            result.set(sm.getActiveSessions())
+                        }
+                        break;
                     default:
                         throw new IllegalStateException(WebMessages.MESSAGES.unknownMetric(stat));
                 }
@@ -147,6 +155,7 @@
 
     public enum SessionStat {
         ACTIVE_SESSIONS(new SimpleAttributeDefinition("active-sessions", ModelType.INT, false)),
+        LOCAL_ACTIVE_SESSIONS(new SimpleAttributeDefinition("local-active-sessions", ModelType.INT, false)),
         EXPIRED_SESSIONS(new SimpleAttributeDefinition("expired-sessions", ModelType.INT, false)),
         SESSIONS_CREATED(new SimpleAttributeDefinition("sessions-created", ModelType.INT, false)),
         DUPLICATED_SESSION_IDS(new SimpleAttributeDefinition("duplicated-session-ids", ModelType.INT, false)),
~~~
Comment 2 Petr Penicka 2016-09-19 09:14:46 EDT
Triage: closing as this is considered RFE.

Note You need to log in before you can comment on or make changes to this bug.