| 95 | } |
| 96 | |
| 97 | String getPartMetricKeyLabel(const String & database, const String & table, const String partition_id, |
| 98 | const String partition, const String first_partition = "", const String & type = "") |
| 99 | { |
| 100 | String account_id = ""; |
| 101 | String db_name = database; |
| 102 | |
| 103 | size_t found = database.find_first_of(DB_NAME_DELIMITER); |
| 104 | if (found != std::string::npos) |
| 105 | { |
| 106 | account_id = database.substr(0, found); |
| 107 | db_name = database.substr(found + 1); |
| 108 | } |
| 109 | |
| 110 | MetricLabels labels |
| 111 | { |
| 112 | {"account_id", account_id}, |
| 113 | {"database", db_name}, |
| 114 | {"table", table}, |
| 115 | {"partition_id", partition_id}, |
| 116 | {"partition", partition}, |
| 117 | }; |
| 118 | |
| 119 | if (!type.empty()) |
| 120 | { |
| 121 | labels.insert({"type", type}); |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | labels.insert({"first_partition", first_partition}); |
| 126 | } |
| 127 | |
| 128 | return getLabel(labels); |
| 129 | |
| 130 | } |
| 131 | |
| 132 | void ServerPrometheusMetricsWriter::writeConfigMetrics(WriteBuffer & wb) |
| 133 | { |
no test coverage detected