[
https://issues.apache.org/jira/browse/HADOOP-16290?focusedWorklogId=622905&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-622905
]
ASF GitHub Bot logged work on HADOOP-16290:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jul/21 08:18
Start Date: 15/Jul/21 08:18
Worklog Time Spent: 10m
Work Description: jojochuang commented on a change in pull request #3198:
URL: https://github.com/apache/hadoop/pull/3198#discussion_r670240464
##########
File path:
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
##########
@@ -1603,6 +1603,70 @@ public void testSetProtocolEngine() {
assertTrue(rpcEngine instanceof StoppedRpcEngine);
}
+ @Test
+ public void testRpcMetricsInNanos() throws Exception {
+ final Server server;
+ TestRpcService proxy = null;
+
+ final int interval = 1;
+ conf.setBoolean(CommonConfigurationKeys.
+ RPC_METRICS_QUANTILE_ENABLE, true);
+ conf.set(CommonConfigurationKeys.
+ RPC_METRICS_PERCENTILES_INTERVALS_KEY, "" + interval);
+ conf.set(CommonConfigurationKeys.RPC_METRICS_TIME_UNIT, "NANOSECONDS");
+
+ server = setupTestServer(conf, 5);
+ String testUser = "testUserInNanos";
+ UserGroupInformation anotherUser =
+ UserGroupInformation.createRemoteUser(testUser);
+ TestRpcService proxy2 =
+ anotherUser.doAs((PrivilegedAction<TestRpcService>) () -> {
+ try {
+ return RPC.getProxy(TestRpcService.class, 0,
+ server.getListenerAddress(), conf);
+ } catch (IOException e) {
+ e.printStackTrace();
Review comment:
Let's use a logger to record it rather than printing to stderr?
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcMetrics.java
##########
@@ -97,10 +98,25 @@
public String name() { return name; }
public static RpcMetrics create(Server server, Configuration conf) {
+ setMetricTimeUnit(conf);
RpcMetrics m = new RpcMetrics(server, conf);
return DefaultMetricsSystem.instance().register(m.name, null, m);
}
+ private static void setMetricTimeUnit(Configuration conf) {
Review comment:
this can be error-prone because a process can have multiple Server
binding at different ports at the same time.
So metricsTimeUnit is initialized multiple times for each Server creation.
Hopefully they end up using the same metric unit. Otherwise this could
hypothetically create confusion later on.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 622905)
Time Spent: 50m (was: 40m)
> Enable RpcMetrics units to be configurable
> ------------------------------------------
>
> Key: HADOOP-16290
> URL: https://issues.apache.org/jira/browse/HADOOP-16290
> Project: Hadoop Common
> Issue Type: Improvement
> Components: ipc, metrics
> Reporter: Erik Krogen
> Assignee: Viraj Jasani
> Priority: Major
> Labels: pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> One resulting discussion from HADOOP-16266 was that it would be better for
> the RPC metrics (processing time, queue time) to be in micro- or nanoseconds,
> since milliseconds does not accurately capture the processing time of many
> RPC operations. HADOOP-16266 made some small changes in this direction, but
> to keep the size of the patch down, we did not make it fully configurable. We
> can complete that work here.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]