session - 使用 wsadmin 列出事件 session

标签 session websphere wsadmin

我正在尝试使用 wsadmin 编写一个脚本来检索事件 session 的总量。我浏览过网络并没有发现任何真正有用的东西。有没有办法使用 wsadmin 工具来做到这一点?谢谢。

最佳答案

查看内存中的 Websphere session 计数 - http://websphereadmin-janglestrategies.blogspot.com/2010/02/websphere-in-memory-session-count.html

来自该博客文章

servers = AdminTask.listServers( '[-serverType APPLICATION_SERVER]').splitlines()

对于服务器中的服务器:

# Now just get the app server name - not the whole jython config id
newserver = server.split('(')

# get the session manager mbean
ps = AdminControl.queryNames ('WebSphere:type=SessionManager,process=' + newserver[0] + ',*')

# now get the stats for the mbean
AdminControl.getAttribute(ps, 'stats')

希望你会得到像这样的输出:

['', 'Stats name=My_WAR_FILE_NAME, type=servletSessionsModule', '{', 'name=SessionObjectSize, ID=18, description=The average size of the session objects at session level, including only serializable attributes in the cache., unit=BYTE, type=AverageStatistic, avg=1762.5, min=1713, max=1812, total=200925, count=114, sumSq=4.0370855625E10, type=TimeStatistic, avg=1762.5, min=1713, max=1812, total=200925, count=114, sumSq=4.0370855625E10', '}']

关于session - 使用 wsadmin 列出事件 session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11017114/

相关文章:

session - 取消设置 Twig session 变量

node.js - supertest代理似乎没有在node.jsexpress.js应用程序中保留 session

ruby - 如何设置 session [:expires] in rack session (Sinatra)

java - SSL 握手失败 Websphere 1 of 2 servers

websphere - 错误 404 : No target servlet configured for uri

python - jython脚本: How to modify the maximum connection of connection pool under Websphere MQ Connection factories

通过 wsadmin 创建 mq 连接工厂时出现 java.lang.ClassNotFoundException

session - 什么是真正的 session ?

java - 在 websphere 中调用 request.getHeaderNames 方法时出现 nullpointerexception

websphere - wsadmin + jython 重启 WAS 应用服务器