From d647a33470b7bca36c6c6dc2cffb349b1565bb8f Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 22 Dec 2021 12:50:48 +0200 Subject: [PATCH] Add initial setup callback to monitoring class --- clearml/automation/monitor.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clearml/automation/monitor.py b/clearml/automation/monitor.py index 2547c5ca..31dfdd01 100644 --- a/clearml/automation/monitor.py +++ b/clearml/automation/monitor.py @@ -59,6 +59,10 @@ class Monitor(object): :param float pool_period: pool period in seconds :return: Function will never return """ + + # if this is the first time, we call _setup() if we need to create something + self._setup() + self._timestamp = time() last_report = self._timestamp @@ -173,3 +177,11 @@ class Monitor(object): if not self._clearml_apiclient: self._clearml_apiclient = APIClient() return self._clearml_apiclient + + def _setup(self): + # type: () -> () + """ + Optional add one time setup process, before starting the monitoring loop + :return: + """ + pass