【问题标题】:List active sessions with wsadmin使用 wsadmin 列出活动会话
【发布时间】:2012-06-13 14:30:32
【问题描述】:

我正在尝试使用 wsadmin 编写一个脚本,该脚本将检索活动会话的总量。我环顾了整个网络,并没有发现任何真正有用的东西。有没有办法使用 wsadmin 工具来做到这一点?谢谢。

【问题讨论】:

  • 与您的 webapp/servlet 的活动 http 会话?还是别的什么?

标签: session websphere wsadmin


【解决方案1】:

查看内存中的 Websphere 会话计数 - 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')

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

['', '统计名称=My_WAR_FILE_NAME, type=servletSessionsModule', '{', 'name=SessionObjectSize, ID=18, description=平均大小 会话级别的会话对象,仅包括可序列化 缓存中的属性。,unit=BYTE,type=AverageStatistic, 平均=1762.5,最小=1713,最大=1812,总数=200925,计数=114, sumSq=4.0370855625E10, type=TimeStatistic, avg=1762.5, min=1713, max=1812, total=200925, count=114, sumSq=4.0370855625E10', '}']

【讨论】:

  • 这看起来可能有效。我会试一试并报告。谢谢!
猜你喜欢
  • 1970-01-01
  • 2021-07-20
  • 2010-12-01
  • 1970-01-01
  • 2011-09-20
  • 1970-01-01
  • 2016-07-31
  • 1970-01-01
  • 2018-01-24
相关资源
最近更新 更多