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

Aleksey Plekhanov commented on IGNITE-12728:
--------------------------------------------

[~agura], I agree with Nikita. Using putAllAsync is ever worse now, because we 
don't increment put time at all and it leads to more significant statistics 
skew.

Computing statistics in a right way is not only extract dedicated metrics for 
putAll/getAll/removeAll time. It's a complicated task, because:
 # Puts count is incremented in {{innerSet/innerUpdate}} methods, and not 
coupled directly with {{put}} or {{putAll}} methods, we can't distinct two 
different calls from two different methods.
 # Puts count is incremented on each affinity (primary or backup) node, but put 
time is incremented only on initiator node.

So, to compute average operations time we should add new metrics counting 
put/putAll/get/getAll/remove/removeAll invocations on initiator node and these 
metrics should be counted independently of current operations count metrics on 
affinity node. 

> The cache#putAllAsync method does not collect statistics
> --------------------------------------------------------
>
>                 Key: IGNITE-12728
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12728
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Amelchev Nikita
>            Assignee: Amelchev Nikita
>            Priority: Major
>              Labels: IEP-35
>             Fix For: 2.9
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The cache#putAllAsync method does not collect statistics.
> The reproducer for {{GridCacheAbstractMetricsSelfTest}}:
> {noformat}
>     @Test
>     public void testPutAllAsyncAvgTime() throws Exception {
>         IgniteCache<Integer, Integer> cache = 
> grid(0).cache(DEFAULT_CACHE_NAME);
>         assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
>         assertEquals(0, cache.localMetrics().getCachePuts());
>         Map<Integer, Integer> values = new HashMap<>();
>         values.put(1, 1);
>         values.put(2, 2);
>         values.put(3, 3);
>         IgniteFuture<Void> fut = cache.putAllAsync(values);
>         fut.get();
>         assertTrue(waitForCondition(() -> 
> cache.localMetrics().getAveragePutTime() > 0, 30_000));
>         assertEquals(values.size(), cache.localMetrics().getCachePuts());
>     }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to