Skip to content

Commit

Permalink
fix: Solve bad metric units (hashgraph#10777)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Littley <austin@swirldslabs.com>
  • Loading branch information
litt3 authored Jan 4, 2024
1 parent ce292fa commit 1fe4e37
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,19 @@ public InOrderLinker(
this.missingParentAccumulator = platformContext
.getMetrics()
.getOrCreate(new LongAccumulator.Config(PLATFORM_CATEGORY, "missingParents")
.withDescription("Parent child relationships where a parent was missing")
.withUnit("parent child relationships"));
.withDescription("Parent child relationships where a parent was missing"));
this.generationMismatchAccumulator = platformContext
.getMetrics()
.getOrCreate(new LongAccumulator.Config(PLATFORM_CATEGORY, "parentGenerationMismatch")
.withDescription(
"Parent child relationships where claimed parent generation did not match actual parent generation")
.withUnit("parent child relationships"));
.getOrCreate(
new LongAccumulator.Config(PLATFORM_CATEGORY, "parentGenerationMismatch")
.withDescription(
"Parent child relationships where claimed parent generation did not match actual parent generation"));
this.timeCreatedMismatchAccumulator = platformContext
.getMetrics()
.getOrCreate(new LongAccumulator.Config(PLATFORM_CATEGORY, "timeCreatedMismatch")
.withDescription(
"Parent child relationships where child time created wasn't strictly after parent time created")
.withUnit("parent child relationships"));
.getOrCreate(
new LongAccumulator.Config(PLATFORM_CATEGORY, "timeCreatedMismatch")
.withDescription(
"Parent child relationships where child time created wasn't strictly after parent time created"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public class PcesMetrics {

private static final LongGauge.Config PRECONSENSUS_EVENT_FILE_OLDEST_GENERATION_CONFIG = new LongGauge.Config(
CATEGORY, "preconsensusEventFileOldestGeneration")
.withUnit("oldest generation")
.withUnit("generation")
.withDescription("The oldest possible generation that is being " + "stored in preconsensus event files.");
private final LongGauge preconsensusEventFileOldestGeneration;

private static final LongGauge.Config PRECONSENSUS_EVENT_FILE_YOUNGEST_GENERATION_CONFIG = new LongGauge.Config(
CATEGORY, "preconsensusEventFileYoungestGeneration")
.withUnit("youngest generation")
.withUnit("generation")
.withDescription("The youngest possible generation that is being " + "stored in preconsensus event files.");
private final LongGauge preconsensusEventFileYoungestGeneration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ConsensusHandlingMetrics {

private static final LongGauge.Config consensusTimeConfig = new LongGauge.Config(INTERNAL_CATEGORY, "consensusTime")
.withDescription("The consensus timestamp of the round currently being handled.")
.withUnit("milliseconds since the epoch");
.withUnit("milliseconds");
private final LongGauge consensusTime;

private static final LongGauge.Config consensusTimeDeviationConfig = new LongGauge.Config(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void registerAddressBookMetrics(
@NonNull final Metrics metrics, @NonNull final AddressBook addressBook, @NonNull final NodeId selfId) {

metrics.getOrCreate(new FunctionGauge.Config<>(INFO_CATEGORY, "memberID", Long.class, selfId::id)
.withUnit("node ID")
.withUnit("nodeID")
.withDescription("The node ID number of this member"));

metrics.getOrCreate(new FunctionGauge.Config<>(INFO_CATEGORY, "members", Integer.class, addressBook::getSize)
Expand Down

0 comments on commit 1fe4e37

Please sign in to comment.