Ejemplo n.º 1
0
def create_backend_app():  # pragma: no cover
    """Returns WSGI app for backend."""
    routes = handlers.get_backend_routes() + swarming.get_backend_routes()
    app = webapp2.WSGIApplication(routes, debug=utils.is_local_dev_server())
    gae_ts_mon.initialize(app, cron_module='backend')
    gae_ts_mon.register_global_metrics(metrics.GLOBAL_METRICS)
    gae_ts_mon.register_global_metrics_callback('buildbucket_global',
                                                metrics.update_global_metrics)
    return app
Ejemplo n.º 2
0
def initialize():
  # These metrics are the ones that are reset everything they are flushed.
  gae_ts_mon.register_global_metrics([
      _executors_pool,
      _executors_status,
      _jobs_active,
      _jobs_max_pending_duration,
      _jobs_pending_durations,
      _jobs_running,
  ])
  gae_ts_mon.register_global_metrics_callback('callback', _set_global_metrics)
Ejemplo n.º 3
0
def create_backend_app():  # pragma: no cover
  """Returns WSGI app for backend."""
  routes = handlers.get_backend_routes() + swarming.get_routes()
  app = webapp2.WSGIApplication(routes, debug=utils.is_local_dev_server())
  gae_ts_mon.initialize(app, cron_module='backend')
  gae_ts_mon.register_global_metrics([
      metrics.CURRENTLY_PENDING,
      metrics.CURRENTLY_RUNNING,
      metrics.LEASE_LATENCY,
      metrics.SCHEDULING_LATENCY,
  ])
  gae_ts_mon.register_global_metrics_callback(
      'send_metrics', metrics.send_all_metrics)
  return app
Ejemplo n.º 4
0
def initialize():  # pragma: no cover
    gae_ts_mon.register_global_metrics(GLOBAL_METRICS.values())
    gae_ts_mon.register_global_metrics_callback('callback',
                                                compute_global_metrics)
Ejemplo n.º 5
0
def initialize():
  gae_ts_mon.register_global_metrics(
      [jobs_status, executors_pool, executors_status])
  gae_ts_mon.register_global_metrics_callback('callback', _set_global_metrics)