-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74557/#review225682
-----------------------------------------------------------


Ship it!




Ship It!

- Ramachandran Krishnan


On Aug. 24, 2023, 11:30 a.m., Vikas Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74557/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2023, 11:30 a.m.)
> 
> 
> Review request for ranger, Dhaval Shah, Abhay Kulkarni, Madhan Neethiraj, and 
> Sailaja Polavarapu.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-4196- Tomcat runtime metrics collection .
> 
> As part of RANGER-4196, developed the feature to collect runtime container 
> metrics that can help in debugging any performance issue. Although I have 
> tested it  for KMS only, but change has been made in a way that it will be 
> avilable for all ranger modules if registered with "ranger-metrics" module.
> 
> 
> Diffs
> -----
> 
>   
> embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
>  cae9075a7 
>   
> embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServerMetricsCollector.java
>  PRE-CREATION 
>   ranger-metrics/pom.xml 44602c3b8 
>   
> ranger-metrics/src/main/java/org/apache/ranger/metrics/RangerMetricsSystemWrapper.java
>  cd806574d 
>   
> ranger-metrics/src/main/java/org/apache/ranger/metrics/source/RangerMetricsContainerSource.java
>  PRE-CREATION 
>   
> ranger-metrics/src/test/java/org/apache/ranger/metrics/source/TestRangerMetricsContainerSource.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/74557/diff/3/
> 
> 
> Testing
> -------
> 
> build is passed.
> Patched the new jar on existing cluster and tried to fetch the kms metrics. 
> Following is the output:
> 
> command: curl -ivk --negotiate -u : -H "Content-Type: application/json" -X 
> GET http://<KMSSERVER>:9292/kms/metrics/json
> 
> Output:
> 
> {
>   "KMS": {
>     "GET_CURRENT_KEY_COUNT": 0,
>     "DELETE_KEY_ELAPSED_TIME": 0,
>     "EEK_DECRYPT_ELAPSED_TIME": 0,
>     "GET_KEYS_METADATA_ELAPSED_TIME": 0,
>     "EEK_GENERATE_ELAPSED_TIME": 0,
>     "GET_CURRENT_KEY_ELAPSED_TIME": 0,
>     "EEK_REENCRYPT_ELAPSED_TIME": 0,
>     "KEY_CREATE_COUNT": 0,
>     "UNAUTHORIZED_CALLS_COUNT": 0,
>     "KEY_CREATE_ELAPSED_TIME": 0,
>     "GET_KEY_VERSION_COUNT": 0,
>     "ROLL_NEW_VERSION_ELAPSED_TIME": 0,
>     "REENCRYPT_EEK_BATCH_COUNT": 0,
>     "REENCRYPT_EEK_BATCH_ELAPSED_TIME": 0,
>     "GET_KEYS_METADATA_COUNT": 0,
>     "GET_KEY_VERSIONS_COUNT": 0,
>     "GET_KEY_VERSIONS_ELAPSED_TIME": 0,
>     "GET_KEYS_COUNT": 0,
>     "EEK_GENERATE_COUNT": 0,
>     "INVALIDATE_CACHE_COUNT": 0,
>     "GET_METADATA_COUNT": 0,
>     "REENCRYPT_EEK_BATCH_KEYS_COUNT": 0,
>     "EEK_REENCRYPT_COUNT": 0,
>     "UNAUTHENTICATED_CALLS_COUNT": 3,
>     "GET_KEY_VERSION_ELAPSED_TIME": 0,
>     "INVALIDATE_CACHE_ELAPSED_TIME": 0,
>     "ROLL_NEW_VERSION_COUNT": 0,
>     "EEK_DECRYPT_COUNT": 0,
>     "GET_KEYS_METADATA_KEYNAMES_COUNT": 0,
>     "DELETE_KEY_COUNT": 0,
>     "GET_KEYS_ELAPSED_TIME": 0,
>     "GET_METADATA_ELAPSED_TIME": 0,
>     "TOTAL_CALL_COUNT": 6
>   },
>   "RangerWebContainer": {
>     "ActiveConnectionsCount": 2,
>     "ConnectionTimeout": 60000,
>     "MaxWorkerThreadsCount": 200,
>     "TotalWorkerThreadsCount": 10,
>     "KeepAliveTimeout": 60000,
>     "ActiveWorkerThreadsCount": 0,
>     "ConnectionAcceptCount": 100,
>     "MinSpareWorkerThreadsCount": 10,
>     "MaxConnectionsCount": 8192
>   },
>   "RangerJvm": {
>     "GcTimeTotal": 595,
>     "SystemLoadAvg": 10.21,
>     "ThreadsBusy": 5,
>     "GcCountTotal": 17,
>     "MemoryMax": 967311360,
>     "MemoryCurrent": 273806280,
>     "ThreadsWaiting": 17,
>     "ProcessorsAvailable": 4,
>     "GcTimeMax": 595,
>     "ThreadsBlocked": 0,
>     "ThreadsRemaining": 16
>   }
> }
> 
> Knowing the Tomcat connector type is also useful, so logged following on 
> container startup.
> 
> 2023-08-22 12:43:45,080 INFO  org.apache.ranger.server.tomcat.EmbeddedServer: 
> [vktomcat-1.vktomcat.********-startStop-1]: Selected Tomcat protocolHandler: 
> "http-nio-9292"
> 
> 
> File Attachments
> ----------------
> 
> Updated with test case.
>   
> https://reviews.apache.org/media/uploaded/files/2023/08/24/959a2112-6186-414a-9d84-c41a0fc677ad__0001-RANGER-4196-Tomcat-metrics-collection-code.patch
> 
> 
> Thanks,
> 
> Vikas Kumar
> 
>

Reply via email to