Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-1745

Peculiar behavior of data source pool statistics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.0.0.ER4
    • 7.0.0.DR12
    • JCA
    • None

      I noticed a peculiar behavior of data source statistics.

      1. an application (or a user using CLI) obtains a connection (or multiple connections) from a data source and then closes it
      2. statistics get enabled for the data source, eg. /subsystem=datasources/data-source=ExampleDS/statistics=pool:write-attribute(name=statistics-enabled,value=true)
      3. a flush-all-connections-in-pool is made for the data source
      4. read the data source statistics - the previously active connections from step 1 (before the statistics get enabled/reset) are SUBTRACTED from the ActiveCount statistic (during the flush), so the ActiveCount is now a negative number

      How to reproduce manually using CLI:

      [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:test-connection-in-pool
      {
          "outcome" => "success",
          "result" => [true]
      }
      [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:write-attribute(name=statistics-enabled,value=true)
      {"outcome" => "success"}
      [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:flush-all-connection-in-pool
      {"outcome" => "success"}
      [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true)
      {
          "outcome" => "success",
          "result" => {
              "ActiveCount" => "-1",
              "AvailableCount" => "20",
              "AverageBlockingTime" => "0",
              "AverageCreationTime" => "0",
              "CreatedCount" => "0",
              "DestroyedCount" => "1",
              "InUseCount" => "0",
              "MaxCreationTime" => "0",
              "MaxUsedCount" => "0",
              "MaxWaitCount" => "0",
              "MaxWaitTime" => "0",
              "TimedOut" => "0",
              "TotalBlockingTime" => "0",
              "TotalCreationTime" => "0",
              "statistics-enabled" => true
          }
      }
      

              jmartisk@redhat.com Jan Martiska
              jmartisk@redhat.com Jan Martiska
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: