You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/04/29 18:27:56 UTC

[GitHub] [geode] dschneider-pivotal opened a new pull request, #7635: VMStats50 cleanup

dschneider-pivotal opened a new pull request, #7635:
URL: https://github.com/apache/geode/pull/7635

   cleaned up instance variables in VMStats50
   BufferPoolStats is no longer a static in VMStats50
   
   <!-- Thank you for submitting a contribution to Apache Geode. -->
   
   <!-- In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken: 
   -->
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   <!-- Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   -->
   


-- 
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@geode.apache.org

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


[GitHub] [geode] dschneider-pivotal closed pull request #7635: GEODE-10249: change BufferPoolStats to not be static

Posted by GitBox <gi...@apache.org>.
dschneider-pivotal closed pull request #7635: GEODE-10249: change BufferPoolStats to not be static
URL: https://github.com/apache/geode/pull/7635


-- 
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@geode.apache.org

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


[GitHub] [geode] kirklund commented on a diff in pull request #7635: GEODE-10249: change BufferPoolStats to not be static

Posted by GitBox <gi...@apache.org>.
kirklund commented on code in PR #7635:
URL: https://github.com/apache/geode/pull/7635#discussion_r865410911


##########
geode-core/src/main/java/org/apache/geode/internal/stats50/BufferPoolStats.java:
##########
@@ -40,47 +39,62 @@ public class BufferPoolStats {
   private final int bufferPoolTotalCapacityId;
   private final int bufferPoolMemoryUsedId;
 
-  private final Map<BufferPoolMXBean, Statistics> bufferPoolStatistics =
-      new IdentityHashMap<>();
+  private final List<BufferPoolMXBeanStatistics> bufferPoolStatistics;
 
-  BufferPoolStats(final @NotNull StatisticsTypeFactory typeFactory) {
+  BufferPoolStats(final @NotNull StatisticsFactory statisticsFactory, final long id) {
+    this(statisticsFactory, id, getPlatformMXBeans(BufferPoolMXBean.class));
+  }
+
+  BufferPoolStats(final @NotNull StatisticsFactory statisticsFactory, final long id,
+      final List<BufferPoolMXBean> platformMXBeans) {
     bufferPoolType =
-        typeFactory.createType("PlatformBufferPoolStats", "Java platform buffer pools.",
+        statisticsFactory.createType("PlatformBufferPoolStats", "Java platform buffer pools.",
             new StatisticDescriptor[] {
-                typeFactory.createLongGauge("count",
+                statisticsFactory.createLongGauge("count",
                     "An estimate of the number of buffers in this pool.", "buffers"),
-                typeFactory.createLongGauge("totalCapacity",
+                statisticsFactory.createLongGauge("totalCapacity",
                     "An estimate of the total capacity of the buffers in this pool in bytes.",
                     "bytes"),
-                typeFactory.createLongGauge("memoryUsed",
+                statisticsFactory.createLongGauge("memoryUsed",
                     "An estimate of the memory that the Java virtual machine is using for this buffer pool in bytes, or -1L if an estimate of the memory usage is not available.",
                     "bytes")});
     bufferPoolCountId = bufferPoolType.nameToId("count");
     bufferPoolTotalCapacityId = bufferPoolType.nameToId("totalCapacity");
     bufferPoolMemoryUsedId = bufferPoolType.nameToId("memoryUsed");
-  }
-
-  void init(final @NotNull StatisticsFactory statisticsFactory, final long id) {
-    init(statisticsFactory, id, getPlatformMXBeans(BufferPoolMXBean.class));
-  }
 
-  void init(final StatisticsFactory statisticsFactory, final long id,
-      final List<BufferPoolMXBean> platformMXBeans) {
-    platformMXBeans.forEach(
-        pool -> bufferPoolStatistics.computeIfAbsent(pool,
-            k -> statisticsFactory.createStatistics(bufferPoolType, k.getName() + " buffer pool",
-                id)));
+    ArrayList<BufferPoolMXBeanStatistics> statList = new ArrayList<>(platformMXBeans.size());

Review Comment:
   Can this be declared as `List<BufferPoolMXBeanStatistics>`?



-- 
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@geode.apache.org

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