Skip to content

Commit

Permalink
pinpoint-apm#2286 Add function of getting thread dump from agent
Browse files Browse the repository at this point in the history
1. update thrift structure
  • Loading branch information
koo-taejin committed Jan 2, 2017
1 parent b365ab9 commit 4ea8568
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ private List<TActiveThreadDump> getActiveThreadDumpList(TCmdActiveThreadDump req
}

private List<TActiveThreadDump> getActiveThreadDumpList(TCmdActiveThreadDump request, int limit, List<ActiveTraceInfo> activeTraceInfoList) {
int targetThreadNameListSize = request.getTargetThreadNameListSize();
int targetThreadNameListSize = request.getThreadNameListSize();
int localTraceIdListSize = request.getLocalTraceIdListSize();
boolean filterEnable = (targetThreadNameListSize + localTraceIdListSize) > 0;

List<TActiveThreadDump> activeThreadDumpList = new ArrayList<TActiveThreadDump>(Math.min(limit, activeTraceInfoList.size()));
if (filterEnable) {
for (ActiveTraceInfo activeTraceInfo : activeTraceInfoList) {
if (!ActiveThreadDumpUtils.isTraceThread(activeTraceInfo, request.getTargetThreadNameList(), request.getLocalTraceIdList())) {
if (!ActiveThreadDumpUtils.isTraceThread(activeTraceInfo, request.getThreadNameList(), request.getLocalTraceIdList())) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ private List<TActiveThreadLightDump> getActiveThreadDumpList(TCmdActiveThreadLig
}

private List<TActiveThreadLightDump> getTActiveThreadDumpList(TCmdActiveThreadLightDump request, int limit, List<ActiveTraceInfo> activeTraceInfoList) {
int targetThreadNameListSize = request.getTargetThreadNameListSize();
int targetThreadNameListSize = request.getThreadNameListSize();
int localTraceIdListSize = request.getLocalTraceIdListSize();
boolean filterEnable = (targetThreadNameListSize + localTraceIdListSize) > 0;

List<TActiveThreadLightDump> activeThreadDumpList = new ArrayList<TActiveThreadLightDump>(Math.min(limit, activeTraceInfoList.size()));
if (filterEnable) {
for (ActiveTraceInfo activeTraceInfo : activeTraceInfoList) {
if (!ActiveThreadDumpUtils.isTraceThread(activeTraceInfo, request.getTargetThreadNameList(), request.getLocalTraceIdList())) {
if (!ActiveThreadDumpUtils.isTraceThread(activeTraceInfo, request.getThreadNameList(), request.getLocalTraceIdList())) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private TCmdActiveThreadDump createRequest(int limit, List<String> threadNameLis
request.setLimit(limit);
}
if (threadNameList != null) {
request.setTargetThreadNameList(threadNameList);
request.setThreadNameList(threadNameList);
}
if (localTraceIdList != null) {
request.setLocalTraceIdList(localTraceIdList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private TCmdActiveThreadLightDump createRequest(int limit, List<String> threadNa
request.setLimit(limit);
}
if (threadNameList != null) {
request.setTargetThreadNameList(threadNameList);
request.setThreadNameList(threadNameList);
}
if (localTraceIdList != null) {
request.setLocalTraceIdList(localTraceIdList);
Expand Down
Loading

0 comments on commit 4ea8568

Please sign in to comment.