You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/09/29 14:01:28 UTC

[GitHub] [ignite] NSAmelchev opened a new pull request #9446: IGNITE-15590 Add batch cache operations histogram metrics

NSAmelchev opened a new pull request #9446:
URL: https://github.com/apache/ignite/pull/9446


   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] NSAmelchev merged pull request #9446: IGNITE-15590 Add batch cache operations histogram metrics

Posted by GitBox <gi...@apache.org>.
NSAmelchev merged pull request #9446:
URL: https://github.com/apache/ignite/pull/9446


   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] NSAmelchev merged pull request #9446: IGNITE-15590 Add batch cache operations histogram metrics

Posted by GitBox <gi...@apache.org>.
NSAmelchev merged pull request #9446:
URL: https://github.com/apache/ignite/pull/9446


   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] NSAmelchev commented on a change in pull request #9446: IGNITE-15590 Add batch cache operations histogram metrics

Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on a change in pull request #9446:
URL: https://github.com/apache/ignite/pull/9446#discussion_r726062566



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
##########
@@ -1429,52 +1431,80 @@ public void testInvokeAllAsyncMultipleKeysAvgTime() throws IgniteCheckedExceptio
 
     /** */
     @Test
-    public void testGetTime() {
+    public void testGetTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        HistogramMetricImpl m = metric("GetTime");
+        HistogramMetricImpl getTime = metric("GetTime");
+        HistogramMetricImpl getAllTime = metric("GetAllTime");
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(getTime.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(getAllTime.value()).allMatch(v -> v == 0));
 
-        cache.put(1, 1);
+        cache.get(1);
+        cache.getAsync(1).get();
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(waitForCondition(() -> Arrays.stream(getTime.value()).sum() == 2, getTestTimeout()));
+        assertEquals(0, Arrays.stream(getAllTime.value()).sum());
 
-        cache.get(1);
+        cache.getAll(Collections.singleton(1));
+        cache.getAllAsync(Collections.singleton(1)).get();
 
-        assertEquals(1, Arrays.stream(m.value()).filter(v -> v == 1).count());
+        assertTrue(waitForCondition(() -> Arrays.stream(getAllTime.value()).sum() == 2, getTestTimeout()));
+        assertEquals(2, Arrays.stream(getTime.value()).sum());
     }
 
     /** */
     @Test
-    public void testPutTime() {
+    public void testPutTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        HistogramMetricImpl m = metric("PutTime");
+        HistogramMetricImpl putTime = metric("PutTime");
+        HistogramMetricImpl putAllTime = metric("PutAllTime");
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(putTime.value()).allMatch(v -> v == 0));

Review comment:
       Here we expect that all values are exactly zero. In other places, we can't predict duration time.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9446: IGNITE-15590 Add batch cache operations histogram metrics

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9446:
URL: https://github.com/apache/ignite/pull/9446#discussion_r726037186



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
##########
@@ -1429,52 +1431,80 @@ public void testInvokeAllAsyncMultipleKeysAvgTime() throws IgniteCheckedExceptio
 
     /** */
     @Test
-    public void testGetTime() {
+    public void testGetTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        HistogramMetricImpl m = metric("GetTime");
+        HistogramMetricImpl getTime = metric("GetTime");
+        HistogramMetricImpl getAllTime = metric("GetAllTime");
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(getTime.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(getAllTime.value()).allMatch(v -> v == 0));
 
-        cache.put(1, 1);
+        cache.get(1);
+        cache.getAsync(1).get();
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(waitForCondition(() -> Arrays.stream(getTime.value()).sum() == 2, getTestTimeout()));
+        assertEquals(0, Arrays.stream(getAllTime.value()).sum());
 
-        cache.get(1);
+        cache.getAll(Collections.singleton(1));
+        cache.getAllAsync(Collections.singleton(1)).get();
 
-        assertEquals(1, Arrays.stream(m.value()).filter(v -> v == 1).count());
+        assertTrue(waitForCondition(() -> Arrays.stream(getAllTime.value()).sum() == 2, getTestTimeout()));
+        assertEquals(2, Arrays.stream(getTime.value()).sum());
     }
 
     /** */
     @Test
-    public void testPutTime() {
+    public void testPutTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        HistogramMetricImpl m = metric("PutTime");
+        HistogramMetricImpl putTime = metric("PutTime");
+        HistogramMetricImpl putAllTime = metric("PutAllTime");
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(putTime.value()).allMatch(v -> v == 0));

Review comment:
       It might be better to replace allMatch with sum() == 0, because you check then sum() == 2?
   Moreover, it might be better to extract Arrays.stream().sum condition into a separate method/closure sum?




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9446: IGNITE-15590 Add batch cache operations histogram metrics

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9446:
URL: https://github.com/apache/ignite/pull/9446#discussion_r726037186



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
##########
@@ -1429,52 +1431,80 @@ public void testInvokeAllAsyncMultipleKeysAvgTime() throws IgniteCheckedExceptio
 
     /** */
     @Test
-    public void testGetTime() {
+    public void testGetTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        HistogramMetricImpl m = metric("GetTime");
+        HistogramMetricImpl getTime = metric("GetTime");
+        HistogramMetricImpl getAllTime = metric("GetAllTime");
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(getTime.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(getAllTime.value()).allMatch(v -> v == 0));
 
-        cache.put(1, 1);
+        cache.get(1);
+        cache.getAsync(1).get();
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(waitForCondition(() -> Arrays.stream(getTime.value()).sum() == 2, getTestTimeout()));
+        assertEquals(0, Arrays.stream(getAllTime.value()).sum());
 
-        cache.get(1);
+        cache.getAll(Collections.singleton(1));
+        cache.getAllAsync(Collections.singleton(1)).get();
 
-        assertEquals(1, Arrays.stream(m.value()).filter(v -> v == 1).count());
+        assertTrue(waitForCondition(() -> Arrays.stream(getAllTime.value()).sum() == 2, getTestTimeout()));
+        assertEquals(2, Arrays.stream(getTime.value()).sum());
     }
 
     /** */
     @Test
-    public void testPutTime() {
+    public void testPutTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        HistogramMetricImpl m = metric("PutTime");
+        HistogramMetricImpl putTime = metric("PutTime");
+        HistogramMetricImpl putAllTime = metric("PutAllTime");
 
-        assertTrue(Arrays.stream(m.value()).allMatch(v -> v == 0));
+        assertTrue(Arrays.stream(putTime.value()).allMatch(v -> v == 0));

Review comment:
       It might be better to replace allMatch with sum() == 0, because you check then sum() == 2.
   Moreover, it might be better to extract Arrays.stream().sum condition into a separate method/closure sum.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org