telemetry: linux telemetry with perf-stat
[csit.git] / resources / tools / telemetry / constants.py
1 # Copyright (c) 2022 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 """Constants used in telemetry.
15
16 "Constant" means a value that keeps its value since initialization. The value
17 does not need to be hard coded here, but can be read from environment variables.
18 """
19
20
21 class Constants:
22     """Constants used in telemetry.
23     1-10: Telemetry errors
24     11-50: VPP bundle error
25     51-100: Linux bundle errors"""
26
27     # Failed when processing data
28     err_telemetry_process = 1
29
30     # Failed to read YAML file
31     err_telemetry_yaml = 2
32
33     # Error executing bundle
34     err_telemetry_bundle = 3
35
36     # Could not connect to VPP
37     err_vpp_connect = 11
38
39     # Could not disconnect from VPP
40     err_vpp_disconnect = 12
41
42     # Failed when executing command
43     err_vpp_execute = 13
44
45     # Could not attach BPF events
46     err_linux_attach = 51
47
48     # Could not detach BPF events
49     err_linux_detach = 52
50
51     # Could not successfuly run perf stat command
52     err_linux_perf_stat = 53
53