MCPcopy Create free account
hub / github.com/alibaba/BladeDISC / report

Method report

scripts/python/common_setup.py:32–45  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30 self.log_file = "/tmp/tao_build.log"
31
32 def report(self):
33 if len(self.durs) == 0:
34 return
35 lines = []
36 # load previous info from file
37 if os.path.exists(self.log_file):
38 lines += open(self.log_file, "r").read().splitlines()
39 for name, sec, ts in self.durs:
40 lines.append("{}: {} - {:.2f} minutes".format(ts, name, sec * 1.0 / 60))
41 # logger.info("****** Stage timing report: ******\n{}".format("\n".join(lines)))
42 # logger.info("**********************************")
43 # save to file
44 with open(self.log_file, "w") as of:
45 of.write("\n".join(lines))
46
47 def append(self, name, secs):
48 self.durs.append((name, secs, datetime.now().strftime("%Y-%m-%d %H:%M:%S")))

Callers 1

tao_build.pyFile · 0.45

Calls 3

existsMethod · 0.80
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected