[GitHub] [ignite] asfgit closed pull request #6847: IGNITE-12147 Thin client: Fixed partitions response for caches with n…

2019-09-16 Thread GitBox
asfgit closed pull request #6847: IGNITE-12147 Thin client: Fixed partitions 
response for caches with n…
URL: https://github.com/apache/ignite/pull/6847
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6845: IGNITE-12145: Monitoring list engine.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6845: IGNITE-12145: Monitoring 
list engine.
URL: https://github.com/apache/ignite/pull/6845#discussion_r324737194
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.metric;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.spi.metric.view.SystemView;
+import org.apache.ignite.spi.metric.view.CacheGroupView;
+import org.apache.ignite.spi.metric.view.CacheView;
+import org.apache.ignite.spi.metric.view.ComputeTaskView;
+import org.apache.ignite.spi.metric.view.ServiceView;
+import org.apache.ignite.internal.processors.service.DummyService;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHES_VIEW;
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHE_GRPS_VIEW;
+import static 
org.apache.ignite.internal.processors.service.IgniteServiceProcessor.SVCS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+
+/** */
+public class SystemViewSelfTest extends GridCommonAbstractTest {
+/** */
+private static CountDownLatch latch;
+
+/** */
+@Test
+public void testCachesView() throws Exception {
+try (IgniteEx g = startGrid()) {
+Set cacheNames = new HashSet<>(Arrays.asList("cache-1", 
"cache-2"));
+
+for (String name : cacheNames)
+g.createCache(name);
+
+SystemView caches = 
g.context().metric().view(CACHES_VIEW);
+
+assertEquals(g.context().cache().cacheDescriptors().size(), 
F.size(caches.iterator()));
+
+for (CacheView row : caches)
+cacheNames.remove(row.cacheName());
+
+assertTrue(cacheNames.toString(), cacheNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testCacheGroupsView() throws Exception {
+try(IgniteEx g = startGrid()) {
+Set grpNames = new HashSet<>(Arrays.asList("grp-1", 
"grp-2"));
+
+for (String grpName : grpNames)
+g.createCache(new CacheConfiguration<>("cache-" + 
grpName).setGroupName(grpName));
+
+SystemView grps = 
g.context().metric().view(CACHE_GRPS_VIEW);
+
+assertEquals(g.context().cache().cacheGroupDescriptors().size(), 
F.size(grps.iterator()));
+
+for (CacheGroupView row : grps)
+grpNames.remove(row.cacheGroupName());
+
+assertTrue(grpNames.toString(), grpNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testServices() throws Exception {
+try(IgniteEx g = startGrid()) {
+ServiceConfiguration srvcCfg = new ServiceConfiguration();
+
+srvcCfg.setName("service");
+srvcCfg.setMaxPerNodeCount(1);
+srvcCfg.setService(new DummyService());
+
+g.services().deploy(srvcCfg);
+
+SystemView srvs = 
g.context().metric().view(SVCS_VIEW);
+
+assertEquals(g.context().service().serviceDescriptors().size(), 
F.size(srvs.iterator()));
+
+ServiceView sview = srvs.iterator().next();
+
+assertEquals(srvcCfg.getName(), sview.name());
+assertEquals(srvcCfg.getMaxPerNodeCount(), 
sview.maxPerNodeCount());
+assertEquals(DummyService.class, sview.serviceClass());
+}
+}
+
+/** */
+@Test
+public void testComputeBroadcast() throws Exception {
 
 Review comment:
   Fixed!!!


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

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6845: IGNITE-12145: Monitoring list engine.

2019-09-16 Thread GitBox
alex-plekhanov commented on a change in pull request #6845: IGNITE-12145: 
Monitoring list engine.
URL: https://github.com/apache/ignite/pull/6845#discussion_r324734102
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.metric;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.spi.metric.view.SystemView;
+import org.apache.ignite.spi.metric.view.CacheGroupView;
+import org.apache.ignite.spi.metric.view.CacheView;
+import org.apache.ignite.spi.metric.view.ComputeTaskView;
+import org.apache.ignite.spi.metric.view.ServiceView;
+import org.apache.ignite.internal.processors.service.DummyService;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHES_VIEW;
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHE_GRPS_VIEW;
+import static 
org.apache.ignite.internal.processors.service.IgniteServiceProcessor.SVCS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+
+/** */
+public class SystemViewSelfTest extends GridCommonAbstractTest {
+/** */
+private static CountDownLatch latch;
+
+/** */
+@Test
+public void testCachesView() throws Exception {
+try (IgniteEx g = startGrid()) {
+Set cacheNames = new HashSet<>(Arrays.asList("cache-1", 
"cache-2"));
+
+for (String name : cacheNames)
+g.createCache(name);
+
+SystemView caches = 
g.context().metric().view(CACHES_VIEW);
+
+assertEquals(g.context().cache().cacheDescriptors().size(), 
F.size(caches.iterator()));
+
+for (CacheView row : caches)
+cacheNames.remove(row.cacheName());
+
+assertTrue(cacheNames.toString(), cacheNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testCacheGroupsView() throws Exception {
+try(IgniteEx g = startGrid()) {
+Set grpNames = new HashSet<>(Arrays.asList("grp-1", 
"grp-2"));
+
+for (String grpName : grpNames)
+g.createCache(new CacheConfiguration<>("cache-" + 
grpName).setGroupName(grpName));
+
+SystemView grps = 
g.context().metric().view(CACHE_GRPS_VIEW);
+
+assertEquals(g.context().cache().cacheGroupDescriptors().size(), 
F.size(grps.iterator()));
+
+for (CacheGroupView row : grps)
+grpNames.remove(row.cacheGroupName());
+
+assertTrue(grpNames.toString(), grpNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testServices() throws Exception {
+try(IgniteEx g = startGrid()) {
+ServiceConfiguration srvcCfg = new ServiceConfiguration();
+
+srvcCfg.setName("service");
+srvcCfg.setMaxPerNodeCount(1);
+srvcCfg.setService(new DummyService());
+
+g.services().deploy(srvcCfg);
+
+SystemView srvs = 
g.context().metric().view(SVCS_VIEW);
+
+assertEquals(g.context().service().serviceDescriptors().size(), 
F.size(srvs.iterator()));
+
+ServiceView sview = srvs.iterator().next();
+
+assertEquals(srvcCfg.getName(), sview.name());
+assertEquals(srvcCfg.getMaxPerNodeCount(), 
sview.maxPerNodeCount());
+assertEquals(DummyService.class, sview.serviceClass());
+}
+}
+
+/** */
+@Test
+public void testComputeBroadcast() throws Exception {
 
 Review comment:
   I think we should cover more cases for tasks (for example run tasks by 
name/by class/by closure, run tasks from another node), to see different values 
for different rows in one column of the list. The sa

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6845: IGNITE-12145: Monitoring list engine.

2019-09-16 Thread GitBox
alex-plekhanov commented on a change in pull request #6845: IGNITE-12145: 
Monitoring list engine.
URL: https://github.com/apache/ignite/pull/6845#discussion_r324731050
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.metric;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.spi.metric.view.SystemView;
+import org.apache.ignite.spi.metric.view.CacheGroupView;
+import org.apache.ignite.spi.metric.view.CacheView;
+import org.apache.ignite.spi.metric.view.ComputeTaskView;
+import org.apache.ignite.spi.metric.view.ServiceView;
+import org.apache.ignite.internal.processors.service.DummyService;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHES_VIEW;
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHE_GRPS_VIEW;
+import static 
org.apache.ignite.internal.processors.service.IgniteServiceProcessor.SVCS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+
+/** */
+public class SystemViewSelfTest extends GridCommonAbstractTest {
+/** */
+private static CountDownLatch latch;
+
+/** */
+@Test
+public void testCachesView() throws Exception {
+try (IgniteEx g = startGrid()) {
+Set cacheNames = new HashSet<>(Arrays.asList("cache-1", 
"cache-2"));
+
+for (String name : cacheNames)
+g.createCache(name);
+
+SystemView caches = 
g.context().metric().view(CACHES_VIEW);
+
+assertEquals(g.context().cache().cacheDescriptors().size(), 
F.size(caches.iterator()));
+
+for (CacheView row : caches)
+cacheNames.remove(row.cacheName());
+
+assertTrue(cacheNames.toString(), cacheNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testCacheGroupsView() throws Exception {
+try(IgniteEx g = startGrid()) {
+Set grpNames = new HashSet<>(Arrays.asList("grp-1", 
"grp-2"));
+
+for (String grpName : grpNames)
+g.createCache(new CacheConfiguration<>("cache-" + 
grpName).setGroupName(grpName));
+
+SystemView grps = 
g.context().metric().view(CACHE_GRPS_VIEW);
+
+assertEquals(g.context().cache().cacheGroupDescriptors().size(), 
F.size(grps.iterator()));
+
+for (CacheGroupView row : grps)
+grpNames.remove(row.cacheGroupName());
+
+assertTrue(grpNames.toString(), grpNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testServices() throws Exception {
+try(IgniteEx g = startGrid()) {
+ServiceConfiguration srvcCfg = new ServiceConfiguration();
+
+srvcCfg.setName("service");
+srvcCfg.setMaxPerNodeCount(1);
+srvcCfg.setService(new DummyService());
+
+g.services().deploy(srvcCfg);
+
+SystemView srvs = 
g.context().metric().view(SVCS_VIEW);
+
+assertEquals(g.context().service().serviceDescriptors().size(), 
F.size(srvs.iterator()));
+
+ServiceView sview = srvs.iterator().next();
+
+assertEquals(srvcCfg.getName(), sview.name());
+assertEquals(srvcCfg.getMaxPerNodeCount(), 
sview.maxPerNodeCount());
+assertEquals(DummyService.class, sview.serviceClass());
+}
+}
+
+/** */
+@Test
+public void testComputeBroadcast() throws Exception {
+latch = new CountDownLatch(1);
+
+try(IgniteEx g1 = startGrid(0)) {
+SystemView tasks = 
g1.context().metric().view(TASKS_VIEW);
+
+for (int i=0; i<5; i++)
 
 Review comment:
   Spaces m

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6845: IGNITE-12145: Monitoring list engine.

2019-09-16 Thread GitBox
alex-plekhanov commented on a change in pull request #6845: IGNITE-12145: 
Monitoring list engine.
URL: https://github.com/apache/ignite/pull/6845#discussion_r324730783
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.metric;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.spi.metric.view.SystemView;
+import org.apache.ignite.spi.metric.view.CacheGroupView;
+import org.apache.ignite.spi.metric.view.CacheView;
+import org.apache.ignite.spi.metric.view.ComputeTaskView;
+import org.apache.ignite.spi.metric.view.ServiceView;
+import org.apache.ignite.internal.processors.service.DummyService;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHES_VIEW;
+import static 
org.apache.ignite.internal.processors.cache.ClusterCachesInfo.CACHE_GRPS_VIEW;
+import static 
org.apache.ignite.internal.processors.service.IgniteServiceProcessor.SVCS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+
+/** */
+public class SystemViewSelfTest extends GridCommonAbstractTest {
+/** */
+private static CountDownLatch latch;
+
+/** */
+@Test
+public void testCachesView() throws Exception {
+try (IgniteEx g = startGrid()) {
+Set cacheNames = new HashSet<>(Arrays.asList("cache-1", 
"cache-2"));
+
+for (String name : cacheNames)
+g.createCache(name);
+
+SystemView caches = 
g.context().metric().view(CACHES_VIEW);
+
+assertEquals(g.context().cache().cacheDescriptors().size(), 
F.size(caches.iterator()));
+
+for (CacheView row : caches)
+cacheNames.remove(row.cacheName());
+
+assertTrue(cacheNames.toString(), cacheNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testCacheGroupsView() throws Exception {
+try(IgniteEx g = startGrid()) {
+Set grpNames = new HashSet<>(Arrays.asList("grp-1", 
"grp-2"));
+
+for (String grpName : grpNames)
+g.createCache(new CacheConfiguration<>("cache-" + 
grpName).setGroupName(grpName));
+
+SystemView grps = 
g.context().metric().view(CACHE_GRPS_VIEW);
+
+assertEquals(g.context().cache().cacheGroupDescriptors().size(), 
F.size(grps.iterator()));
+
+for (CacheGroupView row : grps)
+grpNames.remove(row.cacheGroupName());
+
+assertTrue(grpNames.toString(), grpNames.isEmpty());
+}
+}
+
+/** */
+@Test
+public void testServices() throws Exception {
+try(IgniteEx g = startGrid()) {
+ServiceConfiguration srvcCfg = new ServiceConfiguration();
+
+srvcCfg.setName("service");
+srvcCfg.setMaxPerNodeCount(1);
+srvcCfg.setService(new DummyService());
+
+g.services().deploy(srvcCfg);
+
+SystemView srvs = 
g.context().metric().view(SVCS_VIEW);
+
+assertEquals(g.context().service().serviceDescriptors().size(), 
F.size(srvs.iterator()));
+
+ServiceView sview = srvs.iterator().next();
+
+assertEquals(srvcCfg.getName(), sview.name());
+assertEquals(srvcCfg.getMaxPerNodeCount(), 
sview.maxPerNodeCount());
+assertEquals(DummyService.class, sview.serviceClass());
+}
+}
+
+/** */
+@Test
+public void testComputeBroadcast() throws Exception {
+latch = new CountDownLatch(1);
+
+try(IgniteEx g1 = startGrid(0)) {
 
 Review comment:
   Space missed


This is an automated message from the Apa

[GitHub] [ignite] kcmvp edited a comment on issue #6868: @SpringResource is silently ignored if no Spring context is provided

2019-09-16 Thread GitBox
kcmvp edited a comment on issue #6868: @SpringResource is silently ignored if 
no Spring context is provided
URL: https://github.com/apache/ignite/pull/6868#issuecomment-531567892
 
 
   
https://ci.ignite.apache.org/viewLog.html?buildId=4599188&buildTypeId=IgniteTests24Java8_BuildApacheIgnite&tab=buildResultsDiv&branch_IgniteTests24Java8=pull%2F6868%2Fhead


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] vveider commented on a change in pull request #4942: IGNITE-9836 Fixed check of java version with "ea" suffix

2019-09-16 Thread GitBox
vveider commented on a change in pull request #4942: IGNITE-9836 Fixed check of 
java version with "ea" suffix
URL: https://github.com/apache/ignite/pull/4942#discussion_r324706837
 
 

 ##
 File path: bin/include/functions.sh
 ##
 @@ -40,12 +40,7 @@ javaMajorVersion() {
 if [ ${version} -eq 1 ]; then
 # Version seems starts from 1, we need second number.
 javaVersion "$1"
-backIFS=$IFS
-
-IFS=. ver=(${version##*-})
-version=${ver[1]}
-
-IFS=$backIFS
+version=$(echo ${version} | awk -F[\"\.] '{print $2}')
 
 Review comment:
   I would use the following notation:
   `version=$(awk -F[\"\.] '{print $2}' <<< ${version})`


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324684423
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
 ##
 @@ -2860,14 +2895,17 @@ final void reset0() {
  * Gets outbound messages queue size.
  *
  * @return Write queue size.
+ * @deprecated Will be removed in the next major release and replaced with 
new metrics API.
  */
+@Deprecated
 public int outboundMessagesQueueSize() {
-int res = 0;
-
-for (GridSelectorNioSessionImpl ses : sessions)
-res += ses.writeQueueSize();
+if (mreg == null)
+return -1;
 
-return res;
+return (int) mreg.longAdderMetric(
 
 Review comment:
   It's about unnecessary `Map#get` operation.
   Every 'mreg.longAdderMetric` translates to `Map#get`.
   Why do we need it? We can store the variable, isn't it?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324678520
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
 ##
 @@ -115,8 +122,9 @@ public IgniteTestResources(MBeanServer jmx) throws 
IgniteCheckedException {
 assert jmx != null;
 
 this.jmx = jmx;
-this.log = rootLog.getLogger(getClass());
-this.rsrcProc = new GridResourceProcessor(new 
GridTestKernalContext(this.log));
+log = rootLog.getLogger(getClass());
 
 Review comment:
   same as above.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324678580
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
 ##
 @@ -126,8 +134,9 @@ public IgniteTestResources(IgniteLogger log) throws 
IgniteCheckedException {
 assert log != null;
 
 this.log = log.getLogger(getClass());
-this.jmx = prepareMBeanServer();
-this.rsrcProc = new GridResourceProcessor(new 
GridTestKernalContext(this.log));
+jmx = prepareMBeanServer();
 
 Review comment:
   same


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324678464
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
 ##
 @@ -93,19 +97,22 @@ public IgniteTestResources() throws IgniteCheckedException 
{
 else
 log = rootLog.getLogger(getClass());
 
-this.jmx = prepareMBeanServer();
+jmx = prepareMBeanServer();
+
+ctx = new GridTestKernalContext(log);
 
-this.rsrcProc = new GridResourceProcessor(new 
GridTestKernalContext(this.log));
+rsrcProc = new GridResourceProcessor(ctx);
 }
 
 /**
  * @param cfg Ignite configuration
  */
 public IgniteTestResources(IgniteConfiguration cfg) throws 
IgniteCheckedException {
 this.cfg = cfg;
-this.log = rootLog.getLogger(getClass());
-this.jmx = prepareMBeanServer();
-this.rsrcProc = new GridResourceProcessor(new 
GridTestKernalContext(this.log, this.cfg));
+log = rootLog.getLogger(getClass());
 
 Review comment:
   "this." was not necessary so I removed it while adding new field.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324678147
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
 ##
 @@ -403,6 +401,50 @@
 /** Handshake wait message type. */
 public static final short HANDSHAKE_WAIT_MSG_TYPE = -28;
 
+/** Communication metrics group name. */
+public static final String COMMUNICATION_METRICS_GROUP_NAME = 
"communication.tcp";
+
+/** */
+public static final String SENT_MESSAGES_METRIC_NAME = "sentMessagesCount";
+
+/** */
+public static final String SENT_MESSAGES_METRIC_DESC = "Total number of 
messages sent by current node";
+
+/** */
+public static final String RECEIVED_MESSAGES_METRIC_NAME = 
"receivedMessagesCount";
+
+/** */
+public static final String RECEIVED_MESSAGES_METRIC_DESC = "Total number 
of messages received by current node";
+
+
+/** */
+public static String sentMessagesByTypeMetricName(Short directType) {
+return "sentMessagesByType." + directType;
 
 Review comment:
   ok


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324678059
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
 ##
 @@ -403,6 +401,50 @@
 /** Handshake wait message type. */
 public static final short HANDSHAKE_WAIT_MSG_TYPE = -28;
 
+/** Communication metrics group name. */
+public static final String COMMUNICATION_METRICS_GROUP_NAME = 
"communication.tcp";
 
 Review comment:
   ok


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324677896
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationMetricsListener.java
 ##
 @@ -17,65 +17,125 @@
 
 package org.apache.ignite.spi.communication.tcp;
 
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Set;
 import java.util.UUID;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.LongAdder;
-
+import java.util.function.Function;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
-import org.apache.ignite.internal.util.nio.GridNioMetricsListener;
-import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.processors.metric.GridMetricManager;
+import org.apache.ignite.internal.processors.metric.MetricRegistry;
+import org.apache.ignite.internal.processors.metric.impl.LongAdderMetric;
 import org.apache.ignite.plugin.extensions.communication.Message;
 
+import static 
org.apache.ignite.internal.util.nio.GridNioServer.RECEIVED_BYTES_METRIC_DESC;
+import static 
org.apache.ignite.internal.util.nio.GridNioServer.RECEIVED_BYTES_METRIC_NAME;
+import static 
org.apache.ignite.internal.util.nio.GridNioServer.SENT_BYTES_METRIC_DESC;
+import static 
org.apache.ignite.internal.util.nio.GridNioServer.SENT_BYTES_METRIC_NAME;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.COMMUNICATION_METRICS_GROUP_NAME;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.RECEIVED_MESSAGES_BY_NODE_ID_METRIC_DESC;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.RECEIVED_MESSAGES_BY_NODE_ID_METRIC_NAME;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.RECEIVED_MESSAGES_BY_TYPE_METRIC_DESC;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.RECEIVED_MESSAGES_METRIC_DESC;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.RECEIVED_MESSAGES_METRIC_NAME;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.SENT_MESSAGES_BY_NODE_ID_METRIC_DESC;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.SENT_MESSAGES_BY_NODE_ID_METRIC_NAME;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.SENT_MESSAGES_BY_TYPE_METRIC_DESC;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.SENT_MESSAGES_METRIC_DESC;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.SENT_MESSAGES_METRIC_NAME;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.receivedMessagesByTypeMetricName;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.sentMessagesByTypeMetricName;
+
 /**
  * Statistics for {@link 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi}.
  */
-public class TcpCommunicationMetricsListener implements GridNioMetricsListener{
-/** Counter factory. */
-private static final Callable HOLDER_FACTORY = new 
Callable() {
-@Override public LongHolder call() {
-return new LongHolder();
-}
-};
+class TcpCommunicationMetricsListener {
+/** Metrics manager. */
+private final GridMetricManager mmgr;
 
-/** Received bytes count. */
-private final LongAdder rcvdBytesCnt = new LongAdder();
+/** Metrics registry. */
+private final MetricRegistry mreg;
 
-/** Sent bytes count.*/
-private final LongAdder sentBytesCnt = new LongAdder();
+/** */
+private final Function 
sentMsgsCntByTypeMetricFactory;
 
-/** All registered metrics. */
-private final Set allMetrics = 
Collections.newSetFromMap(new ConcurrentHashMap<>());
+/** */
+private final Function 
rcvdMsgsCntByTypeMetricFactory;
 
-/** Thread-local metrics. */
-private final ThreadLocal threadMetrics = new 
ThreadLocal() {
-@Override protected ThreadMetrics initialValue() {
-ThreadMetrics metrics = new ThreadMetrics();
+/** */
+private final Function 
sentMsgsCntByNodeIdMetricFactory;
 
-allMetrics.add(metrics);
+/** */
+private final Function 
rcvdMsgsCntByNodeIdMetricFactory;
 
-return metrics;
-}
-};
+/** Sent bytes count metric.*/
+private final LongAdderMetric sentBytesMetric;
+
+/** Received bytes count metric. */
+private final LongAdderMetric rcvdBytesMetric;
+
+/** Sent messages count metric. */
+private final LongAdderMetric sentMsgsMetric;
+
+/** Received messages count metric. */
+private final LongAdderMetric rcvdMsgsMetric;
+
+/** Sent messages count metrics grouped by message type. */
+ConcurrentHashMap sentMsgsMetricsByType = new 
ConcurrentHashMap<

[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324678122
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
 ##
 @@ -403,6 +401,50 @@
 /** Handshake wait message type. */
 public static final short HANDSHAKE_WAIT_MSG_TYPE = -28;
 
+/** Communication metrics group name. */
+public static final String COMMUNICATION_METRICS_GROUP_NAME = 
"communication.tcp";
+
+/** */
+public static final String SENT_MESSAGES_METRIC_NAME = "sentMessagesCount";
+
+/** */
+public static final String SENT_MESSAGES_METRIC_DESC = "Total number of 
messages sent by current node";
+
+/** */
+public static final String RECEIVED_MESSAGES_METRIC_NAME = 
"receivedMessagesCount";
+
+/** */
+public static final String RECEIVED_MESSAGES_METRIC_DESC = "Total number 
of messages received by current node";
+
+
+/** */
+public static String sentMessagesByTypeMetricName(Short directType) {
 
 Review comment:
   ok


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324677664
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
 ##
 @@ -293,12 +320,12 @@ private GridNioServer(
 int sndQueueLimit,
 boolean directMode,
 boolean daemon,
-GridNioMetricsListener metricsLsnr,
 GridNioMessageWriterFactory writerFactory,
 IgnitePredicate skipRecoveryPred,
 IgniteBiInClosure msgQueueLsnr,
 boolean readWriteSelectorsAssign,
 @Nullable GridWorkerListener workerLsnr,
+@Nullable MetricRegistry mreg,
 
 Review comment:
   Same as above.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework.

2019-09-16 Thread GitBox
ibessonov commented on a change in pull request #6814: IGNITE-12108 TCP 
Communication Metrics ported to a new framework.
URL: https://github.com/apache/ignite/pull/6814#discussion_r324677493
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java
 ##
 @@ -32,19 +39,27 @@
 /** Reservations. */
 private final AtomicBoolean closed = new AtomicBoolean();
 
-/** Metrics listener. */
-protected final GridNioMetricsListener metricsLsnr;
-
 /** */
 private final int connIdx;
 
+/** Received bytes count metric. */
+@Nullable protected final LongAdderMetric rcvdBytesCntMetric;
+
+/** Sent bytes count metric. */
+@Nullable protected final LongAdderMetric sentBytesCntMetric;
+
 /**
  * @param connIdx Connection index.
- * @param metricsLsnr Metrics listener.
+ * @param mreg Metrics registry.
  */
-protected GridAbstractCommunicationClient(int connIdx, @Nullable 
GridNioMetricsListener metricsLsnr) {
+protected GridAbstractCommunicationClient(int connIdx, @Nullable 
MetricRegistry mreg) {
 
 Review comment:
   This class might be used by components other than TCP SPI. You can see that 
"GridNioMetricsListener" was nullable as well.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324658886
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
 ##
 @@ -428,6 +428,9 @@ protected DataRegionMetricsProvider 
dataRegionMetricsProvider(final DataRegionCo
 private CacheFreeList freeList;
 
 private CacheFreeList getFreeList() {
+if (freeListMap == null)
 
 Review comment:
   This change will break something.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324658886
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
 ##
 @@ -428,6 +428,9 @@ protected DataRegionMetricsProvider 
dataRegionMetricsProvider(final DataRegionCo
 private CacheFreeList freeList;
 
 private CacheFreeList getFreeList() {
+if (freeListMap == null)
 
 Review comment:
   This change will break something.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] vveider opened a new pull request #6871: IGNITE-12173 Fix http links

2019-09-16 Thread GitBox
vveider opened a new pull request #6871: IGNITE-12173 Fix http links
URL: https://github.com/apache/ignite/pull/6871
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324635677
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -59,6 +60,12 @@
 /** */
 private final LongAdderMetric groupPageAllocationTracker;
 
+/** */
+private volatile LongMetric storageSize;
+
+/** */
+private volatile LongMetric sparseStorageSize;
 
 Review comment:
   Why this variable is volatile?
   
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324635651
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -59,6 +60,12 @@
 /** */
 private final LongAdderMetric groupPageAllocationTracker;
 
+/** */
+private volatile LongMetric storageSize;
 
 Review comment:
   Why this variable is volatile?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324630618
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) {
 this::getTotalAllocatedSize,
 "Total size of memory allocated for group, in bytes.");
 
-mreg.register("StorageSize",
-this::getStorageSize,
-"Storage space allocated for group, in bytes.");
+if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) 
{
+mreg.register("StorageSize",
+() -> database().forGroupPageStores(ctx, PageStore::size),
+"Storage space allocated for group, in bytes.");
 
-mreg.register("SparseStorageSize",
-this::getSparseStorageSize,
-"Storage space allocated for group adjusted for possible sparsity, 
in bytes.");
+mreg.register("SparseStorageSize",
+() -> database().forGroupPageStores(ctx, 
PageStore::getSparseSize),
+"Storage space allocated for group adjusted for possible 
sparsity, in bytes.");
+
+storageSize = mreg.findMetric("StorageSize");
+sparseStorageSize = mreg.findMetric("SparseStorageSize");
+}
+else {
+storageSize = new AtomicLongMetric("NO_OP", null);
 
 Review comment:
   @nizhikov Done


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324627634
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) {
 this::getTotalAllocatedSize,
 "Total size of memory allocated for group, in bytes.");
 
-mreg.register("StorageSize",
-this::getStorageSize,
-"Storage space allocated for group, in bytes.");
+if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) 
{
+mreg.register("StorageSize",
+() -> database().forGroupPageStores(ctx, PageStore::size),
+"Storage space allocated for group, in bytes.");
 
-mreg.register("SparseStorageSize",
-this::getSparseStorageSize,
-"Storage space allocated for group adjusted for possible sparsity, 
in bytes.");
+mreg.register("SparseStorageSize",
+() -> database().forGroupPageStores(ctx, 
PageStore::getSparseSize),
+"Storage space allocated for group adjusted for possible 
sparsity, in bytes.");
+
+storageSize = mreg.findMetric("StorageSize");
+sparseStorageSize = mreg.findMetric("SparseStorageSize");
+}
+else {
+storageSize = new AtomicLongMetric("NO_OP", null);
 
 Review comment:
   I think it can be reworked as `storageSize == null ? 0 : 
storageSize.longValue()`.
   Let's do it?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324626745
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) {
 this::getTotalAllocatedSize,
 "Total size of memory allocated for group, in bytes.");
 
-mreg.register("StorageSize",
-this::getStorageSize,
-"Storage space allocated for group, in bytes.");
+if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) 
{
 
 Review comment:
   Done


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324626315
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) {
 this::getTotalAllocatedSize,
 "Total size of memory allocated for group, in bytes.");
 
-mreg.register("StorageSize",
-this::getStorageSize,
-"Storage space allocated for group, in bytes.");
+if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) 
{
+mreg.register("StorageSize",
+() -> database().forGroupPageStores(ctx, PageStore::size),
+"Storage space allocated for group, in bytes.");
 
-mreg.register("SparseStorageSize",
-this::getSparseStorageSize,
-"Storage space allocated for group adjusted for possible sparsity, 
in bytes.");
+mreg.register("SparseStorageSize",
+() -> database().forGroupPageStores(ctx, 
PageStore::getSparseSize),
+"Storage space allocated for group adjusted for possible 
sparsity, in bytes.");
+
+storageSize = mreg.findMetric("StorageSize");
+sparseStorageSize = mreg.findMetric("SparseStorageSize");
+}
+else {
+storageSize = new AtomicLongMetric("NO_OP", null);
 
 Review comment:
   @nizhikov This metric need to provide zero value when PDS disabled (we do 
not register those metrics in monitoring but it should be available from java 
API). For example, it can be read from deprecated CacheGroupMetricsMXBeanImpl.
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324616851
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) {
 this::getTotalAllocatedSize,
 "Total size of memory allocated for group, in bytes.");
 
-mreg.register("StorageSize",
-this::getStorageSize,
-"Storage space allocated for group, in bytes.");
+if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) 
{
 
 Review comment:
   Let's create `isPDSEnabled` method instead of direct usage `instanceof` 
operator


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.

2019-09-16 Thread GitBox
nizhikov commented on a change in pull request #6738: IGNITE-12027 NPE on try 
to read the MinimumNumberOfPartitionCopies metric.
URL: https://github.com/apache/ignite/pull/6738#discussion_r324617035
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java
 ##
 @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) {
 this::getTotalAllocatedSize,
 "Total size of memory allocated for group, in bytes.");
 
-mreg.register("StorageSize",
-this::getStorageSize,
-"Storage space allocated for group, in bytes.");
+if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) 
{
+mreg.register("StorageSize",
+() -> database().forGroupPageStores(ctx, PageStore::size),
+"Storage space allocated for group, in bytes.");
 
-mreg.register("SparseStorageSize",
-this::getSparseStorageSize,
-"Storage space allocated for group adjusted for possible sparsity, 
in bytes.");
+mreg.register("SparseStorageSize",
+() -> database().forGroupPageStores(ctx, 
PageStore::getSparseSize),
+"Storage space allocated for group adjusted for possible 
sparsity, in bytes.");
+
+storageSize = mreg.findMetric("StorageSize");
+sparseStorageSize = mreg.findMetric("SparseStorageSize");
+}
+else {
+storageSize = new AtomicLongMetric("NO_OP", null);
 
 Review comment:
   Why do we need this `NO_OP` metrics?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] NSAmelchev closed pull request #6870: IGNITE-12171 Remove the MetricRegistry.remove(String name) method.

2019-09-16 Thread GitBox
NSAmelchev closed pull request #6870: IGNITE-12171 Remove the 
MetricRegistry.remove(String name) method.
URL: https://github.com/apache/ignite/pull/6870
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] NSAmelchev opened a new pull request #6870: IGNITE-12171 Remove the MetricRegistry.remove(String name) method.

2019-09-16 Thread GitBox
NSAmelchev opened a new pull request #6870: IGNITE-12171 Remove the 
MetricRegistry.remove(String name) method.
URL: https://github.com/apache/ignite/pull/6870
 
 
   Remove the MetricRegistry.remove(String name) method. See IGNITE-12171


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov merged pull request #6737: IGNITE-11944: OpencensusExporter should export Histogram metrics.

2019-09-16 Thread GitBox
nizhikov merged pull request #6737: IGNITE-11944: OpencensusExporter should 
export Histogram metrics.
URL: https://github.com/apache/ignite/pull/6737
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] sanpwc opened a new pull request #6869: GG-23989 IgniteQueue.removeAll throws NPE fixed.

2019-09-16 Thread GitBox
sanpwc opened a new pull request #6869: GG-23989  IgniteQueue.removeAll throws 
NPE fixed.
URL: https://github.com/apache/ignite/pull/6869
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services