Skip to content

Commit

Permalink
Added metric for the StreamVerifier
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Sep 12, 2024
1 parent 4d8ad26 commit bd38490
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ public enum Counter implements MetricMetadata {
/** The number of live block items received before publishing to the RingBuffer. */
LiveBlockItems("live_block_items", "Live BlockItems"),

/** The number of PublishStreamResponses generated and published to the subscribers. */
SuccessfulPubStreamResp(
"successful_pub_stream_resp", "Successful Publish Stream Responses"),

/** The number of PublishStreamResponses sent to the producers. */
SuccessfulPubStreamRespSent(
"successful_pub_stream_resp_sent", "Successful Publish Stream Responses Sent"),

/**
* The number of blocks persisted to storage.
*
* <p>Block items are not counted here, only the blocks.
*/
/** The number of live block items verified before persisting them. */
LiveBlocksVerified("live_blocks_verified", "Live Blocks Verified"),

/** The number of blocks persisted to storage. */
BlocksPersisted("blocks_persisted", "Blocks Persisted"),

/** The number of live block items consumed from the by each consumer observer. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.hedera.block.server.verifier;

import static com.hedera.block.server.metrics.BlockNodeMetricTypes.Counter.LiveBlocksVerified;
import static java.lang.System.Logger.Level.ERROR;

import com.hedera.block.server.config.BlockNodeContext;
Expand Down Expand Up @@ -69,7 +70,7 @@ public void onEvent(
// Publish the block item back upstream to the notifier
// to send responses to producers.
notifier.publish(blockItem);
metricsService.get().increment();
metricsService.get(LiveBlocksVerified).increment();
}
} else {
LOGGER.log(

Check warning on line 76 in server/src/main/java/com/hedera/block/server/verifier/StreamVerifierImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/hedera/block/server/verifier/StreamVerifierImpl.java#L76

Added line #L76 was not covered by tests
Expand Down

0 comments on commit bd38490

Please sign in to comment.