Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 committed Nov 25, 2024
1 parent 64dde71 commit b0d9cc3
Showing 1 changed file with 3 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@ public class NoOpMetricsSystem implements ObservableMetricsSystem {
public static final LabelledMetric<OperationTimer> NO_OP_LABELLED_1_OPERATION_TIMER =
new LabelCountingNoOpMetric<>(1, NO_OP_OPERATION_TIMER);

/** The constant NO_OP_LABELLED_1_GAUGE. */
public static final LabelledSuppliedMetric NO_OP_LABELLED_1_GAUGE =
new LabelledSuppliedNoOpMetric(1);

/** The constant NO_OP_LABELLED_2_GAUGE. */
public static final LabelledSuppliedMetric NO_OP_LABELLED_2_GAUGE =
new LabelledSuppliedNoOpMetric(2);

/** The constant NO_OP_LABELLED_3_GAUGE. */
public static final LabelledSuppliedMetric NO_OP_LABELLED_3_GAUGE =
new LabelledSuppliedNoOpMetric(3);

/** The constant NO_OP_LABELLED_1_SUMMARY. */
public static final LabelledSuppliedSummary NO_OP_LABELLED_1_SUMMARY =
new LabelledSuppliedNoOpMetric(1);

/** Default constructor */
public NoOpMetricsSystem() {}

Expand All @@ -101,12 +85,7 @@ public LabelledMetric<Counter> createLabelledCounter(
* @return the counter labelled metric
*/
public static LabelledMetric<Counter> getCounterLabelledMetric(final int labelCount) {
return switch (labelCount) {
case 1 -> NO_OP_LABELLED_1_COUNTER;
case 2 -> NO_OP_LABELLED_2_COUNTER;
case 3 -> NO_OP_LABELLED_3_COUNTER;
default -> new LabelCountingNoOpMetric<>(labelCount, NO_OP_COUNTER);
};
return new LabelCountingNoOpMetric<>(labelCount, NO_OP_COUNTER);
}

@Override
Expand Down Expand Up @@ -144,11 +123,7 @@ public LabelledMetric<OperationTimer> createLabelledTimer(
*/
public static LabelledMetric<OperationTimer> getOperationTimerLabelledMetric(
final int labelCount) {
if (labelCount == 1) {
return NO_OP_LABELLED_1_OPERATION_TIMER;
} else {
return new LabelCountingNoOpMetric<>(labelCount, NO_OP_OPERATION_TIMER);
}
}

@Override
Expand Down Expand Up @@ -187,12 +162,7 @@ public LabelledSuppliedMetric createLabelledSuppliedGauge(
* @return the labelled gauge
*/
public static LabelledSuppliedMetric getLabelledSuppliedMetric(final int labelCount) {
return switch (labelCount) {
case 1 -> NO_OP_LABELLED_1_GAUGE;
case 2 -> NO_OP_LABELLED_2_GAUGE;
case 3 -> NO_OP_LABELLED_3_GAUGE;
default -> new LabelledSuppliedNoOpMetric(labelCount);
};
return new LabelledSuppliedNoOpMetric(labelCount);
}

/**
Expand All @@ -202,10 +172,7 @@ public static LabelledSuppliedMetric getLabelledSuppliedMetric(final int labelCo
* @return the labelled gauge
*/
public static LabelledSuppliedSummary getLabelledSuppliedSummary(final int labelCount) {
return switch (labelCount) {
case 1 -> NO_OP_LABELLED_1_SUMMARY;
default -> new LabelledSuppliedNoOpMetric(labelCount);
};
return new LabelledSuppliedNoOpMetric(labelCount);
}

@Override
Expand Down

0 comments on commit b0d9cc3

Please sign in to comment.