[input] General statistics: total time: 0.3987s total number of events: 10000 total time taken by event execution: 0.3971 response time: min: 0.04ms
[output] total time: 0.3987s
Signed-off-by: Hu XueJiao 1034502035@qq.com --- stats/sysbench-threads-git | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 stats/sysbench-threads-git
diff --git a/stats/sysbench-threads-git b/stats/sysbench-threads-git new file mode 100755 index 00000000..08faf4e0 --- /dev/null +++ b/stats/sysbench-threads-git @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +# General statistics: +# total time: 0.2671s +# total number of events: 10000 +# total time taken by event execution: 0.3971s +# response time: +# min: 0.04ms + +results_total = {} + +$stdin.each_line do |line| + next unless line =~ /total time:\s+([0-9.]+)/ + + results_total['total_time'] = $1.to_f +end + +results_total.each do |key, vals| + puts "#{key}: #{vals}s" +end
On Tue, Nov 17, 2020 at 04:08:40PM +0800, Hu Xuejiao wrote:
[input] General statistics: total time: 0.3987s total number of events: 10000 total time taken by event execution: 0.3971 response time: min: 0.04ms
[output] total time: 0.3987s
Signed-off-by: Hu XueJiao 1034502035@qq.com
stats/sysbench-threads-git | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 stats/sysbench-threads-git
diff --git a/stats/sysbench-threads-git b/stats/sysbench-threads-git new file mode 100755 index 00000000..08faf4e0 --- /dev/null +++ b/stats/sysbench-threads-git @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby
+# General statistics: +# total time: 0.2671s +# total number of events: 10000 +# total time taken by event execution: 0.3971s +# response time: +# min: 0.04ms
+results_total = {}
+$stdin.each_line do |line|
- next unless line =~ /total time:\s+([0-9.]+)/
no need add the "(" and ")" for an exact match, you can use: /^\s+total time:\s+[0-9.]+s$/ if the time unit my include: s, m, h, etc, use /^\s+total time:\s+[0-9.]+[smh]+$/
Thanks, Luan Shengde
- results_total['total_time'] = $1.to_f
+end
+results_total.each do |key, vals|
- puts "#{key}: #{vals}s"
+end
2.23.0