// Select a globally unique ID for the run, that sorts by time.
millis = int((self._run_timestamp * 1000) % 1000)
// run_uuid is used as a part of run_id and also as a trace_id for Zipkin tracing
run_uuid = uuid.uuid4().hex
str_time = time.strftime("%Y_%m_%d_%H_%M_%S", time.localtime(self._run_timestamp))
run_id = f"pants_run_{str_time}_{millis}_{run_uuid}"
info_dir = os.path.join(self.get_options().pants_workdir, self.options_scope)
self.run_info_dir = os.path.join(info_dir, run_id)
self.run_info = RunInfo(os.path.join(self.run_info_dir, "info"))
self.run_info.add_basic_info(run_id, self._run_timestamp)
self.run_info.add_info("cmd_line", self._cmd_line)
// Create a "latest" symlink, after we add_infos, so we"re guaranteed that the file exists.
link_to_latest = os.path.join(os.path.dirname(self.run_info_dir), "latest")
relative_symlink(self.run_info_dir, link_to_latest)
// Time spent in a workunit, including its children.
self.cumulative_timings = AggregatedTimings(os.path.join(self.run_info_dir,
"cumulative_timings"))
// Time spent in a workunit, not including its children.
self.self_timings = AggregatedTimings(os.path.join(self.run_info_dir, "self_timings"))
// Hit/miss stats for the artifact cache.
self.artifact_cache_stats = ArtifactCacheStats(os.path.join(self.run_info_dir,
"artifact_cache_stats"))
// Daemon stats.
self.pantsd_stats = PantsDaemonStats()
self._all_options = all_options
return (run_id, run_uuid)
def start(self, report, run_start_time=None):
Start tracking this pants run using the given Report.
After Change
self._all_options = all_options
return (self.run_id, self.run_uuid)
def start(self, report, run_start_time=None):
Start tracking this pants run using the given Report.