You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Sushil Ks (JIRA)" <ji...@apache.org> on 2018/08/16 15:37:00 UTC
[jira] [Comment Edited] (HADOOP-15657) Registering MutableQuantiles
via Metric annotation
[ https://issues.apache.org/jira/browse/HADOOP-15657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575883#comment-16575883 ]
Sushil Ks edited comment on HADOOP-15657 at 8/16/18 3:36 PM:
-------------------------------------------------------------
This patch is trying to register mutableQuantiles through reflection similar to other MutableMetric, created sample MutableQuantile metric as follows and tested locally with JVisualVM viewer
{code:java}
public class TestMutableQuantilesMetric {
@Metric(about = "async PUT entities latency", valueName = "latency")
private static MutableQuantiles foobarAsyncLatency;
@Test
public void testMetrics() throws InterruptedException {
DefaultMetricsSystem.initialize("testService").register("foo", "bar", new
TestMutableQuantilesMetric());
Random random = new Random();
ScheduledExecutorService executorService = Executors
.newSingleThreadScheduledExecutor();
executorService.scheduleAtFixedRate(() -> foobarAsyncLatency.add(random.nextInt(100)), 0, 1, TimeUnit.SECONDS);
executorService.awaitTermination(10, TimeUnit.MINUTES);
}
}
{code}
was (Author: sushil-k-s):
This patch is trying to register mutableQuantiles through reflection similar to other MutableMetric, created sample MutableQuantile metric as follows and tested locally with JVisualVM viewer
> Registering MutableQuantiles via Metric annotation
> --------------------------------------------------
>
> Key: HADOOP-15657
> URL: https://issues.apache.org/jira/browse/HADOOP-15657
> Project: Hadoop Common
> Issue Type: Improvement
> Components: metrics
> Reporter: Sushil Ks
> Priority: Major
> Attachments: HADOOP-15657.001.patch
>
>
> Currently when creating new metrics we use @Metric annotation for registering the MutableMetric i.e
> {code:java}
> @Metric
> private MutableInt foobarMetricCount
> {code}
> However, there's no support for registering MutableQuantiles via Metric annotation, hence creating this Jira to register MutableQuantiles via Metric annotation.
> Example:
>
> {code:java}
> @Metric(about = "async PUT entities latency", valueName = "latency", interval = 10)
> private MutableQuantiles foobarAsyncLatency;
>
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org