Thursday, January 17, 2013

Monnitor Datasource connections Information in JBOSS AS 7.0.1 using CLI

How to monitor DataSource statistics in Jboss 7 using CLI? 


We can monitor DataSource statistics in JBOSS 7 using cli console as below :
Connect to CLI Console :

$cd $JBOSS_HOME/bin
$ ./jboss-cli.sh --controller=[mgmt_IP]:9999 -c 
[standalone@mgmt_IP:9999 /] 
[standalone@IP:9999 /] /subsystem=datasources/data-source=MySQLDS/statistics=pool:read-resource(include-runtime=true)
{
    "outcome" => "success",
    "result" => {
        "ActiveCount" => "10",
        "AvailableCount" => "99",
        "AverageBlockingTime" => "0",
        "AverageCreationTime" => "11",
        "CreatedCount" => "140",
        "DestroyedCount" => "130",
        "MaxCreationTime" => "34",
        "MaxUsedCount" => "2",
        "MaxWaitTime" => "1",
        "TimedOut" => "80",
        "TotalBlockingTime" => "1",
        "TotalCreationTime" => "1541"
    }
}

To get some more detail about DataSource configuration details use below command:

[standalone@IP:9999 /] /subsystem=datasources/data-source=MySQLDS:read-resource(include-runtime=true)                
{
    "outcome" => "success",
    "result" => {
        "allocation-retry" => undefined,
        "allocation-retry-wait-millis" => undefined,
        "allow-multiple-users" => undefined,
        "background-validation" => false,
        "background-validation-millis" => undefined,
        "blocking-timeout-wait-millis" => undefined,
        "check-valid-connection-sql" => "select 1",
        "connection-properties" => undefined,
        "connection-url" => "jdbc:mysql://IP:PORT/DB",
        "datasource-class" => undefined,
        "driver-class" => "com.mysql.jdbc.Driver",
        "driver-name" => "mysql",
        "enabled" => true,
        "exception-sorter-class-name" => undefined,
        "exception-sorter-properties" => undefined,
        "flush-strategy" => undefined,
        "idle-timeout-minutes" => undefined,
        "jndi-name" => "java:/MySQLDS",
        "jta" => true,
        "max-pool-size" => 100,
        "min-pool-size" => 10,
        "new-connection-sql" => undefined,
        "password" => "Secret",
        "pool-prefill" => true,
        "pool-use-strict-min" => undefined,
        "prepared-statements-cache-size" => undefined,
        "query-timeout" => undefined,
        "reauth-plugin-class-name" => undefined,
        "reauth-plugin-properties" => undefined,
        "security-domain" => undefined,
        "set-tx-query-timeout" => false,
        "share-prepared-statements" => false,
        "spy" => false,
        "stale-connection-checker-class-name" => undefined,
        "stale-connection-checker-properties" => undefined,
        "track-statements" => "NOWARN",
        "transaction-isolation" => undefined,
        "url-delimiter" => undefined,
        "url-selector-strategy-class-name" => undefined,
        "use-ccm" => true,
        "use-fast-fail" => false,
        "use-java-context" => true,
        "use-try-lock" => undefined,
        "user-name" => "gnia",
        "valid-connection-checker-class-name" => undefined,
        "valid-connection-checker-properties" => undefined,
        "validate-on-match" => false,
        "statistics" => {
            "jdbc" => undefined,
            "pool" => undefined
        }
    }
}

Thanks!!

No comments:

Post a Comment