[ 
https://issues.apache.org/jira/browse/IGNITE-11927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16895388#comment-16895388
 ] 

Nikolay Izhikov commented on IGNITE-11927:
------------------------------------------

[~agura]

 If I understand you correctly, you propose a following solution.
Can you, please, take a look, and confirm it?

{code:java}
class MetricHolder {
  AtomicLongMetric m;

  public MetricHolder(GirdKernalContext ctx) {
    ctx.monitoring.onDisable("metrics", () -> {m = null;});
    ctx.monitoring.onEnable("metrics", r -> {m = r.longMetric("metric");});
  }

  public AtomicLongMetric m() {
    if (m == null)
      return NO_OP_METRIC;

    return m;
  }
}

class SomeProcessor {
  public SomeProcesor() {
    metricHolder = new MetricHolder(ctx);
  }

  public void changeState() {
    metricHolder.m().increment();
  }
}
{code}

> [IEP-35] Add ability to enable\disable subset of metrics
> --------------------------------------------------------
>
>                 Key: IGNITE-11927
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11927
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Nikolay Izhikov
>            Assignee: Nikolay Izhikov
>            Priority: Major
>              Labels: IEP-35
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Ignite should be able to:
> * Enable or disable an arbitrary subset of the metrics. User should be able 
> to do it in runtime.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to