diff --git a/core/src/main/java/com/taobao/arthas/core/command/model/ThreadModel.java b/core/src/main/java/com/taobao/arthas/core/command/model/ThreadModel.java index 57e72903a..bf99acbe8 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/model/ThreadModel.java +++ b/core/src/main/java/com/taobao/arthas/core/command/model/ThreadModel.java @@ -20,8 +20,8 @@ public class ThreadModel extends ResultModel { //thread -n 5 private List busyThreads; - //thread stats - private List threadStats; + //thread + private List threads; private Map threadStateCount; private boolean all; @@ -40,8 +40,8 @@ public class ThreadModel extends ResultModel { this.busyThreads = busyThreads; } - public ThreadModel(List threadStats, Map threadStateCount, boolean all) { - this.threadStats = threadStats; + public ThreadModel(List threads, Map threadStateCount, boolean all) { + this.threads = threads; this.threadStateCount = threadStateCount; this.all = all; } @@ -75,12 +75,12 @@ public class ThreadModel extends ResultModel { this.busyThreads = busyThreads; } - public List getThreadStats() { - return threadStats; + public List getThreads() { + return threads; } - public void setThreadStats(List threadStats) { - this.threadStats = threadStats; + public void setThreads(List threads) { + this.threads = threads; } public Map getThreadStateCount() { diff --git a/core/src/main/java/com/taobao/arthas/core/command/view/ThreadView.java b/core/src/main/java/com/taobao/arthas/core/command/view/ThreadView.java index b1d2ca362..99d9e15aa 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/view/ThreadView.java +++ b/core/src/main/java/com/taobao/arthas/core/command/view/ThreadView.java @@ -37,7 +37,7 @@ public class ThreadView extends ResultView { } else if (result.getThreadStateCount() != null) { Map threadStateCount = result.getThreadStateCount(); - List threadStats = result.getThreadStats(); + List threads = result.getThreads(); //sum total thread count int total = 0; @@ -46,7 +46,7 @@ public class ThreadView extends ResultView { } int internalThreadCount = 0; - for (ThreadVO thread : threadStats) { + for (ThreadVO thread : threads) { if (thread.getId() <= 0) { internalThreadCount += 1; } @@ -68,13 +68,13 @@ public class ThreadView extends ResultView { //thread stats int height; if (result.isAll()) { - height = threadStats.size() + 1; + height = threads.size() + 1; } else { height = Math.max(5, process.height() - 2); //remove blank lines - height = Math.min(height, threadStats.size() + 2); + height = Math.min(height, threads.size() + 2); } - String content = ViewRenderUtil.drawThreadInfo(threadStats, process.width(), height); + String content = ViewRenderUtil.drawThreadInfo(threads, process.width(), height); process.write(stat + content); } }