diff --git a/sdk/src/main/java/io/horizen/metrics/MetricsManager.java b/sdk/src/main/java/io/horizen/metrics/MetricsManager.java index e541b1e1fc..3df414eeea 100644 --- a/sdk/src/main/java/io/horizen/metrics/MetricsManager.java +++ b/sdk/src/main/java/io/horizen/metrics/MetricsManager.java @@ -50,8 +50,8 @@ private MetricsManager(TimeProvider timeProvider) throws IOException { blockApplyTime = Gauge.builder().name("block_apply_time").register(); helps.add(new MetricsHelp(blockApplyTime.getPrometheusName(), "Time to apply block to node wallet and state (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)")); + blockApplyTimeAbsolute = Gauge.builder().name("block_apply_time_fromslotstart").register(); + helps.add(new MetricsHelp(blockApplyTimeAbsolute.getPrometheusName(), "Delta between timestamp when block has been applied succesfully on this node and start timestamp of the slot it belongs to (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)")); @@ -66,7 +66,7 @@ private MetricsManager(TimeProvider timeProvider) throws IOException { helps.add(new MetricsHelp(forgeLotteryTime.getPrometheusName(), "Time to execute the lottery (milliseconds)")); forgeBlockCreationTime = Gauge.builder().name("forge_blockcreation_time").register(); - helps.add(new MetricsHelp(forgeBlockCreationTime.getPrometheusName(), "Time to create a new forged block (milliseconds)")); + helps.add(new MetricsHelp(forgeBlockCreationTime.getPrometheusName(), "Time to create a new forged block (calculated from the start timestamp of the slot it belongs to) (milliseconds)")); } public long currentMillis(){ diff --git a/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala b/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala index 61d8d61f02..aaa0c3c5c1 100644 --- a/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala +++ b/sdk/src/main/scala/io/horizen/AbstractSidechainNodeViewHolder.scala @@ -307,7 +307,7 @@ abstract class AbstractSidechainNodeViewHolder[ metricsManager.mempoolSize(newMemPool.size) metricsManager.appliedBlockOk( endTime- startTime, - endTime - pmod.timestamp + endTime - (pmod.timestamp * 1000) ); // TODO FOR MERGE: usedSizeKBytes()/usedPercentage() should be moved into sparkz.core.transaction.MemoryPool diff --git a/sdk/src/main/scala/io/horizen/forge/AbstractForger.scala b/sdk/src/main/scala/io/horizen/forge/AbstractForger.scala index 7db63c13a5..277ec04358 100644 --- a/sdk/src/main/scala/io/horizen/forge/AbstractForger.scala +++ b/sdk/src/main/scala/io/horizen/forge/AbstractForger.scala @@ -172,7 +172,7 @@ abstract class AbstractForger[ forgedBlockAsFuture.onComplete{ case Success(ForgeSuccess(block)) => { log.info(s"Got successfully forged block with id ${block.id}") - metricsManager.forgedBlock(metricsManager.currentMillis() - block.timestamp); + metricsManager.forgedBlock(metricsManager.currentMillis() - (block.timestamp * 1000)) viewHolderRef ! LocallyGeneratedModifier(block) respondsToOpt.map(respondsTo => respondsTo ! Success(block.id)) }