From 3aa52f254364ffb909f3be1488f6452444b1f41c Mon Sep 17 00:00:00 2001 From: Maxi Tartaglia <152629744+mxtartaglia-sl@users.noreply.github.com> Date: Fri, 2 Feb 2024 01:17:04 -0300 Subject: [PATCH] fix: Ui metrics name (#11317) Signed-off-by: mxtartaglia --- .../swirlds/demo/crypto/CryptocurrencyDemoMain.java | 2 +- .../swirlds/demo/hashgraph/HashgraphDemoMain.java | 12 ++++++------ .../swirlds/demo/platform/TransactionSubmitter.java | 6 +++--- .../gossip/chatter/protocol/ChatterCore.java | 4 ++-- .../swirlds/platform/gui/internal/WinTab2Stats.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoMain.java b/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoMain.java index 9e5a9c400345..dd811f1a548d 100644 --- a/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoMain.java +++ b/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoMain.java @@ -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(); diff --git a/platform-sdk/platform-apps/demos/HashgraphDemo/src/main/java/com/swirlds/demo/hashgraph/HashgraphDemoMain.java b/platform-sdk/platform-apps/demos/HashgraphDemo/src/main/java/com/swirlds/demo/hashgraph/HashgraphDemoMain.java index 11b664ea9f49..c2ea1f496fd1 100644 --- a/platform-sdk/platform-apps/demos/HashgraphDemo/src/main/java/com/swirlds/demo/hashgraph/HashgraphDemoMain.java +++ b/platform-sdk/platform-apps/demos/HashgraphDemo/src/main/java/com/swirlds/demo/hashgraph/HashgraphDemoMain.java @@ -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); @@ -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" diff --git a/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/TransactionSubmitter.java b/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/TransactionSubmitter.java index b515d4e5e1ce..85f73e2e2269 100644 --- a/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/TransactionSubmitter.java +++ b/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/TransactionSubmitter.java @@ -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) { diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gossip/chatter/protocol/ChatterCore.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gossip/chatter/protocol/ChatterCore.java index ce71289c124c..bd0c8bf822be 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gossip/chatter/protocol/ChatterCore.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gossip/chatter/protocol/ChatterCore.java @@ -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")); diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gui/internal/WinTab2Stats.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gui/internal/WinTab2Stats.java index f9a6b98201a6..a9bd30644246 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gui/internal/WinTab2Stats.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/gui/internal/WinTab2Stats.java @@ -228,7 +228,7 @@ public void mousePressed(MouseEvent e) { } }); } - if ("trans/sec".equals(metric.getName())) { + if ("trans_per_sec".equals(metric.getName())) { showChart(j); } }