rename ThreadModel.threadStats

pull/1523/head
gongdewei 4 years ago
parent c55cafcbdd
commit 1dcfa251ca

@ -20,8 +20,8 @@ public class ThreadModel extends ResultModel {
//thread -n 5 //thread -n 5
private List<BusyThreadInfo> busyThreads; private List<BusyThreadInfo> busyThreads;
//thread stats //thread
private List<ThreadVO> threadStats; private List<ThreadVO> threads;
private Map<Thread.State, Integer> threadStateCount; private Map<Thread.State, Integer> threadStateCount;
private boolean all; private boolean all;
@ -40,8 +40,8 @@ public class ThreadModel extends ResultModel {
this.busyThreads = busyThreads; this.busyThreads = busyThreads;
} }
public ThreadModel(List<ThreadVO> threadStats, Map<Thread.State, Integer> threadStateCount, boolean all) { public ThreadModel(List<ThreadVO> threads, Map<Thread.State, Integer> threadStateCount, boolean all) {
this.threadStats = threadStats; this.threads = threads;
this.threadStateCount = threadStateCount; this.threadStateCount = threadStateCount;
this.all = all; this.all = all;
} }
@ -75,12 +75,12 @@ public class ThreadModel extends ResultModel {
this.busyThreads = busyThreads; this.busyThreads = busyThreads;
} }
public List<ThreadVO> getThreadStats() { public List<ThreadVO> getThreads() {
return threadStats; return threads;
} }
public void setThreadStats(List<ThreadVO> threadStats) { public void setThreads(List<ThreadVO> threads) {
this.threadStats = threadStats; this.threads = threads;
} }
public Map<Thread.State, Integer> getThreadStateCount() { public Map<Thread.State, Integer> getThreadStateCount() {

@ -37,7 +37,7 @@ public class ThreadView extends ResultView<ThreadModel> {
} else if (result.getThreadStateCount() != null) { } else if (result.getThreadStateCount() != null) {
Map<Thread.State, Integer> threadStateCount = result.getThreadStateCount(); Map<Thread.State, Integer> threadStateCount = result.getThreadStateCount();
List<ThreadVO> threadStats = result.getThreadStats(); List<ThreadVO> threads = result.getThreads();
//sum total thread count //sum total thread count
int total = 0; int total = 0;
@ -46,7 +46,7 @@ public class ThreadView extends ResultView<ThreadModel> {
} }
int internalThreadCount = 0; int internalThreadCount = 0;
for (ThreadVO thread : threadStats) { for (ThreadVO thread : threads) {
if (thread.getId() <= 0) { if (thread.getId() <= 0) {
internalThreadCount += 1; internalThreadCount += 1;
} }
@ -68,13 +68,13 @@ public class ThreadView extends ResultView<ThreadModel> {
//thread stats //thread stats
int height; int height;
if (result.isAll()) { if (result.isAll()) {
height = threadStats.size() + 1; height = threads.size() + 1;
} else { } else {
height = Math.max(5, process.height() - 2); height = Math.max(5, process.height() - 2);
//remove blank lines //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); process.write(stat + content);
} }
} }

Loading…
Cancel
Save