xref: /aosp_15_r20/external/perfetto/infra/ci/controller/stackdriver_metrics.py (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15from config import PROJECT
16
17STACKDRIVER_METRICS = {
18    'ci_job_queue_len': {
19        'name': 'ci_job_queue_len',
20        'displayName': 'ci_job_queue_len',
21        'description': 'Length of the CI jobs queue',
22        'type': 'custom.googleapis.com/%s/ci_job_queue_len' % PROJECT,
23        'metricKind': 'GAUGE',
24        'valueType': 'INT64',
25        'metadata': {
26            'samplePeriod': {
27                'seconds': 1
28            }
29        },
30        'labels': []
31    },
32    'ci_job_queue_time': {
33        'name': 'ci_job_queue_time',
34        'displayName': 'ci_job_queue_time',
35        'description': 'Queueing time of CI jobs, before they start running',
36        'type': 'custom.googleapis.com/%s/ci_job_queue_time' % PROJECT,
37        'metricKind': 'GAUGE',
38        'valueType': 'INT64',
39        'unit': 's',
40        'metadata': {
41            'samplePeriod': {
42                'seconds': 1
43            }
44        },
45        'labels': [{
46            'key': 'job_type',
47            'valueType': 'STRING'
48        }]
49    },
50    'ci_job_run_time': {
51        'name': 'ci_job_run_time',
52        'displayName': 'ci_job_run_time',
53        'description': 'Running time of CI jobs',
54        'type': 'custom.googleapis.com/%s/ci_job_run_time' % PROJECT,
55        'metricKind': 'GAUGE',
56        'valueType': 'INT64',
57        'unit': 's',
58        'metadata': {
59            'samplePeriod': {
60                'seconds': 1
61            }
62        },
63        'labels': [{
64            'key': 'job_type',
65            'valueType': 'STRING'
66        }]
67    },
68    'ci_cl_completion_time': {
69        'name': 'ci_cl_completion_time',
70        'displayName': 'ci_cl_completion_time',
71        'description': 'Time it takes for all jobs of a CL to complete',
72        'type': 'custom.googleapis.com/%s/ci_cl_completion_time' % PROJECT,
73        'metricKind': 'GAUGE',
74        'valueType': 'INT64',
75        'unit': 's',
76        'metadata': {
77            'samplePeriod': {
78                'seconds': 1
79            }
80        },
81        'labels': []
82    },
83}
84