[Why] user may extract $program result to $program.yaml
Signed-off-by: Lu Weitao luweitaobe@163.com --- lib/matrix2.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/matrix2.rb b/lib/matrix2.rb index e603763..8444334 100644 --- a/lib/matrix2.rb +++ b/lib/matrix2.rb @@ -39,19 +39,21 @@ def file_check(file) File.basename(file, '.json') when /.json.gz$/ File.basename(file, '.json.gz') + when /.yaml$/ + File.basename(file, '.yaml') end end
def create_stats(result_root) stats = {}
- monitor_files = Dir["#{result_root}/*.{json,json.gz}"] + monitor_files = Dir["#{result_root}/*.{json,json.gz,yaml}"]
monitor_files.each do |file| next unless File.size?(file)
monitor = file_check(file) - next if monitor == 'stats' # stats.json already created? + next if %w[stats job].include?(monitor)
extract_pre_result(stats, monitor, file) end