diff --git a/sdk/src/main/java/io/horizen/metrics/MetricsManager.java b/sdk/src/main/java/io/horizen/metrics/MetricsManager.java index b74c49a260..e541b1e1fc 100644 --- a/sdk/src/main/java/io/horizen/metrics/MetricsManager.java +++ b/sdk/src/main/java/io/horizen/metrics/MetricsManager.java @@ -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)")); diff --git a/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala b/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala index 6fa9d841e2..61d8d61f02 100644 --- a/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala +++ b/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala @@ -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