Coverage for /builds/BuildGrid/buildgrid/buildgrid/server/metrics_names.py: 100.00%

85 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2025-03-13 15:36 +0000

1# Copyright (C) 2020 Bloomberg LP 

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 

15# flake8: noqa 

16# fmt: off 

17class METRIC: 

18 class RPC: 

19 DURATION = "rpc.duration.ms" 

20 INPUT_BYTES = "rpc.input_bytes.count" 

21 OUTPUT_BYTES = "rpc.output_bytes.count" 

22 AUTH_DURATION = "rpc.auth.duration.ms" 

23 

24 class ACTION_CACHE: 

25 INVALID_CACHE_COUNT = "action_cache.invalid_cache.count" 

26 MIRRORED_MATCH_COUNT = "action_cache.mirrored_matches.count" 

27 MIRRORED_MISMATCH_COUNT = "action_cache.mirrored_mismatches.count" 

28 RESULT_AGE = "action_cache.result_age.ms" 

29 

30 class CAS: 

31 BLOBS_COUNT = "cas.blobs.count" 

32 BLOBS_MISSING_COUNT = "cas.blobs_missing.count" 

33 BLOBS_MISSING_PERCENT = "cas.blobs_missing.percent" 

34 BLOB_BYTES = "cas.blob_bytes.count" 

35 TREE_CACHE_HIT_COUNT = "cas.tree_cache_hit.count" 

36 TREE_CACHE_MISS_COUNT = "cas.tree_cache_miss.count" 

37 

38 class STORAGE: 

39 STAT_DURATION = "storage.stat.duration.ms" 

40 BULK_STAT_DURATION = "storage.bulk_stat.duration.ms" 

41 

42 READ_DURATION = "storage.read.duration.ms" 

43 BULK_READ_DURATION = "storage.bulk_read.duration.ms" 

44 

45 DELETE_DURATION = "storage.delete_blob.duration.ms" 

46 BULK_DELETE_DURATION = "storage.bulk_delete.duration.ms" 

47 DELETE_ERRORS_COUNT = "storage.delete_errors.count" 

48 

49 WRITE_DURATION = "storage.write.duration.ms" 

50 BULK_WRITE_DURATION = "storage.bulk_write.duration.ms" 

51 

52 GET_TREE_DURATION = "storage.get_tree.duration.ms" 

53 

54 class WITH_CACHE: 

55 CACHE_HIT_COUNT = "storage.with_cache.cache_hit.count" 

56 CACHE_MISS_COUNT = "storage.with_cache.cache_miss.count" 

57 CACHE_HIT_PERCENT = "storage.with_cache.cache_hit.percent" 

58 

59 class SQL_INDEX: 

60 UPDATE_TIMESTAMP_DURATION = "storage.sql_index.update_timestamp.duration.ms" 

61 SAVE_DIGESTS_DURATION = "storage.sql_index.save_digest.duration.ms" 

62 SIZE_CALCULATION_DURATION = "storage.sql_index.size_calculation.duration.ms" 

63 DELETE_N_BYTES_DURATION = "storage.sql_index.delete_n_bytes.duration.ms" 

64 BULK_DELETE_INDEX_DURATION = "storage.sql_index.bulk_delete_index.duration.ms" 

65 MARK_DELETED_DURATION = "storage.sql_index.mark_deleted.duration.ms" 

66 PREMARKED_DELETED_COUNT = "storage.sql_index.premarked_deleted.count" 

67 

68 class REPLICATED: 

69 REQUIRED_REPLICATION_COUNT = "storage.replicated.required_replication.count" 

70 REPLICATION_COUNT = "storage.replicated.replication.count" 

71 REPLICATION_QUEUE_FULL_COUNT = "storage.replicated.replication_queue_full.count" 

72 REPLICATION_ERROR_COUNT = "storage.replicated.replication.errors.count" 

73 

74 class S3: 

75 BLOB_AGE = "storage.s3.total_age.ms" 

76 BLOB_BYTES = "storage.s3.blob_bytes.count" 

77 

78 class CLEANUP: 

79 DURATION = "cleanup.duration.ms" 

80 BATCH_DURATION = "cleanup.batch.duration.ms" 

81 BLOBS_DELETED_PER_SECOND = "cleanup.blobs_deleted.per_second" 

82 BYTES_DELETED_PER_SECOND = "cleanup.bytes_deleted.per_second" 

83 BYTES_DELETED_COUNT = "cleanup.bytes_deleted.count" 

84 TOTAL_BYTES_COUNT = "cleanup.total_bytes.count" 

85 LOW_WATERMARK_BYTES_COUNT = "cleanup.low_watermark_bytes.count" 

86 HIGH_WATERMARK_BYTES_COUNT = "cleanup.high_watermark_bytes.count" 

87 TOTAL_BYTES_WATERMARK_PERCENT = "cleanup.total_bytes_watermark.percent" 

88 TOTAL_BLOBS_COUNT = "cleanup.total_blobs.count" 

89 LOW_WATERMARK_BLOBS_COUNT = "cleanup.low_watermark_blobs.count" 

90 HIGH_WATERMARK_BLOBS_COUNT = "cleanup.high_watermark_blobs.count" 

91 TOTAL_BLOBS_WATERMARK_PERCENT = "cleanup.total_blobs_watermark.percent" 

92 

93 class JANITOR: 

94 BLOB_AGE = "cleanup.janitor.blob_age.ms" 

95 BLOB_BYTES = "cleanup.janitor.blob_bytes.count" 

96 

97 class SCHEDULER: 

98 JOB_COUNT = "scheduler.jobs.count" 

99 BOTS_COUNT = "scheduler.bots.count" 

100 

101 ASSIGNMENT_DURATION = "scheduler.assignment.duration.ms" 

102 SYNCHRONIZE_DURATION = "scheduler.synchronize.duration.ms" 

103 

104 PRUNE_DURATION = "scheduler.prune.duration.ms" 

105 PRUNE_COUNT = "scheduler.prune.count" 

106 

107 QUEUE_TIMEOUT_DURATION = "scheduler.queue_timeout.duration.ms" 

108 QUEUE_TIMEOUT_COUNT = "scheduler.queue_timeout.count" 

109 

110 EXECUTION_TIMEOUT_DURATION = "scheduler.execution_timeout.duration.ms" 

111 EXECUTION_TIMEOUT_COUNT = "scheduler.execution_timeout.count" 

112 

113 class CONNECTIONS: 

114 CLIENT_COUNT = "connections.clients.count" 

115 WORKER_COUNT = "connections.workers.count" 

116 

117 class SQL: 

118 SQL_SESSION_COUNT_TEMPLATE = "sql.session.count.{name}" 

119 SQL_ACTIVE_SESSION_GAUGE_TEMPLATE = "sql.active.session.gauge.{name}" 

120 

121 class JOB: 

122 DURATION = "job.duration.ms"