glassfish
  1. glassfish
  2. GLASSFISH-21649

countqueued1minuteaverage does not count the value for one minute

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2.2, 4.1, 4.1.1, 5.0
    • Fix Version/s: 5.0
    • Component/s: monitoring, web_container
    • Labels:
      None

      Description

      countqueued1minuteaverage does not count the value for one minute.

      http://localhost:4848/monitoring/domain1/server/network/http-listener-1/connection-queue/countqueued1minuteaverage

          countqueued1minuteaverage
              count : 0
              lastsampletime : 1482364980659
              description : Average number of connections queued in the last 1 minute
              unit : count
              name : CountQueued1MinuteAverage
              starttime : 1482364980659
      

      It depends on the time when the REST request is sent.
      Counter for countqueued1minuteaverage is reset at 0 second per minute.

      This is the patch for this problem.

      ConnectionQueueStatsProvider.java
          protected int getAverageBy(int mins) {
              synchronized(averageStatsPerMinute) {
                  final long currentTime = System.currentTimeMillis();
                  if (currentTime - averageLastShift >= MINUTE) {
                      shiftAverage(currentTime);
                  }
      
                  int result = 0;
                  final int statsToCount = Math.min(mins, averageStatsPerMinute.length);
                  for(int i = 0; i < statsToCount; i++) {
                      result += averageStatsPerMinute[i];
                  }
      
                  return result;
              }
          }
      

        Activity

        Hide
        srinik76 added a comment -

        Fixed checked in the changes. Ran the QL, Monitoring dev test and manually tested the changes.

        Sending ConnectionQueueStatsProvider.java
        Transmitting file data .
        Committed revision 64426.

        Show
        srinik76 added a comment - Fixed checked in the changes. Ran the QL, Monitoring dev test and manually tested the changes. Sending ConnectionQueueStatsProvider.java Transmitting file data . Committed revision 64426.

          People

          • Assignee:
            srinik76
            Reporter:
            yama0428
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: