On Thu, Nov 26, 2020 at 09:20:12AM +0800, Lu Kaiyi wrote:
Signed-off-by: Lu Kaiyi 2392863668@qq.com
stats/crystal/mysql-server.cr | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 stats/crystal/mysql-server.cr
diff --git a/stats/crystal/mysql-server.cr b/stats/crystal/mysql-server.cr new file mode 100644 index 00000000..e2ab4b8e --- /dev/null +++ b/stats/crystal/mysql-server.cr @@ -0,0 +1,21 @@ +#!/usr/bin/env crystal +# frozen_string_literal: true
This comment is useless.
Thanks, RenWen
+results = [] of String
+while (line = STDIN.gets)
- case line
- # The output is as below:
- # 200706 14:35:48 [ 99%] main.subquery_sj_innodb_all w8 [ pass ] 140
- # 200706 14:35:52 [ 99%] main.ssl_dynamic_persisted w1 [ fail ] 5953
- # 200706 14:35:59 [ 99%] main.mysql_upgrade_grant w7 [ skipped ] 80805
- when /[\s*\d+%]/
- results << line.split(']')[1].split[0] + ".pass: 1" if line.includes?("[ pass ]")
- results << line.split(']')[1].split[0] + ".fail: 1" if line.includes?("[ fail ]")
- results << line.split(']')[1].split[0] + ".skip: 1" if line.includes?("[ skipped ]")
- end
+end
+results.each do |item|
- puts item
+end
2.23.0