def RunOnce(self):

    # Figure out which port to use.
    port = config_lib.CONFIG["Monitoring.http_port"]
    if port != 0:
      logging.info("Starting monitoring server on port %d.", port)
      # pylint: disable=g-import-not-at-top
      from grr.lib import local as local_overrides
      # pylint: enable=g-import-not-at-top
      if "stats_server" in dir(local_overrides):
        stats_server = local_overrides.stats_server.StatsServer(port)
        logging.debug("Using local StatsServer from %s", local_overrides)
      else:
        stats_server = StatsServer(port)

      stats_server.Start()
    else:
      logging.info("Monitoring server disabled.")
Main method of this registry hook.
dataset/ETHPy150Open google/grr/grr/server/stats_server.py/StatsServerInit.RunOnce