RANGER-4388: KMS metrics good coding practice review comments incorpo… #494
+99
−126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ration
What changes were proposed in this pull request?
Few review comments were provided on KMS API metrics implementation but after PR merge. This JIRA addresses those review comments.
Review comments: https://reviews.apache.org/r/74396/
All comments has been incorporated except one, that is to rename the API metrics. It may break backward compatibility if any product is consuming these metrics.
How was this patch tested?
-mvn clean install worked
Sample metrics response:
{ "KMS" : { "GET_CURRENT_KEY_COUNT" : 1, "DELETE_KEY_ELAPSED_TIME" : 41, "EEK_DECRYPT_ELAPSED_TIME" : 61, "GET_KEYS_METADATA_ELAPSED_TIME" : 30, "EEK_GENERATE_ELAPSED_TIME" : 85, "GET_CURRENT_KEY_ELAPSED_TIME" : 46, "EEK_REENCRYPT_ELAPSED_TIME" : 0, "KEY_CREATE_COUNT" : 2, "UNAUTHORIZED_CALLS_COUNT" : 0, "KEY_CREATE_ELAPSED_TIME" : 189, "GET_KEY_VERSION_COUNT" : 4, "ROLL_NEW_VERSION_ELAPSED_TIME" : 83, "REENCRYPT_EEK_BATCH_COUNT" : 0, "REENCRYPT_EEK_BATCH_ELAPSED_TIME" : 0, "GET_KEYS_METADATA_COUNT" : 1, "GET_KEY_VERSIONS_COUNT" : 0, "GET_KEY_VERSIONS_ELAPSED_TIME" : 0, "GET_KEYS_COUNT" : 5, "EEK_GENERATE_COUNT" : 2, "INVALIDATE_CACHE_COUNT" : 1, "GET_METADATA_COUNT" : 6, "REENCRYPT_EEK_BATCH_KEYS_COUNT" : 0, "EEK_REENCRYPT_COUNT" : 0, "UNAUTHENTICATED_CALLS_COUNT" : 0, "GET_KEY_VERSION_ELAPSED_TIME" : 45, "INVALIDATE_CACHE_ELAPSED_TIME" : 14, "ROLL_NEW_VERSION_COUNT" : 1, "EEK_DECRYPT_COUNT" : 3, "GET_KEYS_METADATA_KEYNAMES_COUNT" : 0, "DELETE_KEY_COUNT" : 1, "GET_KEYS_ELAPSED_TIME" : 136, "GET_METADATA_ELAPSED_TIME" : 177, "TOTAL_CALL_COUNT" : 40 }, "RangerWebContainer" : { "ActiveConnectionsCount" : 1, "ConnectionTimeout" : 60000, "MaxWorkerThreadsCount" : 200, "TotalWorkerThreadsCount" : 10, "KeepAliveTimeout" : 60000, "ActiveWorkerThreadsCount" : 0, "ConnectionAcceptCount" : 100, "MinSpareWorkerThreadsCount" : 10, "MaxConnectionsCount" : 8192 }, "RangerJvm" : { "GcTimeTotal" : 795, "SystemLoadAvg" : 0.02, "ThreadsBusy" : 5, "GcCountTotal" : 10, "MemoryMax" : 1008205824, "MemoryCurrent" : 251048424, "ThreadsWaiting" : 25, "ProcessorsAvailable" : 5, "GcTimeMax" : 795, "ThreadsBlocked" : 0, "ThreadsRemaining" : 16 }
CC: @mneethiraj