sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject sentry git commit: SENTRY-2392: Add metrics statistics to list_user_privileges and list_role_privileges API (Sergio Pena, reviewed by Na Li)
Date Thu, 06 Sep 2018 19:08:09 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 4e6305e89 -> aefaa029d


SENTRY-2392: Add metrics statistics to list_user_privileges and list_role_privileges API (Sergio
Pena, reviewed by Na Li)


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/aefaa029
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/aefaa029
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/aefaa029

Branch: refs/heads/master
Commit: aefaa029dcb532fe3fd1740efa255a90ef63da35
Parents: 4e6305e
Author: Sergio Pena <sergio.pena@cloudera.com>
Authored: Thu Sep 6 14:05:05 2018 -0500
Committer: Sergio Pena <sergio.pena@cloudera.com>
Committed: Thu Sep 6 14:05:35 2018 -0500

----------------------------------------------------------------------
 .../java/org/apache/sentry/api/service/thrift/SentryMetrics.java | 4 ++++
 .../sentry/api/service/thrift/SentryPolicyStoreProcessor.java    | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/aefaa029/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryMetrics.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryMetrics.java
b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryMetrics.java
index 35c7d07..236a07b 100644
--- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryMetrics.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryMetrics.java
@@ -113,6 +113,10 @@ public final class SentryMetrics {
       name(SentryPolicyStoreProcessor.class, "list-privileges-for-provider"));
   final Timer listPrivilegesByAuthorizableTimer = METRIC_REGISTRY.timer(
       name(SentryPolicyStoreProcessor.class, "list-privileges-by-authorizable"));
+  final Timer listRolesPrivilegesTimer = METRIC_REGISTRY.timer(
+      name(SentryPolicyStoreProcessor.class, "list-roles-privileges"));
+  final Timer listUsersPrivilegesTimer = METRIC_REGISTRY.timer(
+    name(SentryPolicyStoreProcessor.class, "list-users-privileges"));
   final Timer notificationProcessTimer = METRIC_REGISTRY.timer(
           name(SentryPolicyStoreProcessor.class, "process-hsm-notification"));
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/aefaa029/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyStoreProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyStoreProcessor.java
b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyStoreProcessor.java
index 008a48e..3a9623b 100644
--- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyStoreProcessor.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyStoreProcessor.java
@@ -1369,7 +1369,7 @@ public class SentryPolicyStoreProcessor implements SentryPolicyService.Iface
{
     TSentryPrivilegesResponse response = new TSentryPrivilegesResponse();
     String requestor = request.getRequestorUserName();
 
-    try {
+    try (Timer.Context timerContext = sentryMetrics.listRolesPrivilegesTimer.time()) {
       // Throws SentryThriftAPIMismatchException if protocol version mismatch
       validateClientVersion(request.getProtocol_version());
 
@@ -1403,7 +1403,7 @@ public class SentryPolicyStoreProcessor implements SentryPolicyService.Iface
{
     TSentryPrivilegesResponse response = new TSentryPrivilegesResponse();
     String requestor = request.getRequestorUserName();
 
-    try {
+    try (Timer.Context timerContext = sentryMetrics.listUsersPrivilegesTimer.time()) {
       // Throws SentryThriftAPIMismatchException if protocol version mismatch
       validateClientVersion(request.getProtocol_version());
 


Mime
View raw message