Hello!
I’m trying to obtain statistics about cache usage in Keycloak, but I’m not having any luck. Any pointers would be much appreciated.
What I’ve tried is to use jboss-cli.sh to configure and read cache statistics, as follows:
root@vagrant:/opt/keycloak/bin# ./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=keycloak:write-attribute(name=statistics-enabled,value=true)
{"outcome" => "success"}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=keycloak/local-cache=users:write-attribute(name=statistics-enabled,value=true)
{"outcome" => "success"}
[standalone@localhost:9990 /] :reload
{
"outcome" => "success",
"result" => undefined
}
I had expected that this would enable statistics on the local cache named ‘users’. However, even after some activity, when I try to read those statistics, I’m not seeing any data.
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=keycloak/local-cache=users:read-resource(include-runtime=true, attributes-only=true)
{
"outcome" => "success",
"result" => {
"activations" => 0L,
"average-read-time" => undefined,
"average-write-time" => undefined,
"batching" => false,
"cache-status" => "RUNNING",
"elapsed-time" => undefined,
"hit-ratio" => undefined,
"hits" => undefined,
"indexing" => "NONE",
"indexing-properties" => undefined,
"invalidations" => undefined,
"jndi-name" => undefined,
"misses" => undefined,
"module" => undefined,
"number-of-entries" => undefined,
"passivations" => 0L,
"read-write-ratio" => undefined,
"remove-hits" => undefined,
"remove-misses" => undefined,
"start" => "LAZY",
"statistics-enabled" => true,
"stores" => undefined,
"time-since-reset" => undefined
}
}
As you can see, most values are undefined. What am I doing wrong?