Commit 7aacc78b authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add Pipeline.summary()

parent a39acbc0
Pipeline #2879 passed with stage
in 0 seconds
...@@ -78,6 +78,9 @@ class Pipeline: ...@@ -78,6 +78,9 @@ class Pipeline:
clean_output_before_run: bool = True, clean_output_before_run: bool = True,
**kwargs: Any, **kwargs: Any,
): ):
# record start time
self.t_start = Time.now()
# get pipeline information from env vars # get pipeline information from env vars
self.pipeline_id: str = os.getenv("PIPELINE_ID", "-") self.pipeline_id: str = os.getenv("PIPELINE_ID", "-")
self.build: str = os.getenv("BUILD", "-") self.build: str = os.getenv("BUILD", "-")
...@@ -147,9 +150,11 @@ class Pipeline: ...@@ -147,9 +150,11 @@ class Pipeline:
h.set("CREATED", self.pipeline_id, comment="pipeline build time") h.set("CREATED", self.pipeline_id, comment="pipeline build time")
return reformat_header(h, strip=False, comment="Pipeline summary") return reformat_header(h, strip=False, comment="Pipeline summary")
def summarize(self): def summary(self):
"""Summarize this run.""" """Summarize this run."""
pass t_stop: Time = Time.now()
t_cost: float = (t_stop - self.t_start).value * 86400.0
self.pipeline_logger.info(f"Total cost: {t_cost} sec")
def clean_output(self): def clean_output(self):
"""Clean output directory.""" """Clean output directory."""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment