Skip to content

Commit

Permalink
fix: Ui metrics name (#11317)
Browse files Browse the repository at this point in the history
Signed-off-by: mxtartaglia <maxi@swirldslabs.com>
  • Loading branch information
mxtartaglia-sl committed Feb 2, 2024
1 parent 17ec7af commit 3aa52f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void run() {
+ (isFast ? "fast" : "slow") + ")\n"
+ String.format(
" %s",
platform.getContext().getMetrics().getValue(Metrics.PLATFORM_CATEGORY, "trans/sec"))
platform.getContext().getMetrics().getValue(Metrics.PLATFORM_CATEGORY, "trans_per_sec"))
+ " transactions per second for member " + selfId + "\n\n"
+ " count ticker price change change% seller->buyer");
long lastSeq = state.getNumTrades();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ public void paintComponent(final Graphics g) {
final double createCons = (double) metrics.getValue(PLATFORM_CATEGORY, "secC2C");
final double recCons = (double) metrics.getValue(PLATFORM_CATEGORY, "secR2C");

print(g, "%5.0f trans/sec", (double) metrics.getValue(PLATFORM_CATEGORY, "trans/sec"));
print(g, "%5.0f events/sec", (double) metrics.getValue(PLATFORM_CATEGORY, "events/sec"));
print(g, "%4.0f%% duplicate events", (double) metrics.getValue(PLATFORM_CATEGORY, "dupEv%"));
print(g, "%5.0f trans_per_sec", (double) metrics.getValue(PLATFORM_CATEGORY, "trans_per_sec"));
print(g, "%5.0f events_per_sec", (double) metrics.getValue(PLATFORM_CATEGORY, "events_per_sec"));
print(g, "%4.0f%% duplicate events", (double) metrics.getValue(PLATFORM_CATEGORY, "dupEvPercent"));

print(g, "%5.3f sec, propagation time", createCons - recCons);
print(g, "%5.3f sec, create to consensus", createCons);
Expand Down Expand Up @@ -392,10 +392,10 @@ public void init(final Platform platform, final NodeId id) {
.setAbout(
platform.getSelfId(),
"Hashgraph Demo v. 1.1\n" + "\n"
+ "trans/sec = # transactions added to the hashgraph per second\n"
+ "events/sec = # events added to the hashgraph per second\n"
+ "trans_per_sec = # transactions added to the hashgraph per second\n"
+ "events_per_sec = # events added to the hashgraph per second\n"
+ "duplicate events = percentage of events a member receives that they already know.\n"
+ "bad events/sec = number of events per second received by a member that are invalid.\n"
+ "bad events_per_sec = number of events per second received by a member that are invalid.\n"
+ "propagation time = average seconds from creating a new event to a given member receiving it.\n"
+ "create to consensus = average seconds from creating a new event to knowing its consensus order.\n"
+ "receive to consensus = average seconds from receiving an event to knowing its consensus order.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,13 @@ public boolean canSubmitMore(Platform platform) {
}

} else if (this.goal == SUBMIT_GOAL.EVENTS_PER_SECOND_WHOLE_NETWORK) {
double realEvensPerSecond = (double) metrics.getValue(PLATFORM_CATEGORY, "events/sec");
double realEvensPerSecond = (double) metrics.getValue(PLATFORM_CATEGORY, "events_per_sec");
return realEvensPerSecond > eventsPerSecondGoal;
} else if (this.goal == SUBMIT_GOAL.ROUNDS_PER_SECOND_WHOLE_NETWORK) {
final double realRoundsPerSecond = (double) metrics.getValue(PLATFORM_CATEGORY, "rounds/sec");
final double realRoundsPerSecond = (double) metrics.getValue(PLATFORM_CATEGORY, "rounds_per_sec");
return realRoundsPerSecond <= roundsPerSecondGoal;
} else if (this.goal == SUBMIT_GOAL.TRANS_PER_EVENT_WHOLE_NETWORK) {
final double realTranPerEvent = (double) metrics.getValue(PLATFORM_CATEGORY, "trans/event");
final double realTranPerEvent = (double) metrics.getValue(PLATFORM_CATEGORY, "trans_per_event");
return realTranPerEvent <= tranPerEventGoal;

} else if (this.goal == SUBMIT_GOAL.C2C_LATENCY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ public ChatterCore(
metrics,
new CountPerSecond.Config(METRICS_CATEGORY, "msgsPerSecRead")
.withDescription("number of chatter messages read per second")
.withUnit("messages/second"));
.withUnit("messages_per_second"));
this.msgsPerSecWrit = new CountPerSecond(
metrics,
new CountPerSecond.Config(METRICS_CATEGORY, "msgsPerSecWrit")
.withDescription("number of chatter messages written per second")
.withUnit("messages/second"));
.withUnit("messages_per_second"));
selfProcessingTime =
metrics.getOrCreate(new DurationGauge.Config(METRICS_CATEGORY, "eventProcTime", ChronoUnit.MILLIS)
.withDescription("the time it takes to process and validate an event"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public void mousePressed(MouseEvent e) {
}
});
}
if ("trans/sec".equals(metric.getName())) {
if ("trans_per_sec".equals(metric.getName())) {
showChart(j);
}
}
Expand Down

0 comments on commit 3aa52f2

Please sign in to comment.