10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/test_prof/autopilot/patches/factory_default_patch.rb', line 10
def print_report
data = self.data.each_with_object({}) do |(name, stats), acc|
name = name.gsub(/\$id\$.+\$di\$/, "<id>")
if acc.key?(name)
acc[name][:count] += stats[:count]
acc[name][:time] += stats[:time]
else
acc[name] = stats
end
end
dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0]
file_path = File.join(dir_path, ARTIFACT_FILE)
File.write(file_path, data.to_json)
end
|