Example #1
0
        metricSpec=task.metricSpec)
  except Exception as e: # pylint: disable=W0703
    log.exception("getMetricResourceStatus failed in task=%s", task)
    result.resourceStatus = e

  result.duration = time.time() - startTime

  task.resultsQueue.put(result)

  return True



if __name__ == "__main__":
  logging_support.LoggingSupport.initService()

  logger = _getLogger()
  logger.setLogPrefix('<%s, SERVICE=METRIC> ' % getStandardLogPrefix())

  try:
    logger.info("{TAG:METRIC.START} argv=%r", sys.argv)
    MetricCollector().run()
  except KeyboardInterrupt as e:
    # We're being stopped by supervisord or <CTL-C>
    logger.info("Terminated via %r", e)
  except:
    logger.exception("{TAG:METRIC.STOP.ABORT}")
    raise

  logger.info("{TAG:METRIC.STOP.OK}")
Example #2
0
    parser = OptionParser(helpString)

    (_options, args) = parser.parse_args(args)

    if len(args) > 0:
        parser.error("Didn't expect any positional args (%r)." % (args,))

    service = AggregatorService()
    try:
        service.run()
    finally:
        service.close()


if __name__ == "__main__":
    logging_support.LoggingSupport.initService()

    logger = _getLogger()
    logger.setLogPrefix("%s, SERVICE=AGGR" % getStandardLogPrefix())

    try:
        logger.info("{TAG:AGGR.START} argv=%r", sys.argv)
        main(sys.argv[1:])
    except KeyboardInterrupt as e:
        logger.info("Terminated via %r", e)
    except:
        logger.exception("{TAG:AGGR.STOP.ABORT}")
        raise

    logger.info("{TAG:AGGR.STOP.OK}")
Example #3
0
            result.resourceStatus = dsAdapter.getMetricResourceStatus(
                metricSpec=task.metricSpec)
    except Exception as e:  # pylint: disable=W0703
        log.exception("getMetricResourceStatus failed in task=%s", task)
        result.resourceStatus = e

    result.duration = time.time() - startTime

    task.resultsQueue.put(result)

    return True


if __name__ == "__main__":
    logging_support.LoggingSupport.initService()

    logger = _getLogger()
    logger.setLogPrefix('<%s, SERVICE=METRIC> ' % getStandardLogPrefix())

    try:
        logger.info("{TAG:METRIC.START} argv=%r", sys.argv)
        MetricCollector().run()
    except KeyboardInterrupt as e:
        # We're being stopped by supervisord or <CTL-C>
        logger.info("Terminated via %r", e)
    except:
        logger.exception("{TAG:METRIC.STOP.ABORT}")
        raise

    logger.info("{TAG:METRIC.STOP.OK}")
Example #4
0
  (_options, args) = parser.parse_args(args)

  if len(args) > 0:
    parser.error("Didn't expect any positional args (%r)." % (args,))

  service = AggregatorService()
  try:
    service.run()
  finally:
    service.close()



if __name__ == "__main__":
  logging_support.LoggingSupport.initService()

  logger = _getLogger()
  logger.setLogPrefix('%s, SERVICE=AGGR' % getStandardLogPrefix())

  try:
    logger.info("{TAG:AGGR.START} argv=%r", sys.argv)
    main(sys.argv[1:])
  except KeyboardInterrupt as e:
    logger.info("Terminated via %r", e)
  except:
    logger.exception("{TAG:AGGR.STOP.ABORT}")
    raise

  logger.info("{TAG:AGGR.STOP.OK}")