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

@ -37,7 +37,7 @@ public class ThreadView extends ResultView<ThreadModel> {
} else if (result.getThreadStateCount() != null) {
Map<Thread.State, Integer> threadStateCount = result.getThreadStateCount();
List<ThreadVO> threadStats = result.getThreadStats();
List<ThreadVO> threads = result.getThreads();
//sum total thread count
int total = 0;
@ -46,7 +46,7 @@ public class ThreadView extends ResultView<ThreadModel> {
}
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<ThreadModel> {
//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);
}
}

Loading…
Cancel
Save