13.10. 데이터 소스 통계
정의된 데이터 소스에 대한 코어 풀 및 JDBC 런타임 통계를 볼 수 있습니다. 사용 가능한 모든 통계의 자세한 목록은 데이터 소스 통계를 참조하십시오.
데이터 소스 통계 활성화
기본적으로 데이터 소스 통계는 활성화되지 않습니다. 다음 관리 CLI 명령을 사용하면 ExampleDS
데이터 소스에 대한 통계 컬렉션을 사용할 수 있습니다.
관리형 도메인에서 이러한 명령 앞에 /profile=PROFILE_NAME
.
/subsystem=datasources/data-source=ExampleDS/statistics=pool:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/data-source=ExampleDS/statistics=pool:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/data-source=ExampleDS/statistics=jdbc:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/data-source=ExampleDS/statistics=jdbc:write-attribute(name=statistics-enabled,value=true)
데이터 소스 통계 보기
모든 데이터 소스 통계는 관리 CLI에서 검색할 수 있습니다. 이러한 통계의 하위 집합은 관리 콘솔의 런타임 탭에서 볼 수 있습니다.
다음 관리 CLI 명령은 ExampleDS
데이터 소스에 대한 코어 풀 통계를 검색합니다.
관리형 도메인에서 이러한 명령 앞에 /host=HOST_NAME/server=SERVER_NAME
.
/subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true) { "outcome" => "success", "result" => { "ActiveCount" => 1, "AvailableCount" => 20, "AverageBlockingTime" => 0L, "AverageCreationTime" => 122L, "AverageGetTime" => 128L, "AveragePoolTime" => 0L, "AverageUsageTime" => 0L, "BlockingFailureCount" => 0, "CreatedCount" => 1, "DestroyedCount" => 0, "IdleCount" => 1, ... }
/subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true)
{
"outcome" => "success",
"result" => {
"ActiveCount" => 1,
"AvailableCount" => 20,
"AverageBlockingTime" => 0L,
"AverageCreationTime" => 122L,
"AverageGetTime" => 128L,
"AveragePoolTime" => 0L,
"AverageUsageTime" => 0L,
"BlockingFailureCount" => 0,
"CreatedCount" => 1,
"DestroyedCount" => 0,
"IdleCount" => 1,
...
}
다음 관리 CLI 명령은 ExampleDS
데이터 소스에 대한 JDBC 통계를 검색합니다.
/subsystem=datasources/data-source=ExampleDS/statistics=jdbc:read-resource(include-runtime=true) { "outcome" => "success", "result" => { "PreparedStatementCacheAccessCount" => 0L, "PreparedStatementCacheAddCount" => 0L, "PreparedStatementCacheCurrentSize" => 0, "PreparedStatementCacheDeleteCount" => 0L, "PreparedStatementCacheHitCount" => 0L, "PreparedStatementCacheMissCount" => 0L, "statistics-enabled" => true } }
/subsystem=datasources/data-source=ExampleDS/statistics=jdbc:read-resource(include-runtime=true)
{
"outcome" => "success",
"result" => {
"PreparedStatementCacheAccessCount" => 0L,
"PreparedStatementCacheAddCount" => 0L,
"PreparedStatementCacheCurrentSize" => 0,
"PreparedStatementCacheDeleteCount" => 0L,
"PreparedStatementCacheHitCount" => 0L,
"PreparedStatementCacheMissCount" => 0L,
"statistics-enabled" => true
}
}
통계는 런타임 정보이므로 include-runtime=true
인수를 지정해야 합니다.