Inner path documentation could be improved

classic Classic list List threaded Threaded
1 message Options
jeantil jeantil
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Inner path documentation could be improved

Hello,

While experimenting with the query syntax I encountered a lot of trouble with the inner path part (https://jolokia.org/reference/html/protocol.html#read) mostly because
- the documentation only quotes a single partial response
- the documentation doesn't provide the full payload which the query was derived from
- the payload seems to have changed in java 8 making the query in the documentation invalid

used is not a field of LastGcInfo anymore, instead there is a used property for each of the spaces hence the base query fails
http://localhost:7777/jolokia/read/java.lang:name=*,type=GarbageCollector/LastGcInfo/*/*/used
{
    "request": {
        "attribute": "LastGcInfo",
        "mbean": "java.lang:name=*,type=GarbageCollector",
        "path": "*/*/used",
        "type": "read"
    },
    "status": 200,
    "timestamp": 1500458984,
    "value": null
}
and should actually be
http://localhost:7777/jolokia/read/java.lang:name=*,type=GarbageCollector/LastGcInfo/*/*/*/*/used
{
    "request": {
        "attribute": "LastGcInfo",
        "mbean": "java.lang:name=*,type=GarbageCollector",
        "path": "*/*/*/*/used",
        "type": "read"
    },
    "status": 200,
    "timestamp": 1500459011,
    "value": {
        "java.lang:name=PS MarkSweep,type=GarbageCollector": {
            "LastGcInfo": {
                "GcThreadCount": 8,
                "duration": 102,
                "endTime": 5506,
                "id": 4,
                "memoryUsageAfterGc": {
                    "Code Cache": 10853376,
                    "Compressed Class Space": 8745552,
                    "Metaspace": 46745696,
                    "PS Eden Space": 0,
                    "PS Old Gen": 36477112,
                    "PS Survivor Space": 0
                },
                "memoryUsageBeforeGc": {
                    "Code Cache": 10853376,
                    "Compressed Class Space": 8745552,
                    "Metaspace": 46745696,
                    "PS Eden Space": 0,
                    "PS Old Gen": 45755888,
                    "PS Survivor Space": 98304
                },
                "startTime": 5404
            }
        },
        "java.lang:name=PS Scavenge,type=GarbageCollector": {
            "LastGcInfo": {
                "GcThreadCount": 8,
                "duration": 32,
                "endTime": 8018,
                "id": 6,
                "memoryUsageAfterGc": {
                    "Code Cache": 16331392,
                    "Compressed Class Space": 10311888,
                    "Metaspace": 53472496,
                    "PS Eden Space": 0,
                    "PS Old Gen": 36493496,
                    "PS Survivor Space": 41423880
                },
                "memoryUsageBeforeGc": {
                    "Code Cache": 16331392,
                    "Compressed Class Space": 10311888,
                    "Metaspace": 53472496,
                    "PS Eden Space": 357040128,
                    "PS Old Gen": 36485304,
                    "PS Survivor Space": 31668296
                },
                "startTime": 7986
            }
        }
    }
}
which is very far from the quoted response in the documentation. I am not sure what  version of java was used to create the samples of the documentation but it would be nice to have updated quotes or quotes which work well throughout java versions.

maybe duration is more stable than used too...

http://localhost:7777/jolokia/read/java.lang:name=*,type=GarbageCollector/LastGcInfo/*/*/duration
{
    "request": {
        "attribute": "LastGcInfo",
        "mbean": "java.lang:name=*,type=GarbageCollector",
        "path": "*/*/duration",
        "type": "read"
    },
    "status": 200,
    "timestamp": 1500459211,
    "value": {
        "java.lang:name=PS MarkSweep,type=GarbageCollector": {
            "LastGcInfo": 102
        },
        "java.lang:name=PS Scavenge,type=GarbageCollector": {
            "LastGcInfo": 32
        }
    }
}


thank you
jean
Loading...