def mk_metric(metric_prefix): return gae_ts_mon.CumulativeDistributionMetric(metric_prefix + metric_suffix, description, fields, bucketer=bucketer, units=units)
_build_fields('bucket', 'builder', 'status')) BUILD_COUNT_EXPERIMENTAL = gae_ts_mon.GaugeMetric( _METRIC_PREFIX_EXPERIMENTAL + 'count', 'Number of pending/running experimental builds', _build_fields('bucket', 'builder', 'status')) MAX_AGE_SCHEDULED = gae_ts_mon.FloatMetric( 'buildbucket/builds/max_age_scheduled', 'Age of the oldest SCHEDULED build.', (_build_fields('bucket', 'builder') + [gae_ts_mon.BooleanField('must_be_never_leased')]), units=gae_ts_mon.MetricsDataUnits.SECONDS) SEQUENCE_NUMBER_GEN_DURATION_MS = gae_ts_mon.CumulativeDistributionMetric( 'buildbucket/sequence_number/gen_duration', 'Duration of a sequence number generation in ms', [gae_ts_mon.StringField('sequence')], # Bucketer for 1ms..5s range bucketer=BUCKETER_5_SEC, units=gae_ts_mon.MetricsDataUnits.MILLISECONDS) TAG_INDEX_INCONSISTENT_ENTRIES = gae_ts_mon.NonCumulativeDistributionMetric( 'buildbucket/tag_index/inconsistent_entries', 'Number of inconsistent entries encountered during build search', [gae_ts_mon.StringField('tag')], # We can't have more than 1000 entries in a tag index. bucketer=BUCKETER_1K) TAG_INDEX_SEARCH_SKIPPED_BUILDS = gae_ts_mon.NonCumulativeDistributionMetric( 'buildbucket/tag_index/skipped_builds', 'Number of builds we fetched, but skipped', [gae_ts_mon.StringField('tag')], # We can't have more than 1000 entries in a tag index. bucketer=BUCKETER_1K)
[gae_ts_mon.StringField('instance_template')]), 'instances': gae_ts_mon.GaugeMetric('machine_provider/gce_backend/instances', 'Current count of the number of instances.', [gae_ts_mon.StringField('instance_template')]), } config_valid = gae_ts_mon.BooleanMetric( 'machine_provider/gce_backend/config/valid', 'Whether or not the current config is valid.', [gae_ts_mon.StringField('config')], ) instance_deletion_time = gae_ts_mon.CumulativeDistributionMetric( 'machine_provider/gce_backend/instances/deletions/time', 'Seconds between initiating deletion RPC and learning its result.', [gae_ts_mon.StringField('zone')], # units=ts_mon.MetricsDataUnits.SECONDS, ) def compute_global_metrics(): # pragma: no cover for name, counts in config.count_instances().iteritems(): logging.info('%s min: %s', name, counts[0]) GLOBAL_METRICS['config_min_instances'].set( counts[0], fields={ 'instance_template': name, }, target_fields=GLOBAL_TARGET_FIELDS, ) logging.info('%s max: %s', name, counts[1])
_jobs_completed = gae_ts_mon.CounterMetric( 'jobs/completed', '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('pool'), gae_ts_mon.StringField('result'), ]) _jobs_durations = gae_ts_mon.CumulativeDistributionMetric( '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('pool'), gae_ts_mon.StringField('result'), ], bucketer=_bucketer) # Similar to jobs/completed and jobs/duration, but with a dedup field. # - project_id: e.g. 'chromium' # - subproject_id: e.g. 'blink'. Set to empty string if not used. # - pool: e.g. 'Chrome' # - spec_name: name of a job specification, e.g. '<master>:<builder>' # for buildbot jobs. # - deduped: boolean describing whether the job was deduped or not. _jobs_requested = gae_ts_mon.CounterMetric( 'jobs/requested',
# Regular (instance-local) metrics: jobs/completed and jobs/durations. # Both have the following metric fields: # - project_id: e.g. 'chromium' # - subproject_id: e.g. 'blink'. Set to empty string if not used. # - executor_id: name of the bot that executed a job, e.g. 'swarm42-m4' # - spec_name: name of a job specification, e.g. '<master>:<builder>:<test>' # for buildbot jobs. # - result: one of 'success', 'failure', or 'infra-failure'. jobs_completed = gae_ts_mon.CounterMetric( 'jobs/completed', description='Number of completed jobs.') jobs_durations = gae_ts_mon.CumulativeDistributionMetric( 'jobs/durations', bucketer=_bucketer, description='Cycle times of completed jobs, in seconds.') # Swarming-specific metric. Metric fields: # - project_id: e.g. 'chromium' # - subproject_id: e.g. 'blink'. Set to empty string if not used. # - spec_name: name of a job specification, e.g. '<master>:<builder>:<test>' # for buildbot jobs. tasks_expired = gae_ts_mon.CounterMetric( 'swarming/tasks/expired', description='Number of expired tasks') # Global metric. Metric fields: # - project_id: e.g. 'chromium' # - subproject_id: e.g. 'blink'. Set to empty string if not used.
gae_ts_mon.StringField('type'), gae_ts_mon.StringField('master_name'), gae_ts_mon.StringField('builder_name') ]) try_job_errors = gae_ts_mon.CounterMetric( 'findit/try-job-errors', 'Try job errors encountered', [ gae_ts_mon.StringField('error'), gae_ts_mon.IntegerField('type'), gae_ts_mon.StringField('master_name'), gae_ts_mon.StringField('builder_name') ]) analysis_durations = gae_ts_mon.CumulativeDistributionMetric( 'findit/analysis-durations', 'Durations of analyses performed', [ gae_ts_mon.StringField('type'), gae_ts_mon.StringField('result'), ]) culprit_found = gae_ts_mon.CounterMetric( 'findit/culprits', 'Culprits identified by findit', [ gae_ts_mon.StringField('type'), # Valid values: # revert_created, revert_committed, revert_confirmed, # revert_status_error, revert_commit_error, culprit_notified, # culprit_notified_error, irc_notified, irc_notified_error. gae_ts_mon.StringField('action_taken') ])
# for buildbot jobs. # - result: one of 'success', 'failure', or 'infra-failure'. _jobs_completed = gae_ts_mon.CounterMetric( 'jobs/completed', '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('pool'), gae_ts_mon.StringField('result'), ]) _jobs_durations = gae_ts_mon.CumulativeDistributionMetric( '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('pool'), gae_ts_mon.StringField('result'), ], bucketer=_bucketer) # Similar to jobs/completed and jobs/duration, but with a dedup field. # - project_id: e.g. 'chromium' # - subproject_id: e.g. 'blink'. Set to empty string if not used. # - pool: e.g. 'Chrome' # - spec_name: name of a job specification, e.g. '<master>:<builder>' # for buildbot jobs. # - deduped: boolean describing whether the job was deduped or not. _jobs_requested = gae_ts_mon.CounterMetric( 'jobs/requested', 'Number of requested jobs over time.', [ gae_ts_mon.StringField('spec_name'),
lease_requests_expired = gae_ts_mon.CounterMetric( 'machine_provider/lease_requests/expired', 'Number of lease requests expired.', None, ) lease_requests_fulfilled = gae_ts_mon.CounterMetric( 'machine_provider/lease_requests/fulfilled', 'Number of lease requests fulfilled.', None, ) lease_requests_fulfilled_time = gae_ts_mon.CumulativeDistributionMetric( 'machine_provider/lease_requests/fulfilled/time', 'Time taken to fulfill a lease request.', None, bucketer=gae_ts_mon.GeometricBucketer(growth_factor=10**0.04), ) lease_requests_received = gae_ts_mon.CounterMetric( 'machine_provider/lease_requests/received', 'Number of lease requests received.', None, ) pubsub_messages_sent = gae_ts_mon.CounterMetric( 'machine_provider/pubsub_messages/sent', 'Number of Pub/Sub messages sent.', [gae_ts_mon.StringField('target')], )
'jobs/completed', '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('pool'), gae_ts_mon.StringField('result'), gae_ts_mon.StringField('status'), ]) _jobs_durations = gae_ts_mon.CumulativeDistributionMetric( '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('pool'), gae_ts_mon.StringField('result'), ], bucketer=_bucketer) # Similar to jobs/completed and jobs/duration, but with a dedup field. # - project_id: e.g. 'chromium' # - subproject_id: e.g. 'blink'. Set to empty string if not used. # - pool: e.g. 'Chrome' # - spec_name: name of a job specification. # - deduped: boolean describing whether the job was deduped or not. _jobs_requested = gae_ts_mon.CounterMetric( 'jobs/requested', 'Number of requested jobs over time.', [