[input] prc thr usecs/call samples errors cnt/samp getpid 1 1 0.15629 193 0 100000
[output] getpid: 0.15629
Signed-off-by: Bai Jing 799286817@qq.com --- stats/libmicro | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 stats/libmicro
diff --git a/stats/libmicro b/stats/libmicro new file mode 100755 index 00000000..2e33ffc9 --- /dev/null +++ b/stats/libmicro @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby + +# prc thr usecs/call samples errors cnt/samp +# close_tmp 1 1 0.61880 201 0 640 + +def line_fun(line) + hash = {} + test = line.split[0] + usecs_call = line.split[3] + hash[test] = usecs_call + hash.each do |key, value| + puts "#{key}: #{value}" + end +end + +$stdin.each_line do |line| + case line + when /^\w+\s+\d/ + line_fun(line) + end +end
On Fri, Nov 13, 2020 at 03:59:48PM +0800, Bai Jing wrote:
[input] prc thr usecs/call samples errors cnt/samp getpid 1 1 0.15629 193 0 100000
[output] getpid: 0.15629
Signed-off-by: Bai Jing 799286817@qq.com
Please ignore it.
Thanks, Baijing
stats/libmicro | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 stats/libmicro
diff --git a/stats/libmicro b/stats/libmicro new file mode 100755 index 00000000..2e33ffc9 --- /dev/null +++ b/stats/libmicro @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby
+# prc thr usecs/call samples errors cnt/samp +# close_tmp 1 1 0.61880 201 0 640
+def line_fun(line)
- hash = {}
- test = line.split[0]
- usecs_call = line.split[3]
- hash[test] = usecs_call
- hash.each do |key, value|
puts "#{key}: #{value}"
- end
+end
+$stdin.each_line do |line|
- case line
- when /^\w+\s+\d/
- line_fun(line)
- end
+end
2.23.0