Skip to content

Commit 461e77f

Browse files
committed
show-busy-java-threads: use pipe instead <()
1 parent 07a0429 commit 461e77f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

show-busy-java-threads

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@ __top_threadId_cpu() {
311311
}' | sort -k2,2nr
312312
}
313313

314-
# output format is same as function findBusyJavaThreadsByPs
315-
findBusyJavaThreadsByTop() {
314+
__complete_pid_user_by_ps() {
316315
# ps output field: pid, thread id(lwp), user
317316
local -r ps_out="$(ps $ps_process_select_options -wwLo pid,lwp,user --no-headers)"
318317

@@ -333,7 +332,12 @@ findBusyJavaThreadsByTop() {
333332
(( idx++ ))
334333
echo "$output_fields"
335334
fi
336-
done < <( __top_threadId_cpu )
335+
done
336+
}
337+
338+
# output format is same as function findBusyJavaThreadsByPs
339+
findBusyJavaThreadsByTop() {
340+
__top_threadId_cpu | __complete_pid_user_by_ps
337341
}
338342

339343
printStackOfThreads() {

0 commit comments

Comments
 (0)