12 Replies Latest reply on Oct 30, 2014 1:03 AM by Rituraj Sinha

    how to enable cache-status,hits,hit-ratio attributes defined in infinispan

    Rituraj Sinha Novice

      going through the cli command i saw a lot of attributes which are not available or may be i missed but where can i activate them

       

      "outcome" => "success",

          "result" => {

              "description" => "A distributed cache",

              "attributes" => {

                  "cache-status" => {

                      "type" => STRING,

                      "description" => "The status of the cache component. May return null if the cache is not started.",

                      "expressions-allowed" => false,

                      "nillable" => true,

                      "min-length" => 1L,

                      "max-length" => 2147483647L,

                      "access-type" => "metric",

                      "storage" => "runtime"

       

                  "hits" => {

                      "type" => LONG,

                      "description" => "The number of cache attribute hits. May return null if the cache is not started.",

                      "expressions-allowed" => false,

                      "nillable" => true,

                      "access-type" => "metric",

                      "storage" => "runtime"

                  },

                  "hit-ratio" => {

                      "type" => DOUBLE,

                      "description" => "The hit/miss ratio for the cache (hits/hits+misses). May return null if the cache is not started.",

                      "expressions-allowed" => false,

                      "nillable" => true,

                      "access-type" => "metric",

                      "storage" => "runtime"

                  },

                  "remove-misses" => {

                      "type" => LONG,

                      "description" => "The number of cache attribute remove misses. May return null if the cache is not started.",

                      "expressions-allowed" => false,

                      "nillable" => true,

                      "access-type" => "metric",

                      "storage" => "runtime"

                  },

       

                  "misses" => {

                      "type" => LONG,

                      "description" => "The number of cache attribute misses. May return null if the cache is not started.",

                      "expressions-allowed" => false,

                      "nillable" => true,

                      "access-type" => "metric",

                      "storage" => "runtime"

                  },

      so basically i am looking here

      /profile=ha/subsystem=infinispan/cache-container=web/distributed-cache=dist
      ls

      backup                              transaction                         invalidations=undefined             remote-timeout=300000

      backup-for                          async-marshalling=undefined         jndi-name=undefined                 remove-hits=undefined

      binary-keyed-jdbc-store     average-read-time=undefined         l1-lifespan=0                       remove-misses=undefined

      eviction                            average-replication-time=undefined  misses=undefined                    replication-count=undefined

      expiration                            average-write-time=undefined        mode=SYNC                           replication-failures=undefined

      file-store                                   batching=true                       module=undefined                    segments=80

      locking                               cache-status=undefined              number-of-entries=undefined         start=undefined

      mixed-keyed-jdbc-store      elapsed-time=undefined              owners=${jboss.owner.value}         statistics-enabled=undefined

      remote-store                        hit-ratio=undefined                 passivations=undefined              stores=undefined

      state-transfer                     hits=undefined                      queue-flush-interval=undefined      success-ratio=undefined

      store                                   indexing=undefined                  queue-size=undefined                time-since-reset=undefined

      string-keyed-jdbc-store             indexing-properties=undefined       read-write-ratio=undefined          virtual-nodes=1

       

       

      Thanks

      Rituraj

        • 1. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
          Paul Ferraro Master

          These metrics will be undefined if the target cache is not started.  For the "web" cache container, these cache containers are started automatically when a <distributable/> web application is deployed.

          • 2. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
            Rituraj Sinha Novice

            Hi Paul,

             

            Thanks for replying ...we are using domain mode and dist mode for infinispan caching for me everything looks running  ...and most probably i am not looking it correctly

            to resolve this
            "These metrics will be undefined if the target cache is not started."
            where should i check ...any parameter or value or anything how to start this "target cache"
            Also we have a distributable war deployed as well..

             

            Thanks
            Rituraj

            • 3. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
              Rituraj Sinha Novice

              Hi Paul,

               

              i am still not able to find out where i am missing ....below things i have checked and are running
              1) a distributable war has been deployed on servergroup
              2) we are using HA profile in domain mode
              3) infinispan configuration is below

                              <cache-container name="web" default-cache="dist"  module="org.wildfly.clustering.web.infinispan" statistics-enabled="true">

                              <transport cluster="${jboss.cluster.name}" lock-timeout="300000"/>

                       <distributed-cache name="dist" batching="true" statistics-enabled="true" mode="SYNC" remote-timeout="300000" owners="${jboss.owner.value}" l1-lifespan="0">

                                      <state-transfer timeout="300000"/>

                                      <file-store/>

                                  </distributed-cache>

                              </cache-container>


              4) we have checked the session replication is working ...
              but i am still unable to see anything in the above value for infinispan subsystem  ....please let me know if i am missing anything or need to check anything here ....

               

              there are other things as well which i am not sure why they are undefined for example
              /profile=ha/subsystem=infinispan/cache-container=web

              cache-manager-status=undefined  as per the description description" => "The status of the cache manager component. May return null if the cache manager is not started."


              if all the above are enabled via deploying a distributable war then we are already doing it ...then why i am getting these values as undefined ..?
              please help ....

               

              Thanks

              Rituraj

              • 4. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                Tomaz Cerar Master

                Did you enable statistics for infinispan subsystem? they are off by default.

                • 5. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                  Rituraj Sinha Novice

                  Hi Tomaz,

                   

                  Thanks for replying !!
                  yes they are enabled ...i have checked it here

                  /profile=ha/subsystem=infinispan/cache-container=web

                   

                   

                  distributed-cache                             cluster-name=undefined                        local-address=undefined

                  invalidation-cache                            coordinator-address=undefined                 module=org.wildfly.clustering.web.infinispan

                  local-cache                                   default-cache=dist                            replication-queue-executor=undefined

                  replicated-cache                              eviction-executor=undefined                   start=EAGER

                  transport                                     is-coordinator=undefined                      statistics-enabled=true

                  aliases=undefined                             jndi-name=undefined

                  cache-manager-status=undefined                listener-executor=undefined

                   

                  also they are enabled in the dist cache as well(as we are using dist)

                  /profile=ha/subsystem=infinispan/cache-container=web/distributed-cache=dist

                   

                  backup                              transaction                         invalidations=undefined             remote-timeout=300000

                  backup-for                          async-marshalling=undefined         jndi-name=undefined                 remove-hits=undefined

                  binary-keyed-jdbc-store             average-read-time=undefined         l1-lifespan=0                       remove-misses=undefined

                  eviction                            average-replication-time=undefined  misses=undefined                    replication-count=undefined

                  expiration                          average-write-time=undefined        mode=SYNC                           replication-failures=undefined

                  file-store                          batching=true                       module=undefined                    segments=80

                  locking                             cache-status=undefined              number-of-entries=undefined         start=undefined

                  mixed-keyed-jdbc-store              elapsed-time=undefined              owners=${jboss.owner.value}        statistics-enabled=true

                  remote-store                        hit-ratio=undefined                 passivations=undefined              stores=undefined

                  state-transfer                      hits=undefined                      queue-flush-interval=undefined      success-ratio=undefined

                  store                               indexing=undefined                  queue-size=undefined                time-since-reset=undefined

                  string-keyed-jdbc-store             indexing-properties=undefined       read-write-ratio=undefined          virtual-nodes=1

                   

                  let me know if i have to look somewhere else as well

                   

                  Thanks
                  -Rituraj

                  • 6. Re: Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                    Paul Ferraro Master

                    By default, the read-resource operation does not include runtime-only attributes.

                    e.g. The operation:

                     

                    [standalone@localhost:9990 /] /subsystem=infinispan/cache-container=server/replicated-cache=default:read-resource(include-runtime=true, attributes-only=true)
                    

                    Outputs the following:

                     

                    {
                        "outcome" => "success",
                        "result" => {
                            "activations" => 0L,
                            "async-marshalling" => undefined,
                            "average-read-time" => 0L,
                            "average-replication-time" => 0L,
                            "average-write-time" => 0L,
                            "batching" => undefined,
                            "cache-status" => "RUNNING",
                            "elapsed-time" => 247L,
                            "hit-ratio" => 0.0,
                            "hits" => 0L,
                            "indexing" => undefined,
                            "indexing-properties" => undefined,
                            "invalidations" => 0L,
                            "jndi-name" => undefined,
                            "misses" => 0L,
                            "mode" => "SYNC",
                            "module" => undefined,
                            "number-of-entries" => 0,
                            "passivations" => "",
                            "queue-flush-interval" => undefined,
                            "queue-size" => undefined,
                            "read-write-ratio" => 0.0,
                            "remote-timeout" => undefined,
                            "remove-hits" => 0L,
                            "remove-misses" => 0L,
                            "replication-count" => 0L,
                            "replication-failures" => 0L,
                            "start" => "EAGER",
                            "statistics-enabled" => true,
                            "stores" => 0L,
                            "success-ratio" => "N/A",
                            "time-since-reset" => 247L
                        }
                    }
                    
                    • 7. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                      Rituraj Sinha Novice

                      Hi Paul,

                       

                      I have configured a standalone configuration on WF-8.1.0 and deployed the same war there as well to check the values ...i can see those values as you said but
                      in domain mode these values are not available and working in standalone only
                      can you please check from your side as well?

                       

                      Thanks
                      -Rituraj

                      • 8. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                        Rituraj Sinha Novice

                        Hi Paul,

                         

                        This seems to be not working in domain mode and works only in standalone ...is there a workaround ?
                        also is there a potential issue with infinispan if its not showing up the values what do we need to do ?

                         

                        Thanks

                        Rituraj

                        • 9. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                          Rituraj Sinha Novice

                          any updates ?
                          looks like these metrics are not coming in domain mode ...

                           

                          -RIturaj

                          • 10. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                            Richard Achmatowicz Novice

                            Hello Rituraj

                             

                            You've done everything right to enable statistics; your only error is from which addressable resource you are expecting to find the metrics for a given server in the domain.


                            The resource /profile=ha/subsystem=infinispan/ represents the configured values for the infinispan subsystem (and its children) in the ha profile. This resource and its children will not contain metrics for the infinispan subsystem for any specific server instance, rather common domain configuration information for that profile.


                            To find server instance specific metrics, you need to specify which server you want (i.e. which host and which server name) and then read the infinispan resource on that server. So your addressable resource needs to be:

                            /host=<hostname>/server=<server-name>/subsystem=infinispan


                            So, for the default Wildfly 8 domain configuration, the command to see the metrics for the web cache container on server instance server-three on host master looks like this:

                            /host=master/server=server-three/subsystem=infinispan/cache-container=web:read-resource(include-runtime=true)


                            The metric values you expect will now appear.


                            Richard

                            • 11. Re: Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                              Radoslav Husar Master

                              Here is a convenience CLI command to actually enable statistics in domain mode via CLI (same result as changing xml manually):

                               

                              [domain@localhost:9990 /] /profile=ha/subsystem=infinispan/cache-container=server:write-attribute(name=statistics-enabled,value=true)
                              {
                                  "outcome" => "success",
                                  "result" => undefined,
                                  "server-groups" => undefined
                              }
                              
                              1 of 1 people found this helpful
                              • 12. Re: how to enable cache-status,hits,hit-ratio attributes defined in infinispan
                                Rituraj Sinha Novice

                                Thanks Rado and Richard
                                although i have enabled the statistics but was looking in the wrong place ...
                                Richard : thanks for pointing out the correct location ...basically we are using web cache container with distributed-cache and wanted to look for the details ....

                                if someone needs to look for the same in domain mode try the following command

                                [domain@localhost:9990 distributed-cache=dist] ls /host=hostname/server=servername/subsystem=infinispan/cache-container=web/distributed-cache=dist

                                 

                                backup                                   store                                   hit-ratio=0.0                   number-of-entries=1                       replication-failures=0

                                backup-for                         string-keyed-jdbc-store                hits=0                              owners=2                                   segments=80

                                binary-keyed-jdbc-store         transaction                           indexing=undefined              passivations=0                            start=undefined

                                eviction                           async-marshalling=undefined     indexing-properties=undefined   queue-flush-interval=undefined  statistics-enabled=true

                                expiration                      average-read-time=0                    invalidations=0                 queue-size=undefined                       stores=213

                                file-store                      average-replication-time=0           jndi-name=undefined             read-write-ratio=0.0                        success-ratio=1.0

                                locking                         average-write-time=0                   l1-lifespan=0                   remote-timeout=300000                     time-since-reset=1718893

                                mixed-keyed-jdbc-store          batching=true                       misses=0                        remove-hits=0                                  virtual-nodes=1

                                remote-store                    cache-status=RUNNING            mode=SYNC                       remove-misses=0

                                state-transfer                  elapsed-time=1718893               module=undefined                replication-count=426

                                 

                                 

                                Thanks

                                Rituraj