Benjamin Mahler created MESOS-8964:
--------------------------------------

             Summary: Avoid performance penalty of Future for Counters and 
PushGauges.
                 Key: MESOS-8964
                 URL: https://issues.apache.org/jira/browse/MESOS-8964
             Project: Mesos
          Issue Type: Improvement
            Reporter: Benjamin Mahler


Currently, the Metric interface exposes a {{Future<double> value()}} of the 
current metric value. This means that for synchronous metrics, like Counter and 
PushGauge, there has to be (1) a memory allocation for the Future's shared 
pointer, as well as (2) continuations set up when the future is ready within 
process::await.

(2) Could be eliminated without changing the Metric interface by checking to 
see if {{value.isReady()}} and if so extracting the value rather than using 
process::await.

(1) Could be eliminated by having two types of metrics, e.g. Metric / 
AsyncMetric. Or by having two methods, e.g. value() / async_value(), along with 
a {{bool async()}} indicator of which one should be called.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to