mendix / m2ee-tools

m2ee, the Mendix runtime helper tools for GNU/Linux
Other
27 stars 40 forks source link

jvm metrics for mendix 8/java 11 are not retrieved correctly. #52

Open cwesdorp opened 4 years ago

cwesdorp commented 4 years ago

In munin.py:get_stats_from_runtime the Java JVM memory values are retrieved from the runtime statistics. The response on Mendix 8 (with Java 11) is this:

{
  "feedback": {
    "sessions": {
      "user_sessions": {
      },
      "named_users": 20,
      "anonymous_sessions": 0,
      "named_user_sessions": 2
    },
    "cache": {
      "total_count": 0
    },
    "memory": {
      "used_nonheap": 254877936,
      "init_nonheap": 7667712,
      "max_nonheap": 780140544,
      "committed_nonheap": 272007168,
      "init_heap": 1073741824,
      "memorypools": [
        {
          "is_heap": false,
          "usage": 1425280,
          "name": "CodeHeap 'non-nmethods'",
          "index": 0
        },
        {
          "is_heap": false,
          "usage": 140633704,
          "name": "Metaspace",
          "index": 1
        },
        {
          "is_heap": true,
          "usage": 458138760,
          "name": "Tenured Gen",
          "index": 2
        },
        {
          "is_heap": false,
          "usage": 52676096,
          "name": "CodeHeap 'profiled nmethods'",
          "index": 3
        },
        {
          "is_heap": true,
          "usage": 270960112,
          "name": "Eden Space",
          "index": 4
        },
        {
          "is_heap": true,
          "usage": 8968920,
          "name": "Survivor Space",
          "index": 5
        },
        {
          "is_heap": false,
          "usage": 18281096,
          "name": "Compressed Class Space",
          "index": 6
        },
        {
          "is_heap": false,
          "usage": 41861760,
          "name": "CodeHeap 'non-profiled nmethods'",
          "index": 7
        }
      ],
      "committed_heap": 1037959168,
      "max_heap": 1037959168,
      "used_heap": 738067792
    },
    "languages": [
      "en_GB",
      "nl_NL"
    ],
    "entities": 604,
    "requests": [
      {
        "last_request_timestamp": 1581619663617,
        "name": "",
        "value": 1186
      },
      {
        "last_request_timestamp": 1581547423367,
        "name": "n/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581547423093,
        "name": "ws-doc/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581547423166,
        "name": "eba/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581547423155,
        "name": "api-doc/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581547423258,
        "name": "rest-doc/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581547423168,
        "name": "odata-doc/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581615172790,
        "name": "rest/",
        "value": 1332
      },
      {
        "last_request_timestamp": 1581547423084,
        "name": "ws/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581614405199,
        "name": "file",
        "value": 150
      },
      {
        "last_request_timestamp": 1581547421263,
        "name": "link/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581547423385,
        "name": "debugger/",
        "value": 0
      },
      {
        "last_request_timestamp": 1581620021125,
        "name": "xas/",
        "value": 85165
      },
      {
        "last_request_timestamp": 1581616818238,
        "name": "p/",
        "value": 27
      }
    ],
    "connectionbus": {
      "select": 8147638,
      "insert": 123969,
      "update": 98424,
      "delete": 132182,
      "transaction": 49484
    }
  },
  "result": 0
}

The methods make a decision based on the existence of memory.memorypools which exists and then retrieves values from the response. But, comparing the variable names with the assignment we see a mismatch.

M2EE Runtime response
stats['memory']['code'] = memorypools[0]['usage'] "CodeHeap 'non-nmethods'"
stats['memory']['permanent'] = memorypools[2]['usage'] "Tenured Gen"
stats['memory']['eden'] = memorypools[3]['usage'] "CodeHeap 'profiled nmethods'"
stats['memory']['survivor'] = memorypools[4]['usage'] "Eden Space"
stats['memory']['tenured'] = memorypools[5]['usage'] "Survivor Space"

This results in internal ticket DEP-2484.

knorrie commented 4 years ago

This should be part of #51