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 2020/11/30 17:22:57 UTC

[GitHub] [geode] kirklund commented on a change in pull request #5763: GEODE-8521: detect if a p2p reader thread is hung

kirklund commented on a change in pull request #5763:
URL: https://github.com/apache/geode/pull/5763#discussion_r532766936



##########
File path: geode-core/src/test/java/org/apache/geode/internal/monitoring/executor/P2PReaderExecutorGroupJUnitTest.java
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.geode.internal.monitoring.executor;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+public class P2PReaderExecutorGroupJUnitTest {

Review comment:
       I recommend just naming unit tests as P2PReaderExecutorGroupTest (no need to include JUnit)

##########
File path: geode-core/src/test/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcessJUnitTest.java
##########
@@ -34,11 +31,13 @@
  */
 public class ThreadsMonitoringProcessJUnitTest {
 
+  private static final int TIME_LIMIT = 1000;

Review comment:
       Please indicate the units of measure in the name or an additional parameter.

##########
File path: geode-core/src/main/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcess.java
##########
@@ -33,73 +31,86 @@
 
 public class ThreadsMonitoringProcess extends TimerTask {
 
-  private final ThreadsMonitoring threadsMonitoring;
-  private ResourceManagerStats resourceManagerStats = null;
   private static final Logger logger = LogService.getLogger();
+
+  private final ThreadsMonitoring threadsMonitoring;
   private final int timeLimit;
   private final InternalDistributedSystem internalDistributedSystem;
 
-  private final Properties nonDefault = new Properties();
-  private final DistributionConfigImpl distributionConfigImpl =
-      new DistributionConfigImpl(nonDefault);
+  private ResourceManagerStats resourceManagerStats = null;
 
   protected ThreadsMonitoringProcess(ThreadsMonitoring tMonitoring,
-      InternalDistributedSystem iDistributedSystem) {
-    this.timeLimit = this.distributionConfigImpl.getThreadMonitorTimeLimit();
+      InternalDistributedSystem iDistributedSystem, int timeLimit) {

Review comment:
       What unit is timeLimit? I recommend either adding a TimeUnit parameter or renaming timeLimit to include Millis or something as a prefix.




----------------------------------------------------------------
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:
users@infra.apache.org