• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Session count not accurate

New Here ,
Oct 19, 2015 Oct 19, 2015

Copy link to clipboard

Copied

When running this code:

<cfset sessionTracker = createObject("java","coldfusion.runtime.SessionTracker")>

<cfset sessionCount = sessionTracker.getSessionCount()>

My total session count it 500, yet in the metric log for the same instance I see session count is 1500.   Why such a difference in numbers?  Which one is correct?

- Alex

Views

328

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2015 Oct 19, 2015

Copy link to clipboard

Copied

The sessionCount is for an instant. Whereas ColdFusion writes to the metrics log after a time interval.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2015 Oct 19, 2015

Copy link to clipboard

Copied

This still does not seem accurate.  Our metric log, logs every 60 seconds.  At the same instance it wrote the log I ran the code.  I can't believe that there is a 1000 session count difference based on timing.  Is there a way at the Tomcat level to see how many sessions it thinks it has?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 20, 2015 Oct 20, 2015

Copy link to clipboard

Copied

LATEST

It may be anything. I would first check the code. In particular, the part that manages sessions. An excessive rate of sessions may suggest your code is not maintaining sessions properly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation