Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1836)

Unified Diff: appengine/swarming/ts_mon_metrics.py

Issue 2705273003: Roll infra_libs and gae_ts_mon in luci-py, and add field_specs to all metrics (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/swarming/swarming_bot/bot_code/bot_main.py ('k') | appengine/third_party/gae_ts_mon/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « appengine/swarming/swarming_bot/bot_code/bot_main.py ('k') | appengine/third_party/gae_ts_mon/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698