Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed redundant code from csv collector #4225

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions thirdparty/itt_collector/runtool/exporters/Stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,16 @@
import shutil
from sea_runtool import GraphCombiner

# Supported values are "csv" and "tsv"
FILE_EXTENSION = ".csv"

class Stat(GraphCombiner):
def __init__(self, args, tree):
GraphCombiner.__init__(self, args, tree)

def get_targets(self):
return [self.args.output + FILE_EXTENSION]
return [self.args.output + ".csv"]

def finish(self):
GraphCombiner.finish(self)
delim = ','
if FILE_EXTENSION == ".tsv":
delim = '\t'
with open(self.get_targets()[-1], 'w') as f:
writer = csv.writer(f, delimiter=delim)
writer.writerow(["domain", "name", "min", "max", "avg", "total", "count"])
Expand All @@ -41,15 +36,6 @@ def finish(self):
time = task_data['time']
writer.writerow([domain, task_name, min(time), max(time), sum(time) / len(time), sum(time), len(time)])

@staticmethod
def join_traces(traces, output, args): # FIXME: implement real joiner
sorting = []
for trace in traces:
sorting.append((os.path.getsize(trace), trace))
sorting.sort(key=lambda size_trace: size_trace[0], reverse=True)
shutil.copyfile(sorting[0][1], output + ".tsv")
return output + ".tsv"

EXPORTER_DESCRIPTORS = [{
'format': 'stat',
'available': True,
Expand Down