geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] branch develop updated: GEODE-5142 new Thread Monitoring Mechanism
Date Fri, 24 Aug 2018 22:36:54 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new b951146  GEODE-5142 new Thread Monitoring Mechanism
b951146 is described below

commit b9511465702bf746c1543a6a5eb2369f22f88fb3
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Fri Aug 24 15:34:20 2018 -0700

    GEODE-5142 new Thread Monitoring Mechanism
    
    Fixing some formatting problems in stack trace output and other log
    messages.  One person noticed the monitor saying it was "expiring"
    a thread and thought it was doing something other than print stack
    traces.
---
 .../monitoring/ThreadsMonitoringProcess.java       |  8 ++++----
 .../monitoring/executor/AbstractExecutor.java      | 24 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcess.java
b/geode-core/src/main/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcess.java
index 166346f..bbfc1c5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcess.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcess.java
@@ -54,25 +54,25 @@ public class ThreadsMonitoringProcess extends TimerTask {
     boolean isStuck = false;
     int numOfStuck = 0;
     for (Entry<Long, AbstractExecutor> entry1 : this.threadsMonitoring.getMonitorMap().entrySet())
{
-      logger.trace("Checking Thread {}\n", entry1.getKey());
+      logger.trace("Checking thread {}", entry1.getKey());
       long currentTime = System.currentTimeMillis();
       long delta = currentTime - entry1.getValue().getStartTime();
       if (delta >= this.timeLimit) {
         isStuck = true;
         numOfStuck++;
-        logger.warn("Thread <{}> is stuck , initiating handleExpiry\n", entry1.getKey());
+        logger.warn("Thread <{}> is stuck", entry1.getKey());
         entry1.getValue().handleExpiry(delta);
       }
     }
     if (!isStuck) {
       if (this.resourceManagerStats != null)
         this.resourceManagerStats.setNumThreadStuck(0);
-      logger.trace("There are NO stuck threads in the system\n");
+      logger.trace("There are no stuck threads in the system\n");
       return false;
     } else {
       if (this.resourceManagerStats != null)
         this.resourceManagerStats.setNumThreadStuck(numOfStuck);
-      logger.warn("There are <{}> stuck threads in the system\n", numOfStuck);
+      logger.warn("There are <{}> stuck threads in thia node", numOfStuck);
       return true;
     }
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/monitoring/executor/AbstractExecutor.java
b/geode-core/src/main/java/org/apache/geode/internal/monitoring/executor/AbstractExecutor.java
index c328eb0..e303cda 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/monitoring/executor/AbstractExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/monitoring/executor/AbstractExecutor.java
@@ -53,25 +53,25 @@ public abstract class AbstractExecutor {
 
     StringBuilder strb = new StringBuilder();
 
-    strb.append("Thread < ").append(this.threadID).append(" > that was executed at
< ")
-        .append(dateFormat.format(this.getStartTime())).append(" > is stuck for <")
+    strb.append("Thread <").append(this.threadID).append("> that was executed at <")
+        .append(dateFormat.format(this.getStartTime())).append("> has been stuck for <")
         .append((float) stuckTime / 1000)
-        .append(" seconds> and number of thread monitor iteration < ")
-        .append(this.numIterationsStuck).append(" > ").append(System.lineSeparator())
-        .append("Thread Name < ").append(thread.getThreadName()).append(" > ")
-        .append(System.lineSeparator()).append("Thread state < ").append(thread.getThreadState())
-        .append(" > ").append(System.lineSeparator());
+        .append(" seconds> and number of thread monitor iteration <")
+        .append(this.numIterationsStuck).append("> ").append(System.lineSeparator())
+        .append("Thread Name <").append(thread.getThreadName()).append(">")
+        .append(System.lineSeparator()).append("Thread state <").append(thread.getThreadState())
+        .append(">").append(System.lineSeparator());
 
     if (thread.getLockName() != null)
-      strb.append("Waiting on < ").append(thread.getLockName()).append(" > ")
+      strb.append("Waiting on <").append(thread.getLockName()).append(">")
           .append(System.lineSeparator());
 
     if (thread.getLockOwnerName() != null)
-      strb.append("Owned By < ").append(thread.getLockOwnerName()).append(" > and ID
< ")
-          .append(thread.getLockOwnerId()).append(" > ").append(System.lineSeparator());
+      strb.append("Owned By <").append(thread.getLockOwnerName()).append("> and ID
<")
+          .append(thread.getLockOwnerId()).append(">").append(System.lineSeparator());
 
-    strb.append("Executor Group < ").append(groupName).append(" > ").append(System.lineSeparator())
-        .append("Monitored metric < ResourceManagerStats.numThreadsStuck >")
+    strb.append("Executor Group <").append(groupName).append(">").append(System.lineSeparator())
+        .append("Monitored metric <ResourceManagerStats.numThreadsStuck>")
         .append(System.lineSeparator()).append("Thread Stack:").append(System.lineSeparator());
 
     for (int i = 0; i < thread.getStackTrace().length; i++) {


Mime
View raw message