On Tue, Nov 24, 2020 at 02:10:57PM +0800, Lu Kaiyi wrote:
Signed-off-by: Lu Kaiyi 2392863668@qq.com
stats/mysql-server | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/stats/mysql-server b/stats/mysql-server index d3f3fd79..776f3f2e 100755 --- a/stats/mysql-server +++ b/stats/mysql-server @@ -16,9 +16,9 @@ while (line = STDIN.gets) # 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.include?('[ pass ]')
- results << line.split(']')[1].split[0] + '.fail: 1' if line.include?('[ fail ]')
- results << line.split(']')[1].split[0] + '.skip: 1' if line.include?('[ skipped ]')
- results << line.split(']')[1].split[0] + '.pass: 1' if line.include?('[ pass ]')
- results << line.split(']')[1].split[0] + '.fail: 1' if line.include?('[ fail ]')
- results << line.split(']')[1].split[0] + '.skip: 1' if line.include?('[ skipped ]')
you can use match instead of split.split, example
results << line.match("main.[^ ]*")[0] + '.pass: 1' if line.include?('[ pass ]')
Thanks, Luan Shengde
end end
-- 2.23.0