class_docstr: Base class for monitoring Tasks on the system.
  Inherit to implement specific logic
class_docstr_tok: ["Base","class","for","monitoring","Tasks","on","the","system",".","Inherit","to","implement","specific","logic"]
docstr: Main loop function, this call will never leave, it implements the main monitoring loop.
  Every loop step, `monitor_step` is called (implementing the filter/query interface)
  In order to combine multiple Monitor objects, call `monitor_step` manually.
  
  :param float pool_period: pool period in seconds
  :return: Function will never return
docstr_tok: ["Main","loop","function",",","this","call","will","never","leave",",","it","implements","the","main","monitoring","loop",".","Every","loop","step",",","`","monitor_step","`","is","called","(","implementing","the","filter\/query","interface",")","In","order","to","combine","multiple","Monitor","objects",",","call","`","monitor_step","`","manually",".",":","param","float","pool_period",":","pool","period","in","seconds",":","return",":","Function","will","never","return"]
code: def monitor(self, pool_period=15.0):
      # type: (float) -> ()
      """
      Main loop function, this call will never leave, it implements the main monitoring loop.
      Every loop step, `monitor_step` is called (implementing the filter/query interface)
      In order to combine multiple Monitor objects, call `monitor_step` manually.
  
      :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
  
      # main loop
      while True:
          self._timestamp = time()
          try:
              self.monitor_step()
          except Exception as ex:
              print("Exception: {}".format(ex))
  
          # print I'm alive message every 15 minutes
          if time() - last_report > 60.0 * 15:
              print("Service is running")
              last_report = time()
  
          # sleep until the next poll
          sleep(pool_period)
  
file_path: clearml/clearml/automation/monitor.py
imports: from datetime import datetime
  from time import time, sleep
  from typing import Optional, Sequence
  from ..backend_api.session.client import APIClient
  from ..backend_interface.util import exact_match_regex
  from ..task import Task
label_desc: Use image node_id 4 for calling the Monitor obj's underlying member method code with example usage: obj.monitor(pool_period) without return types