Skip to content

Commit

Permalink
Added JavaDocs and NonNull where necessary
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Aug 27, 2024
1 parent c8e0aeb commit a2f3669
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public interface MetricsInjectionModule {
/**
* Provides the metrics service.
*
* @param metricsService the metrics service to be used
* @return the metrics service
*/
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,33 @@
import com.swirlds.metrics.api.Counter;
import com.swirlds.metrics.api.LongGauge;

/** Use member variables of this class to update metric data for the Hedera Block Node. */
public interface MetricsService {
/** Update the counter of live block items transiting via the live stream. */
/**
* Update the counter of live block items transiting via the live stream.
*
* @return use this metric to increase the counter of block items received
*/
Counter liveBlockItems();

/** Update the counter of blocks persisted to storage. */
/**
* Update the counter of blocks persisted to storage.
*
* @return use this counter to increase the amount of blocks persisted to disk
*/
Counter blocksPersisted();

/** Update the counter of single blocks retrieved from storage. */
/**
* Update the counter of single blocks retrieved from storage.
*
* @return use this metric to increase the counter of single blocks retrieved
*/
Counter singleBlocksRetrieved();

/** Update the gauge of subscribers currently consuming to the live stream. */
/**
* Update the gauge of subscribers currently consuming to the live stream.
*
* @return Use this to increase or decrease the amount of current subscribers to the live stream
*/
LongGauge subscribers();
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,28 @@ public class MetricsServiceImpl implements MetricsService {

/** Update the counter of live block items transiting via the live stream. */
@Override
@NonNull
public final Counter liveBlockItems() {
return liveBlockItems;
}

/** Update the counter of blocks persisted to storage. */
@Override
@NonNull
public final Counter blocksPersisted() {
return blocksPersisted;
}

/** Update the counter of single blocks retrieved from storage. */
@Override
@NonNull
public final Counter singleBlocksRetrieved() {
return singleBlocksRetrieved;
}

/** Update the gauge of subscribers currently consuming to the live stream. */
@Override
@NonNull
public final LongGauge subscribers() {
return subscribers;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public TestConfigBuilder withValue(
* @return the created configuration
*/
@NonNull
@SuppressWarnings({"removal"})
public Configuration getOrCreateConfig() {
try (final Locked ignore = configLock.lock()) {
if (configuration == null) {
Expand Down

0 comments on commit a2f3669

Please sign in to comment.