| Index: appengine/swarming/ts_mon_metrics.py
|
| diff --git a/appengine/swarming/ts_mon_metrics.py b/appengine/swarming/ts_mon_metrics.py
|
| index 3fcab4f7194f351ebeafab73460caa3ad13e9034..1e85f63b4adab437f7b6ecd0e60b556cb6bdb178 100644
|
| --- a/appengine/swarming/ts_mon_metrics.py
|
| +++ b/appengine/swarming/ts_mon_metrics.py
|
| @@ -37,7 +37,7 @@ TARGET_FIELDS = {
|
| # A custom bucketer with 12% resolution in the range of 1..10**5.
|
| # Used for job cycle times.
|
| _bucketer = gae_ts_mon.GeometricBucketer(growth_factor=10**0.05,
|
| - num_finite_buckets=100)
|
| + num_finite_buckets=100)
|
|
|
| # Regular (instance-local) metrics: jobs/completed and jobs/durations.
|
| # Both have the following metric fields:
|
| @@ -48,12 +48,23 @@ _bucketer = gae_ts_mon.GeometricBucketer(growth_factor=10**0.05,
|
| # - result: one of 'success', 'failure', or 'infra-failure'.
|
| jobs_completed = gae_ts_mon.CounterMetric(
|
| 'jobs/completed',
|
| - description='Number of completed jobs.')
|
| + 'Number of completed jobs.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + gae_ts_mon.StringField('result'),
|
| + ])
|
|
|
|
|
| jobs_durations = gae_ts_mon.CumulativeDistributionMetric(
|
| - 'jobs/durations', bucketer=_bucketer,
|
| - description='Cycle times of completed jobs, in seconds.')
|
| + 'jobs/durations',
|
| + 'Cycle times of completed jobs, in seconds.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + gae_ts_mon.StringField('result'),
|
| + ],
|
| + bucketer=_bucketer)
|
|
|
|
|
| # Similar to jobs/completed and jobs/duration, but with a dedup field.
|
| @@ -64,7 +75,12 @@ jobs_durations = gae_ts_mon.CumulativeDistributionMetric(
|
| # - deduped: boolean describing whether the job was deduped or not.
|
| jobs_requested = gae_ts_mon.CounterMetric(
|
| 'jobs/requested',
|
| - description='Number of requested jobs over time.')
|
| + 'Number of requested jobs over time.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + gae_ts_mon.BooleanField('deduped'),
|
| + ])
|
|
|
|
|
| # Swarming-specific metric. Metric fields:
|
| @@ -74,7 +90,11 @@ jobs_requested = gae_ts_mon.CounterMetric(
|
| # for buildbot jobs.
|
| tasks_expired = gae_ts_mon.CounterMetric(
|
| 'swarming/tasks/expired',
|
| - description='Number of expired tasks')
|
| + 'Number of expired tasks', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + ])
|
|
|
| # Global metric. Metric fields:
|
| # - project_id: e.g. 'chromium'
|
| @@ -88,7 +108,11 @@ tasks_expired = gae_ts_mon.CounterMetric(
|
| # send this metric.
|
| jobs_running = gae_ts_mon.BooleanMetric(
|
| 'jobs/running',
|
| - description='Presence metric for a running job.')
|
| + 'Presence metric for a running job.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + ])
|
|
|
| # Global metric. Metric fields:
|
| # - project_id: e.g. 'chromium'
|
| @@ -98,13 +122,19 @@ jobs_running = gae_ts_mon.BooleanMetric(
|
| # - status: 'pending' or 'running'.
|
| jobs_active = gae_ts_mon.GaugeMetric(
|
| 'jobs/active',
|
| - description='Number of running, pending or otherwise active jobs.')
|
| + 'Number of running, pending or otherwise active jobs.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + gae_ts_mon.StringField('status'),
|
| + ])
|
|
|
|
|
| # Global metric. Target field: hostname = 'autogen:<executor_id>' (bot id).
|
| executors_pool = gae_ts_mon.StringMetric(
|
| 'executors/pool',
|
| - description='Pool name for a given job executor.')
|
| + 'Pool name for a given job executor.',
|
| + None)
|
|
|
|
|
| # Global metric. Target fields:
|
| @@ -114,7 +144,8 @@ executors_pool = gae_ts_mon.StringMetric(
|
| # 'dead'.
|
| executors_status = gae_ts_mon.StringMetric(
|
| 'executors/status',
|
| - description=('Status of a job executor.'))
|
| + 'Status of a job executor.',
|
| + None)
|
|
|
|
|
| # Global metric. Target fields:
|
| @@ -125,8 +156,14 @@ executors_status = gae_ts_mon.StringMetric(
|
| # Note that 'running' will report data as long as the job is running,
|
| # so it is best to restrict data to status == 'pending.'
|
| jobs_pending_durations = gae_ts_mon.NonCumulativeDistributionMetric(
|
| - 'jobs/pending_durations', bucketer=_bucketer,
|
| - description='Pending times of active jobs, in seconds.')
|
| + 'jobs/pending_durations',
|
| + 'Pending times of active jobs, in seconds.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + gae_ts_mon.StringField('status'),
|
| + ],
|
| + bucketer=_bucketer)
|
|
|
|
|
| # Global metric. Target fields:
|
| @@ -138,7 +175,12 @@ jobs_pending_durations = gae_ts_mon.NonCumulativeDistributionMetric(
|
| # so it is best to restrict data to status == 'pending.'
|
| jobs_max_pending_duration = gae_ts_mon.FloatMetric(
|
| 'jobs/max_pending_duration',
|
| - description='Maximum pending seconds of pending jobs.')
|
| + 'Maximum pending seconds of pending jobs.', [
|
| + gae_ts_mon.StringField('spec_name'),
|
| + gae_ts_mon.StringField('project_id'),
|
| + gae_ts_mon.StringField('subproject_id'),
|
| + gae_ts_mon.StringField('status'),
|
| + ])
|
|
|
|
|
| # Global metric. Target fields:
|
| @@ -146,7 +188,10 @@ jobs_max_pending_duration = gae_ts_mon.FloatMetric(
|
| # - enabled = server.lease_management.MachineType.enabled.
|
| machine_types_target_size = gae_ts_mon.GaugeMetric(
|
| 'swarming/machine_types/target_size',
|
| - description='Target size of each MachineType leased from Machine Provider.')
|
| + 'Target size of each MachineType leased from Machine Provider.', [
|
| + gae_ts_mon.BooleanField('enabled'),
|
| + gae_ts_mon.StringField('machine_type'),
|
| + ])
|
|
|
|
|
| def pool_from_dimensions(dimensions):
|
|
|