aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Yiding <yidingx.liu@intel.com>2019-07-15 14:45:53 +0800
committerPhilip Li <philip.li@intel.com>2019-07-15 16:45:40 +0800
commitd82cae6ad652d9f520b7adf1822f74818aac7680 (patch)
tree3132ee7da8c5ac20a643436134be9151f0da8f6c
parent34a1a0e1506acc20ba661018621a62794306e1c7 (diff)
downloadlkp-tests-d82cae6ad652d9f520b7adf1822f74818aac7680.tar.gz
stats: add mcperf
------ root@clear-lkp-30040/lkp/result/mcperf/1000-1000-0-10-1000-u1_16-5/clear-lkp/clear-linux-os/x86_64-rhel-7.6/gcc-7/5.1.12-357.kvm/0 # head mcperf.json { "mcperf.connection_rate_conn/s": [ 991.1 ], "mcperf.connection_time_avg_ms": [ 10.1 ], "mcperf.connection_time_min_ms": [ 10.0 ], ------ Signed-off-by: Liu Yiding <yidingx.liu@intel.com> Signed-off-by: Philip Li <philip.li@intel.com>
-rwxr-xr-xstats/mcperf38
1 files changed, 38 insertions, 0 deletions
diff --git a/stats/mcperf b/stats/mcperf
new file mode 100755
index 00000000..ab454b46
--- /dev/null
+++ b/stats/mcperf
@@ -0,0 +1,38 @@
+#!/usr/bin/env ruby
+
+LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))
+
+require "#{LKP_SRC}/lib/log"
+require "#{LKP_SRC}/lib/string_ext"
+
+# skip invalid line
+while (line = STDIN.gets)
+ break if line =~ /Total/
+end
+
+while (line = STDIN.gets)
+ line = line.remediate_invalid_byte_sequence(replace: '_') unless line.valid_encoding?
+ case line
+ # Connection rate: 991.1 conn/s (1.0 ms/conn <= 12 concurrent connections)
+ when /^(Connection|Request|Response) rate: (.*.) (.*\/s)/
+ type = $1.downcase
+ val = $2
+ unit = $3
+ puts "#{type}_rate_#{unit}: #{val}"
+ when /^(Connection|Connect|Response|Request|CPU) (time|size) \[(ms|B|s)\]:(( \w* \d*.\d*){2,})/
+ type = $1.downcase
+ object = $2
+ unit = $3
+ test_object = "#{type}_#{object}"
+ $4.gsub(/(\w+) (\d+.\d+)/) { puts "#{test_object}_#{$1}_#{unit}: #{$2}" }
+ when /^Response type:(( \w* \d*){3,})/
+ $1.gsub(/(\w+) (\d+)/) { puts "response_type_#{$1}: #{$2}" }
+ when /^Errors: (.*)/
+ $1.gsub(/(\w+) (\d+)/) { puts "error_#{$1}: #{$2}" }
+ when /^Net I\/O: bytes (\d+.\d+) (.*) (\d+.\d+)/
+ io_bytes = $1
+ io_rate = $3
+ puts "net_io_bytes: #{io_bytes}"
+ puts "net_io_rate_kb/s: #{io_rate}"
+ end
+end