Skip to content

Commit

Permalink
fix on help and block apply time metric
Browse files Browse the repository at this point in the history
  • Loading branch information
paolocappelletti committed Apr 9, 2024
1 parent 78d90e8 commit 9f2c8ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sdk/src/main/java/io/horizen/metrics/MetricsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ private MetricsManager(TimeProvider timeProvider) throws IOException {
helps = new ArrayList<>();

blockApplyTime = Gauge.builder().name("block_apply_time").register();
helps.add(new MetricsHelp(blockApplyTime.getPrometheusName(), "Time to apply block (milliseconds)"));
helps.add(new MetricsHelp(blockApplyTime.getPrometheusName(), "Time to apply block to node wallet and state (milliseconds)"));

blockApplyTimeAbsolute = Gauge.builder().name("block_apply_time_absolute").register();
helps.add(new MetricsHelp(blockApplyTimeAbsolute.getPrometheusName(), "Delta between block timestamp and timestamp when block has been applied succesfully on this node (milliseconds)"));
blockApplyTimeAbsolute = Gauge.builder().name("block_apply_time_fromforging").register();
helps.add(new MetricsHelp(blockApplyTimeAbsolute.getPrometheusName(), "Delta between timestamp when block has been applied succesfully on this node and timestamp of the block indicated by the forger (milliseconds)"));

blocksAppliedSuccesfully = Counter.builder().name("block_applied_ok").register();
helps.add(new MetricsHelp(blocksAppliedSuccesfully.getPrometheusName(),"Number of received blocks applied succesfully (absolute value since start of the node)"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ abstract class AbstractSidechainNodeViewHolder[
log.info(s"Persistent modifier ${pmod.encodedId} applied successfully and node view updated!")
log.debug(s"Current mempool size: ${newMemPool.size} transactions")

var endTime = metricsManager.currentMillis()
metricsManager.mempoolSize(newMemPool.size)
metricsManager.appliedBlockOk(
metricsManager.currentMillis() - pmod.timestamp,
metricsManager.currentMillis()- startTime
endTime- startTime,
endTime - pmod.timestamp
);

// TODO FOR MERGE: usedSizeKBytes()/usedPercentage() should be moved into sparkz.core.transaction.MemoryPool
Expand Down

0 comments on commit 9f2c8ac

Please sign in to comment.