Skip to content

Commit

Permalink
Apply PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Simeon Widdis <[email protected]>
  • Loading branch information
Swiddis committed Nov 14, 2024
1 parent ea746cd commit f2c148e
Showing 1 changed file with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,31 +132,23 @@ private String sanitizeIndexName(String indexName) {
}

private void emitIndexCreationSuccessMetric(String indexKind) {
switch (indexKind) {
case "skipping":
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_SKIPPING_INDICES, "success"), 1);
break;
case "covering":
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_COVERING_INDICES, "success"), 1);
break;
case "mv":
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_MV_INDICES, "success"), 1);
break;
default:
break;
}
emitIndexCreationMetric(indexKind, "success");
}

private void emitIndexCreationFailureMetric(String indexKind) {
emitIndexCreationMetric(indexKind, "failed");
}

private void emitIndexCreationMetric(String indexKind, String status) {
switch (indexKind) {
case "skipping":
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_SKIPPING_INDICES, "failed"), 1);
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_SKIPPING_INDICES, status), 1);
break;
case "covering":
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_COVERING_INDICES, "failed"), 1);
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_COVERING_INDICES, status), 1);
break;
case "mv":
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_MV_INDICES, "failed"), 1);
MetricsUtil.addHistoricGauge(String.format("%s.%s.count", MetricConstants.CREATE_MV_INDICES, status), 1);
break;
default:
break;
Expand Down

0 comments on commit f2c148e

Please sign in to comment.