Rename MetricCategory to PantheonMetricCategory (#1574)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Adrian Sutton 6 years ago committed by GitHub
parent 8bf224707f
commit f2a2ffc008
  1. 16
      ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/chain/DefaultMutableBlockchain.java
  2. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/manager/EthPeers.java
  3. 14
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/manager/MonitoredExecutors.java
  4. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/manager/task/AbstractEthTask.java
  5. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/DefaultSynchronizer.java
  6. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/PipelineChainDownloader.java
  7. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/fastsync/FastDownloaderFactory.java
  8. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/fastsync/FastSyncActions.java
  9. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/fastsync/FastSyncDownloadPipelineFactory.java
  10. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/fullsync/FullSyncDownloadPipelineFactory.java
  11. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/CompleteTaskStep.java
  12. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/LoadLocalDataStep.java
  13. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/WorldStateDownloadProcess.java
  14. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/WorldStateDownloader.java
  15. 6
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/transactions/PendingTransactions.java
  16. 4
      ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/transactions/TransactionPool.java
  17. 4
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcHttpService.java
  18. 6
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/websocket/subscription/SubscriptionManager.java
  19. 4
      ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/DebugMetricsTest.java
  20. 4
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/discovery/VertxPeerDiscoveryAgent.java
  21. 6
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/DiscoveryProtocolLogger.java
  22. 8
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/PeerDiscoveryController.java
  23. 4
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/network/NetworkRunner.java
  24. 8
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/RlpxAgent.java
  25. 4
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/connections/PeerConnectionEvents.java
  26. 4
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/connections/netty/DeFramer.java
  27. 6
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/connections/netty/NettyConnectionInitializer.java
  28. 8
      ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/AccountLocalConfigPermissioningController.java
  29. 8
      ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/NodeLocalConfigPermissioningController.java
  30. 8
      ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/NodeSmartContractPermissioningController.java
  31. 8
      ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/TransactionSmartContractPermissioningController.java
  32. 10
      ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/node/provider/SyncStatusNodePermissioningProvider.java
  33. 8
      ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java
  34. 8
      ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/NodeLocalConfigPermissioningControllerTest.java
  35. 8
      ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/NodeSmartContractPermissioningControllerTest.java
  36. 8
      ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/TransactionSmartContractPermissioningControllerTest.java
  37. 10
      ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/node/provider/SyncStatusNodePermissioningProviderTest.java
  38. 19
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/MetricsSystem.java
  39. 6
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/Observation.java
  40. 8
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/PantheonMetricCategory.java
  41. 10
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/noop/NoOpMetricsSystem.java
  42. 14
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/prometheus/MetricsConfiguration.java
  43. 51
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/prometheus/PrometheusMetricsSystem.java
  44. 8
      metrics/core/src/main/java/tech/pegasys/pantheon/metrics/vertx/PoolMetricsAdapter.java
  45. 8
      metrics/core/src/test-support/java/tech/pegasys/pantheon/metrics/StubMetricsSystem.java
  46. 11
      metrics/core/src/test/java/tech/pegasys/pantheon/metrics/noop/NoOpMetricsSystemTest.java
  47. 12
      metrics/core/src/test/java/tech/pegasys/pantheon/metrics/prometheus/PrometheusMetricsSystemTest.java
  48. 2
      metrics/rocksdb/src/main/java/tech/pegasys/pantheon/metrics/rocksdb/RocksDBStats.java
  49. 6
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
  50. 6
      pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java
  51. 14
      services/kvstore/src/main/java/tech/pegasys/pantheon/services/kvstore/RocksDbKeyValueStorage.java

@ -23,8 +23,8 @@ import tech.pegasys.pantheon.ethereum.core.BlockHeader;
import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.Hash;
import tech.pegasys.pantheon.ethereum.core.Transaction; import tech.pegasys.pantheon.ethereum.core.Transaction;
import tech.pegasys.pantheon.ethereum.core.TransactionReceipt; import tech.pegasys.pantheon.ethereum.core.TransactionReceipt;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.InvalidConfigurationException; import tech.pegasys.pantheon.util.InvalidConfigurationException;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import tech.pegasys.pantheon.util.bytes.BytesValues; import tech.pegasys.pantheon.util.bytes.BytesValues;
@ -69,12 +69,12 @@ public class DefaultMutableBlockchain implements MutableBlockchain {
chainHeadOmmerCount = chainHeadBody.getOmmers().size(); chainHeadOmmerCount = chainHeadBody.getOmmers().size();
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"height", "height",
"Height of the chainhead", "Height of the chainhead",
this::getChainHeadBlockNumber); this::getChainHeadBlockNumber);
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"difficulty_total", "difficulty_total",
"Total difficulty of the chainhead", "Total difficulty of the chainhead",
() -> () ->
@ -82,31 +82,31 @@ public class DefaultMutableBlockchain implements MutableBlockchain {
.longValue()); .longValue());
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"chain_head_timestamp", "chain_head_timestamp",
"Timestamp from the current chain head", "Timestamp from the current chain head",
() -> getChainHeadHeader().getTimestamp()); () -> getChainHeadHeader().getTimestamp());
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"chain_head_gas_used", "chain_head_gas_used",
"Gas used by the current chain head block", "Gas used by the current chain head block",
() -> getChainHeadHeader().getGasUsed()); () -> getChainHeadHeader().getGasUsed());
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"chain_head_gas_limit", "chain_head_gas_limit",
"Block gas limit of the current chain head block", "Block gas limit of the current chain head block",
() -> getChainHeadHeader().getGasLimit()); () -> getChainHeadHeader().getGasLimit());
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"chain_head_transaction_count", "chain_head_transaction_count",
"Number of transactions in the current chain head block", "Number of transactions in the current chain head block",
() -> chainHeadTransactionCount); () -> chainHeadTransactionCount);
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.BLOCKCHAIN, PantheonMetricCategory.BLOCKCHAIN,
"chain_head_ommer_count", "chain_head_ommer_count",
"Number of ommers in the current chain head block", "Number of ommers in the current chain head block",
() -> chainHeadOmmerCount); () -> chainHeadOmmerCount);

@ -14,8 +14,8 @@ package tech.pegasys.pantheon.ethereum.eth.manager;
import tech.pegasys.pantheon.ethereum.eth.manager.EthPeer.DisconnectCallback; import tech.pegasys.pantheon.ethereum.eth.manager.EthPeer.DisconnectCallback;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.PeerConnection; import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.PeerConnection;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import java.time.Clock; import java.time.Clock;
@ -53,7 +53,7 @@ public class EthPeers {
this.protocolName = protocolName; this.protocolName = protocolName;
this.clock = clock; this.clock = clock;
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.PEERS, PantheonMetricCategory.PEERS,
"pending_peer_requests_current", "pending_peer_requests_current",
"Number of peer requests currently pending because peers are busy", "Number of peer requests currently pending because peers are busy",
pendingRequests::size); pendingRequests::size);

@ -13,8 +13,8 @@
package tech.pegasys.pantheon.ethereum.eth.manager; package tech.pegasys.pantheon.ethereum.eth.manager;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.Locale; import java.util.Locale;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -87,31 +87,31 @@ public class MonitoredExecutors {
new ThreadFactoryBuilder().setNameFormat(name + "-%d").build()); new ThreadFactoryBuilder().setNameFormat(name + "-%d").build());
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.EXECUTORS, PantheonMetricCategory.EXECUTORS,
metricName + "_queue_length_current", metricName + "_queue_length_current",
"Current number of tasks awaiting execution", "Current number of tasks awaiting execution",
executor.getQueue()::size); executor.getQueue()::size);
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.EXECUTORS, PantheonMetricCategory.EXECUTORS,
metricName + "_active_threads_current", metricName + "_active_threads_current",
"Current number of threads executing tasks", "Current number of threads executing tasks",
executor::getActiveCount); executor::getActiveCount);
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.EXECUTORS, PantheonMetricCategory.EXECUTORS,
metricName + "_pool_size_current", metricName + "_pool_size_current",
"Current number of threads in the thread pool", "Current number of threads in the thread pool",
executor::getPoolSize); executor::getPoolSize);
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.EXECUTORS, PantheonMetricCategory.EXECUTORS,
metricName + "_completed_tasks_total", metricName + "_completed_tasks_total",
"Total number of tasks executed", "Total number of tasks executed",
executor::getCompletedTaskCount); executor::getCompletedTaskCount);
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.EXECUTORS, PantheonMetricCategory.EXECUTORS,
metricName + "_submitted_tasks_total", metricName + "_submitted_tasks_total",
"Total number of tasks executed", "Total number of tasks executed",
executor::getTaskCount); executor::getTaskCount);
@ -126,7 +126,7 @@ public class MonitoredExecutors {
public CountingAbortPolicy(final String metricName, final MetricsSystem metricsSystem) { public CountingAbortPolicy(final String metricName, final MetricsSystem metricsSystem) {
this.rejectedTaskCounter = this.rejectedTaskCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.EXECUTORS, PantheonMetricCategory.EXECUTORS,
metricName + "_rejected_tasks_total", metricName + "_rejected_tasks_total",
"Total number of tasks rejected by this executor"); "Total number of tasks rejected by this executor");
} }

@ -16,9 +16,9 @@ import static tech.pegasys.pantheon.util.FutureUtils.completedExceptionally;
import tech.pegasys.pantheon.ethereum.eth.manager.EthScheduler; import tech.pegasys.pantheon.ethereum.eth.manager.EthScheduler;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem; import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem;
import java.util.Collection; import java.util.Collection;
@ -50,7 +50,7 @@ public abstract class AbstractEthTask<T> implements EthTask<T> {
private static OperationTimer buildOperationTimer(final MetricsSystem metricsSystem) { private static OperationTimer buildOperationTimer(final MetricsSystem metricsSystem) {
final LabelledMetric<OperationTimer> ethTasksTimer = final LabelledMetric<OperationTimer> ethTasksTimer =
metricsSystem.createLabelledTimer( metricsSystem.createLabelledTimer(
MetricCategory.SYNCHRONIZER, "task", "Internal processing tasks", "taskName"); PantheonMetricCategory.SYNCHRONIZER, "task", "Internal processing tasks", "taskName");
if (ethTasksTimer == NoOpMetricsSystem.NO_OP_LABELLED_1_OPERATION_TIMER) { if (ethTasksTimer == NoOpMetricsSystem.NO_OP_LABELLED_1_OPERATION_TIMER) {
return () -> return () ->
new OperationTimer.TimingContext() { new OperationTimer.TimingContext() {

@ -27,8 +27,8 @@ import tech.pegasys.pantheon.ethereum.eth.sync.state.PendingBlocks;
import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncState; import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncState;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.ExceptionUtils; import tech.pegasys.pantheon.util.ExceptionUtils;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
@ -98,12 +98,12 @@ public class DefaultSynchronizer<C> implements Synchronizer {
clock); clock);
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"best_known_block", "best_known_block",
"Height of best known block from any connected peer", "Height of best known block from any connected peer",
() -> syncState.syncStatus().getHighestBlock()); () -> syncState.syncStatus().getHighestBlock());
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"in_sync", "in_sync",
"Whether or not the local node has caught up to the best known peer", "Whether or not the local node has caught up to the best known peer",
() -> getSyncStatus().isPresent() ? 0 : 1); () -> getSyncStatus().isPresent() ? 0 : 1);

@ -23,8 +23,8 @@ import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncTarget;
import tech.pegasys.pantheon.ethereum.eth.sync.tasks.exceptions.InvalidBlockException; import tech.pegasys.pantheon.ethereum.eth.sync.tasks.exceptions.InvalidBlockException;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.pipeline.Pipeline; import tech.pegasys.pantheon.services.pipeline.Pipeline;
import tech.pegasys.pantheon.util.ExceptionUtils; import tech.pegasys.pantheon.util.ExceptionUtils;
@ -65,7 +65,7 @@ public class PipelineChainDownloader<C> implements ChainDownloader {
final LabelledMetric<Counter> labelledCounter = final LabelledMetric<Counter> labelledCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"chain_download_pipeline_restarts", "chain_download_pipeline_restarts",
"Number of times the chain download pipeline has been restarted", "Number of times the chain download pipeline has been restarted",
"reason"); "reason");

@ -23,8 +23,8 @@ import tech.pegasys.pantheon.ethereum.eth.sync.worldstate.WorldStateDownloader;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; import tech.pegasys.pantheon.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.tasks.CachingTaskCollection; import tech.pegasys.pantheon.services.tasks.CachingTaskCollection;
import tech.pegasys.pantheon.services.tasks.FlatFileTaskCollection; import tech.pegasys.pantheon.services.tasks.FlatFileTaskCollection;
@ -123,13 +123,13 @@ public class FastDownloaderFactory {
dataDirectory, NodeDataRequest::serialize, NodeDataRequest::deserialize)); dataDirectory, NodeDataRequest::serialize, NodeDataRequest::deserialize));
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_pending_requests_current", "world_state_pending_requests_current",
"Number of pending requests for fast sync world state download", "Number of pending requests for fast sync world state download",
taskCollection::size); taskCollection::size);
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_pending_requests_cache_size", "world_state_pending_requests_cache_size",
"Pending request cache size for fast sync world state download", "Pending request cache size for fast sync world state download",
taskCollection::cacheSize); taskCollection::cacheSize);

@ -26,8 +26,8 @@ import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration;
import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncState; import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncState;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.ExceptionUtils; import tech.pegasys.pantheon.util.ExceptionUtils;
import java.time.Duration; import java.time.Duration;
@ -66,11 +66,11 @@ public class FastSyncActions<C> {
pivotBlockSelectionCounter = pivotBlockSelectionCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"fast_sync_pivot_block_selected_count", "fast_sync_pivot_block_selected_count",
"Number of times a fast sync pivot block has been selected"); "Number of times a fast sync pivot block has been selected");
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"fast_sync_pivot_block_current", "fast_sync_pivot_block_current",
"The current fast sync pivot block", "The current fast sync pivot block",
pivotBlockGauge::get); pivotBlockGauge::get);

@ -34,8 +34,8 @@ import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncTarget;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.pipeline.Pipeline; import tech.pegasys.pantheon.services.pipeline.Pipeline;
import tech.pegasys.pantheon.services.pipeline.PipelineBuilder; import tech.pegasys.pantheon.services.pipeline.PipelineBuilder;
@ -67,7 +67,7 @@ public class FastSyncDownloadPipelineFactory<C> implements DownloadPipelineFacto
this.metricsSystem = metricsSystem; this.metricsSystem = metricsSystem;
final LabelledMetric<Counter> fastSyncValidationCounter = final LabelledMetric<Counter> fastSyncValidationCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"fast_sync_validation_mode", "fast_sync_validation_mode",
"Number of blocks validated using light vs full validation during fast sync", "Number of blocks validated using light vs full validation during fast sync",
"validationMode"); "validationMode");
@ -130,7 +130,7 @@ public class FastSyncDownloadPipelineFactory<C> implements DownloadPipelineFacto
checkpointRangeSource, checkpointRangeSource,
downloaderParallelism, downloaderParallelism,
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"chain_download_pipeline_processed_total", "chain_download_pipeline_processed_total",
"Number of entries process by each chain download pipeline stage", "Number of entries process by each chain download pipeline stage",
"step", "step",

@ -27,8 +27,8 @@ import tech.pegasys.pantheon.ethereum.eth.sync.ValidationPolicy;
import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncTarget; import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncTarget;
import tech.pegasys.pantheon.ethereum.mainnet.HeaderValidationMode; import tech.pegasys.pantheon.ethereum.mainnet.HeaderValidationMode;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.pipeline.Pipeline; import tech.pegasys.pantheon.services.pipeline.Pipeline;
import tech.pegasys.pantheon.services.pipeline.PipelineBuilder; import tech.pegasys.pantheon.services.pipeline.PipelineBuilder;
@ -95,7 +95,7 @@ public class FullSyncDownloadPipelineFactory<C> implements DownloadPipelineFacto
checkpointRangeSource, checkpointRangeSource,
downloaderParallelism, downloaderParallelism,
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"chain_download_pipeline_processed_total", "chain_download_pipeline_processed_total",
"Number of entries process by each chain download pipeline stage", "Number of entries process by each chain download pipeline stage",
"step", "step",

@ -15,8 +15,8 @@ package tech.pegasys.pantheon.ethereum.eth.sync.worldstate;
import tech.pegasys.pantheon.ethereum.core.BlockHeader; import tech.pegasys.pantheon.ethereum.core.BlockHeader;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.tasks.Task; import tech.pegasys.pantheon.services.tasks.Task;
public class CompleteTaskStep { public class CompleteTaskStep {
@ -31,12 +31,12 @@ public class CompleteTaskStep {
completedRequestsCounter = completedRequestsCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_completed_requests_total", "world_state_completed_requests_total",
"Total number of node data requests completed as part of fast sync world state download"); "Total number of node data requests completed as part of fast sync world state download");
retriedRequestsCounter = retriedRequestsCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_retried_requests_total", "world_state_retried_requests_total",
"Total number of node data requests repeated as part of fast sync world state download"); "Total number of node data requests repeated as part of fast sync world state download");
} }

@ -14,8 +14,8 @@ package tech.pegasys.pantheon.ethereum.eth.sync.worldstate;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.pipeline.Pipe; import tech.pegasys.pantheon.services.pipeline.Pipe;
import tech.pegasys.pantheon.services.tasks.Task; import tech.pegasys.pantheon.services.tasks.Task;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
@ -33,7 +33,7 @@ public class LoadLocalDataStep {
this.worldStateStorage = worldStateStorage; this.worldStateStorage = worldStateStorage;
existingNodeCounter = existingNodeCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_existing_nodes_total", "world_state_existing_nodes_total",
"Total number of node data requests completed using existing data"); "Total number of node data requests completed using existing data");
} }

@ -19,8 +19,8 @@ import tech.pegasys.pantheon.ethereum.core.BlockHeader;
import tech.pegasys.pantheon.ethereum.eth.manager.EthScheduler; import tech.pegasys.pantheon.ethereum.eth.manager.EthScheduler;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.pipeline.Pipe; import tech.pegasys.pantheon.services.pipeline.Pipe;
import tech.pegasys.pantheon.services.pipeline.Pipeline; import tech.pegasys.pantheon.services.pipeline.Pipeline;
import tech.pegasys.pantheon.services.pipeline.PipelineBuilder; import tech.pegasys.pantheon.services.pipeline.PipelineBuilder;
@ -196,7 +196,7 @@ public class WorldStateDownloadProcess {
final int bufferCapacity = hashCountPerRequest * 2; final int bufferCapacity = hashCountPerRequest * 2;
final LabelledMetric<Counter> outputCounter = final LabelledMetric<Counter> outputCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_pipeline_processed_total", "world_state_pipeline_processed_total",
"Number of entries processed by each world state download pipeline stage", "Number of entries processed by each world state download pipeline stage",
"step", "step",

@ -16,8 +16,8 @@ import tech.pegasys.pantheon.ethereum.core.BlockHeader;
import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.Hash;
import tech.pegasys.pantheon.ethereum.eth.manager.EthContext; import tech.pegasys.pantheon.ethereum.eth.manager.EthContext;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateStorage;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.services.tasks.CachingTaskCollection; import tech.pegasys.pantheon.services.tasks.CachingTaskCollection;
import java.time.Clock; import java.time.Clock;
@ -66,13 +66,13 @@ public class WorldStateDownloader {
this.metricsSystem = metricsSystem; this.metricsSystem = metricsSystem;
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_node_requests_since_last_progress_current", "world_state_node_requests_since_last_progress_current",
"Number of world state requests made since the last time new data was returned", "Number of world state requests made since the last time new data was returned",
downloadStateValue(WorldDownloadState::getRequestsSinceLastProgress)); downloadStateValue(WorldDownloadState::getRequestsSinceLastProgress));
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.SYNCHRONIZER, PantheonMetricCategory.SYNCHRONIZER,
"world_state_inflight_requests_current", "world_state_inflight_requests_current",
"Number of in progress requests for world state data", "Number of in progress requests for world state data",
downloadStateValue(WorldDownloadState::getOutstandingTaskCount)); downloadStateValue(WorldDownloadState::getOutstandingTaskCount));

@ -20,8 +20,8 @@ import tech.pegasys.pantheon.ethereum.core.Hash;
import tech.pegasys.pantheon.ethereum.core.Transaction; import tech.pegasys.pantheon.ethereum.core.Transaction;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import java.time.Clock; import java.time.Clock;
@ -87,7 +87,7 @@ public class PendingTransactions {
this.clock = clock; this.clock = clock;
final LabelledMetric<Counter> transactionAddedCounter = final LabelledMetric<Counter> transactionAddedCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.TRANSACTION_POOL, PantheonMetricCategory.TRANSACTION_POOL,
"transactions_added_total", "transactions_added_total",
"Count of transactions added to the transaction pool", "Count of transactions added to the transaction pool",
"source"); "source");
@ -96,7 +96,7 @@ public class PendingTransactions {
transactionRemovedCounter = transactionRemovedCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.TRANSACTION_POOL, PantheonMetricCategory.TRANSACTION_POOL,
"transactions_removed_total", "transactions_removed_total",
"Count of transactions removed from the transaction pool", "Count of transactions removed from the transaction pool",
"source", "source",

@ -34,8 +34,8 @@ import tech.pegasys.pantheon.ethereum.mainnet.TransactionValidator.TransactionIn
import tech.pegasys.pantheon.ethereum.mainnet.ValidationResult; import tech.pegasys.pantheon.ethereum.mainnet.ValidationResult;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -83,7 +83,7 @@ public class TransactionPool implements BlockAddedObserver {
duplicateTransactionCounter = duplicateTransactionCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.TRANSACTION_POOL, PantheonMetricCategory.TRANSACTION_POOL,
"transactions_duplicates_total", "transactions_duplicates_total",
"Total number of duplicate transactions received", "Total number of duplicate transactions received",
"source"); "source");

@ -31,10 +31,10 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcResponse;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcResponseType; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcResponseType;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcUnauthorizedResponse; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcUnauthorizedResponse;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.OperationTimer.TimingContext; import tech.pegasys.pantheon.metrics.OperationTimer.TimingContext;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.NetworkUtility; import tech.pegasys.pantheon.util.NetworkUtility;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
@ -122,7 +122,7 @@ public class JsonRpcHttpService {
this.dataDir = dataDir; this.dataDir = dataDir;
requestTimer = requestTimer =
metricsSystem.createLabelledTimer( metricsSystem.createLabelledTimer(
MetricCategory.RPC, PantheonMetricCategory.RPC,
"request_time", "request_time",
"Time taken to process a JSON-RPC request", "Time taken to process a JSON-RPC request",
"methodName"); "methodName");

@ -19,8 +19,8 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.subscription.request.Uns
import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.subscription.response.SubscriptionResponse; import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.subscription.response.SubscriptionResponse;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -55,13 +55,13 @@ public class SubscriptionManager extends AbstractVerticle {
public SubscriptionManager(final MetricsSystem metricsSystem) { public SubscriptionManager(final MetricsSystem metricsSystem) {
subscribeCounter = subscribeCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.RPC, PantheonMetricCategory.RPC,
"subscription_subscribe_total", "subscription_subscribe_total",
"Total number of subscriptions", "Total number of subscriptions",
"type"); "type");
unsubscribeCounter = unsubscribeCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.RPC, PantheonMetricCategory.RPC,
"subscription_unsubscribe_total", "subscription_unsubscribe_total",
"Total number of unsubscriptions", "Total number of unsubscriptions",
"type"); "type");

@ -16,8 +16,8 @@ import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import static tech.pegasys.pantheon.metrics.MetricCategory.PEERS; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.PEERS;
import static tech.pegasys.pantheon.metrics.MetricCategory.RPC; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.RPC;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.JsonRpcRequest; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.JsonRpcRequest;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse;

@ -22,8 +22,8 @@ import tech.pegasys.pantheon.ethereum.p2p.discovery.internal.PeerDiscoveryContro
import tech.pegasys.pantheon.ethereum.p2p.discovery.internal.TimerUtil; import tech.pegasys.pantheon.ethereum.p2p.discovery.internal.TimerUtil;
import tech.pegasys.pantheon.ethereum.p2p.discovery.internal.VertxTimerUtil; import tech.pegasys.pantheon.ethereum.p2p.discovery.internal.VertxTimerUtil;
import tech.pegasys.pantheon.ethereum.p2p.permissions.PeerPermissions; import tech.pegasys.pantheon.ethereum.p2p.permissions.PeerPermissions;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.NetworkUtility; import tech.pegasys.pantheon.util.NetworkUtility;
import java.io.IOException; import java.io.IOException;
@ -64,7 +64,7 @@ public class VertxPeerDiscoveryAgent extends PeerDiscoveryAgent {
this.vertx = vertx; this.vertx = vertx;
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"vertx_eventloop_pending_tasks", "vertx_eventloop_pending_tasks",
"The number of pending tasks in the Vertx event loop", "The number of pending tasks in the Vertx event loop",
pendingTaskCounter(vertx.nettyEventLoopGroup())); pendingTaskCounter(vertx.nettyEventLoopGroup()));

@ -15,8 +15,8 @@ package tech.pegasys.pantheon.ethereum.p2p.discovery.internal;
import tech.pegasys.pantheon.ethereum.p2p.peers.Peer; import tech.pegasys.pantheon.ethereum.p2p.peers.Peer;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -30,13 +30,13 @@ public class DiscoveryProtocolLogger {
public DiscoveryProtocolLogger(final MetricsSystem metricsSystem) { public DiscoveryProtocolLogger(final MetricsSystem metricsSystem) {
outgoingMessageCounter = outgoingMessageCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"discovery_messages_outbound", "discovery_messages_outbound",
"Total number of P2P discovery messages sent", "Total number of P2P discovery messages sent",
"name"); "name");
incomingMessageCounter = incomingMessageCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"discovery_messages_inbound", "discovery_messages_inbound",
"Total number of P2P discovery messages received", "Total number of P2P discovery messages received",
"name"); "name");

@ -30,8 +30,8 @@ import tech.pegasys.pantheon.ethereum.p2p.peers.PeerId;
import tech.pegasys.pantheon.ethereum.p2p.permissions.PeerPermissions; import tech.pegasys.pantheon.ethereum.p2p.permissions.PeerPermissions;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
@ -172,21 +172,21 @@ public class PeerDiscoveryController {
this.peerPermissions = new PeerDiscoveryPermissions(localPeer, peerPermissions); this.peerPermissions = new PeerDiscoveryPermissions(localPeer, peerPermissions);
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"discovery_inflight_interactions_current", "discovery_inflight_interactions_current",
"Current number of inflight discovery interactions", "Current number of inflight discovery interactions",
inflightInteractions::size); inflightInteractions::size);
interactionCounter = interactionCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"discovery_interaction_count", "discovery_interaction_count",
"Total number of discovery interactions initiated", "Total number of discovery interactions initiated",
"type"); "type");
interactionRetryCounter = interactionRetryCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"discovery_interaction_retry_count", "discovery_interaction_retry_count",
"Total number of interaction retries performed", "Total number of interaction retries performed",
"type"); "type");

@ -17,8 +17,8 @@ import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.SubProtocol;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason; import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -55,7 +55,7 @@ public class NetworkRunner implements AutoCloseable {
this.subProtocols = subProtocols; this.subProtocols = subProtocols;
inboundMessageCounter = inboundMessageCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"p2p_messages_inbound", "p2p_messages_inbound",
"Count of each P2P message received inbound.", "Count of each P2P message received inbound.",
"protocol", "protocol",

@ -33,8 +33,8 @@ import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.netty.NettyConnection
import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.Capability; import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.Capability;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason; import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.FutureUtils; import tech.pegasys.pantheon.util.FutureUtils;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
@ -90,15 +90,15 @@ public class RlpxAgent {
// Setup metrics // Setup metrics
connectedPeersCounter = connectedPeersCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PEERS, "connected_total", "Total number of peers connected"); PantheonMetricCategory.PEERS, "connected_total", "Total number of peers connected");
metricsSystem.createGauge( metricsSystem.createGauge(
MetricCategory.PEERS, PantheonMetricCategory.PEERS,
"peer_count_current", "peer_count_current",
"Number of peers currently connected", "Number of peers currently connected",
() -> (double) getConnectionCount()); () -> (double) getConnectionCount());
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"peers_limit", "peers_limit",
"Maximum P2P peer connections that can be established", "Maximum P2P peer connections that can be established",
() -> maxPeers); () -> maxPeers);

@ -21,8 +21,8 @@ import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.MessageData;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason; import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import java.util.Map; import java.util.Map;
@ -37,7 +37,7 @@ public class PeerConnectionEvents implements PeerConnectionEventDispatcher {
public PeerConnectionEvents(final MetricsSystem metricsSystem) { public PeerConnectionEvents(final MetricsSystem metricsSystem) {
disconnectCounter = disconnectCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.PEERS, PantheonMetricCategory.PEERS,
"disconnected_total", "disconnected_total",
"Total number of peers disconnected", "Total number of peers disconnected",
"initiator", "initiator",

@ -35,8 +35,8 @@ import tech.pegasys.pantheon.ethereum.p2p.rlpx.wire.messages.WireMessageCodes;
import tech.pegasys.pantheon.ethereum.rlp.RLPException; import tech.pegasys.pantheon.ethereum.rlp.RLPException;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
@ -86,7 +86,7 @@ final class DeFramer extends ByteToMessageDecoder {
this.connectionEventDispatcher = connectionEventDispatcher; this.connectionEventDispatcher = connectionEventDispatcher;
this.outboundMessagesCounter = this.outboundMessagesCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"p2p_messages_outbound", "p2p_messages_outbound",
"Count of each P2P message sent outbound.", "Count of each P2P message sent outbound.",
"protocol", "protocol",

@ -24,8 +24,8 @@ import tech.pegasys.pantheon.ethereum.p2p.rlpx.ConnectCallback;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.ConnectionInitializer; import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.ConnectionInitializer;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.PeerConnection; import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.PeerConnection;
import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.PeerConnectionEventDispatcher; import tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.PeerConnectionEventDispatcher;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
@ -80,13 +80,13 @@ public class NettyConnectionInitializer implements ConnectionInitializer {
this.metricsSystem = metricsSystem; this.metricsSystem = metricsSystem;
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"netty_workers_pending_tasks", "netty_workers_pending_tasks",
"The number of pending tasks in the Netty workers event loop", "The number of pending tasks in the Netty workers event loop",
pendingTaskCounter(workers)); pendingTaskCounter(workers));
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"netty_boss_pending_tasks", "netty_boss_pending_tasks",
"The number of pending tasks in the Netty boss event loop", "The number of pending tasks in the Netty boss event loop",
pendingTaskCounter(boss)); pendingTaskCounter(boss));

@ -17,8 +17,8 @@ import tech.pegasys.pantheon.ethereum.core.Hash;
import tech.pegasys.pantheon.ethereum.core.Transaction; import tech.pegasys.pantheon.ethereum.core.Transaction;
import tech.pegasys.pantheon.ethereum.permissioning.account.TransactionPermissioningProvider; import tech.pegasys.pantheon.ethereum.permissioning.account.TransactionPermissioningProvider;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
import java.io.IOException; import java.io.IOException;
@ -62,17 +62,17 @@ public class AccountLocalConfigPermissioningController implements TransactionPer
readAccountsFromConfig(configuration); readAccountsFromConfig(configuration);
this.checkCounter = this.checkCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"account_local_check_count", "account_local_check_count",
"Number of times the account local permissioning provider has been checked"); "Number of times the account local permissioning provider has been checked");
this.checkCounterPermitted = this.checkCounterPermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"account_local_check_count_permitted", "account_local_check_count_permitted",
"Number of times the account local permissioning provider has been checked and returned permitted"); "Number of times the account local permissioning provider has been checked and returned permitted");
this.checkCounterUnpermitted = this.checkCounterUnpermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"account_local_check_count_unpermitted", "account_local_check_count_unpermitted",
"Number of times the account local permissioning provider has been checked and returned unpermitted"); "Number of times the account local permissioning provider has been checked and returned unpermitted");
} }

@ -16,8 +16,8 @@ import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL;
import tech.pegasys.pantheon.ethereum.permissioning.node.NodePermissioningProvider; import tech.pegasys.pantheon.ethereum.permissioning.node.NodePermissioningProvider;
import tech.pegasys.pantheon.ethereum.permissioning.node.NodeWhitelistUpdatedEvent; import tech.pegasys.pantheon.ethereum.permissioning.node.NodeWhitelistUpdatedEvent;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.Subscribers; import tech.pegasys.pantheon.util.Subscribers;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
@ -80,17 +80,17 @@ public class NodeLocalConfigPermissioningController implements NodePermissioning
this.checkCounter = this.checkCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_local_check_count", "node_local_check_count",
"Number of times the node local permissioning provider has been checked"); "Number of times the node local permissioning provider has been checked");
this.checkCounterPermitted = this.checkCounterPermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_local_check_count_permitted", "node_local_check_count_permitted",
"Number of times the node local permissioning provider has been checked and returned permitted"); "Number of times the node local permissioning provider has been checked and returned permitted");
this.checkCounterUnpermitted = this.checkCounterUnpermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_local_check_count_unpermitted", "node_local_check_count_unpermitted",
"Number of times the node local permissioning provider has been checked and returned unpermitted"); "Number of times the node local permissioning provider has been checked and returned unpermitted");
} }

@ -22,8 +22,8 @@ import tech.pegasys.pantheon.ethereum.transaction.CallParameter;
import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator;
import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulatorResult; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulatorResult;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
import tech.pegasys.pantheon.util.bytes.BytesValues; import tech.pegasys.pantheon.util.bytes.BytesValues;
@ -77,17 +77,17 @@ public class NodeSmartContractPermissioningController implements NodePermissioni
this.checkCounter = this.checkCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_smart_contract_check_count", "node_smart_contract_check_count",
"Number of times the node smart contract permissioning provider has been checked"); "Number of times the node smart contract permissioning provider has been checked");
this.checkCounterPermitted = this.checkCounterPermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_smart_contract_check_count_permitted", "node_smart_contract_check_count_permitted",
"Number of times the node smart contract permissioning provider has been checked and returned permitted"); "Number of times the node smart contract permissioning provider has been checked and returned permitted");
this.checkCounterUnpermitted = this.checkCounterUnpermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_smart_contract_check_count_unpermitted", "node_smart_contract_check_count_unpermitted",
"Number of times the node smart contract permissioning provider has been checked and returned unpermitted"); "Number of times the node smart contract permissioning provider has been checked and returned unpermitted");
} }

@ -23,8 +23,8 @@ import tech.pegasys.pantheon.ethereum.transaction.CallParameter;
import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator;
import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulatorResult; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulatorResult;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
import tech.pegasys.pantheon.util.bytes.BytesValues; import tech.pegasys.pantheon.util.bytes.BytesValues;
@ -84,17 +84,17 @@ public class TransactionSmartContractPermissioningController
this.checkCounter = this.checkCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"transaction_smart_contract_check_count", "transaction_smart_contract_check_count",
"Number of times the transaction smart contract permissioning provider has been checked"); "Number of times the transaction smart contract permissioning provider has been checked");
this.checkCounterPermitted = this.checkCounterPermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"transaction_smart_contract_check_count_permitted", "transaction_smart_contract_check_count_permitted",
"Number of times the transaction smart contract permissioning provider has been checked and returned permitted"); "Number of times the transaction smart contract permissioning provider has been checked and returned permitted");
this.checkCounterUnpermitted = this.checkCounterUnpermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"transaction_smart_contract_check_count_unpermitted", "transaction_smart_contract_check_count_unpermitted",
"Number of times the transaction smart contract permissioning provider has been checked and returned unpermitted"); "Number of times the transaction smart contract permissioning provider has been checked and returned unpermitted");
} }

@ -19,8 +19,8 @@ import tech.pegasys.pantheon.ethereum.core.Synchronizer;
import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL; import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL;
import tech.pegasys.pantheon.ethereum.permissioning.node.NodePermissioningProvider; import tech.pegasys.pantheon.ethereum.permissioning.node.NodePermissioningProvider;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -47,23 +47,23 @@ public class SyncStatusNodePermissioningProvider implements NodePermissioningPro
this.fixedNodes.addAll(fixedNodes); this.fixedNodes.addAll(fixedNodes);
metricsSystem.createIntegerGauge( metricsSystem.createIntegerGauge(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_sync_reached", "sync_status_node_sync_reached",
"Whether the sync status permissioning provider has realised sync yet", "Whether the sync status permissioning provider has realised sync yet",
() -> hasReachedSync ? 1 : 0); () -> hasReachedSync ? 1 : 0);
this.checkCounter = this.checkCounter =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_check_count", "sync_status_node_check_count",
"Number of times the sync status permissioning provider has been checked"); "Number of times the sync status permissioning provider has been checked");
this.checkCounterPermitted = this.checkCounterPermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_check_count_permitted", "sync_status_node_check_count_permitted",
"Number of times the sync status permissioning provider has been checked and returned permitted"); "Number of times the sync status permissioning provider has been checked and returned permitted");
this.checkCounterUnpermitted = this.checkCounterUnpermitted =
metricsSystem.createCounter( metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_check_count_unpermitted", "sync_status_node_check_count_unpermitted",
"Number of times the sync status permissioning provider has been checked and returned unpermitted"); "Number of times the sync status permissioning provider has been checked and returned unpermitted");
} }

@ -26,8 +26,8 @@ import static org.mockito.Mockito.when;
import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.ethereum.core.Transaction; import tech.pegasys.pantheon.ethereum.core.Transaction;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -58,19 +58,19 @@ public class AccountLocalConfigPermissioningControllerTest {
public void before() { public void before() {
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"account_local_check_count", "account_local_check_count",
"Number of times the account local permissioning provider has been checked")) "Number of times the account local permissioning provider has been checked"))
.thenReturn(checkCounter); .thenReturn(checkCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"account_local_check_count_permitted", "account_local_check_count_permitted",
"Number of times the account local permissioning provider has been checked and returned permitted")) "Number of times the account local permissioning provider has been checked and returned permitted"))
.thenReturn(checkPermittedCounter); .thenReturn(checkPermittedCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"account_local_check_count_unpermitted", "account_local_check_count_unpermitted",
"Number of times the account local permissioning provider has been checked and returned unpermitted")) "Number of times the account local permissioning provider has been checked and returned unpermitted"))
.thenReturn(checkUnpermittedCounter); .thenReturn(checkUnpermittedCounter);

@ -29,8 +29,8 @@ import static tech.pegasys.pantheon.ethereum.permissioning.NodeLocalConfigPermis
import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL; import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL;
import tech.pegasys.pantheon.ethereum.permissioning.node.NodeWhitelistUpdatedEvent; import tech.pegasys.pantheon.ethereum.permissioning.node.NodeWhitelistUpdatedEvent;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
@ -74,19 +74,19 @@ public class NodeLocalConfigPermissioningControllerTest {
bootnodesList.clear(); bootnodesList.clear();
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_local_check_count", "node_local_check_count",
"Number of times the node local permissioning provider has been checked")) "Number of times the node local permissioning provider has been checked"))
.thenReturn(checkCounter); .thenReturn(checkCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_local_check_count_permitted", "node_local_check_count_permitted",
"Number of times the node local permissioning provider has been checked and returned permitted")) "Number of times the node local permissioning provider has been checked and returned permitted"))
.thenReturn(checkPermittedCounter); .thenReturn(checkPermittedCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_local_check_count_unpermitted", "node_local_check_count_unpermitted",
"Number of times the node local permissioning provider has been checked and returned unpermitted")) "Number of times the node local permissioning provider has been checked and returned unpermitted"))
.thenReturn(checkUnpermittedCounter); .thenReturn(checkUnpermittedCounter);

@ -31,8 +31,8 @@ import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL;
import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.io.IOException; import java.io.IOException;
@ -68,19 +68,19 @@ public class NodeSmartContractPermissioningControllerTest {
final Address contractAddress = Address.fromHexString(contractAddressString); final Address contractAddress = Address.fromHexString(contractAddressString);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_smart_contract_check_count", "node_smart_contract_check_count",
"Number of times the node smart contract permissioning provider has been checked")) "Number of times the node smart contract permissioning provider has been checked"))
.thenReturn(checkCounter); .thenReturn(checkCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_smart_contract_check_count_permitted", "node_smart_contract_check_count_permitted",
"Number of times the node smart contract permissioning provider has been checked and returned permitted")) "Number of times the node smart contract permissioning provider has been checked and returned permitted"))
.thenReturn(checkPermittedCounter); .thenReturn(checkPermittedCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"node_smart_contract_check_count_unpermitted", "node_smart_contract_check_count_unpermitted",
"Number of times the node smart contract permissioning provider has been checked and returned unpermitted")) "Number of times the node smart contract permissioning provider has been checked and returned unpermitted"))
.thenReturn(checkUnpermittedCounter); .thenReturn(checkUnpermittedCounter);

@ -33,8 +33,8 @@ import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
import java.io.IOException; import java.io.IOException;
@ -72,19 +72,19 @@ public class TransactionSmartContractPermissioningControllerTest {
final Address contractAddress = Address.fromHexString(contractAddressString); final Address contractAddress = Address.fromHexString(contractAddressString);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"transaction_smart_contract_check_count", "transaction_smart_contract_check_count",
"Number of times the transaction smart contract permissioning provider has been checked")) "Number of times the transaction smart contract permissioning provider has been checked"))
.thenReturn(checkCounter); .thenReturn(checkCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"transaction_smart_contract_check_count_permitted", "transaction_smart_contract_check_count_permitted",
"Number of times the transaction smart contract permissioning provider has been checked and returned permitted")) "Number of times the transaction smart contract permissioning provider has been checked and returned permitted"))
.thenReturn(checkPermittedCounter); .thenReturn(checkPermittedCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"transaction_smart_contract_check_count_unpermitted", "transaction_smart_contract_check_count_unpermitted",
"Number of times the transaction smart contract permissioning provider has been checked and returned unpermitted")) "Number of times the transaction smart contract permissioning provider has been checked and returned unpermitted"))
.thenReturn(checkUnpermittedCounter); .thenReturn(checkUnpermittedCounter);

@ -24,8 +24,8 @@ import tech.pegasys.pantheon.ethereum.core.Synchronizer;
import tech.pegasys.pantheon.ethereum.core.Synchronizer.SyncStatusListener; import tech.pegasys.pantheon.ethereum.core.Synchronizer.SyncStatusListener;
import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL; import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -74,17 +74,17 @@ public class SyncStatusNodePermissioningProviderTest {
ArgumentCaptor.forClass(IntSupplier.class); ArgumentCaptor.forClass(IntSupplier.class);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_check_count", "sync_status_node_check_count",
"Number of times the sync status permissioning provider has been checked")) "Number of times the sync status permissioning provider has been checked"))
.thenReturn(checkCounter); .thenReturn(checkCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_check_count_permitted", "sync_status_node_check_count_permitted",
"Number of times the sync status permissioning provider has been checked and returned permitted")) "Number of times the sync status permissioning provider has been checked and returned permitted"))
.thenReturn(checkPermittedCounter); .thenReturn(checkPermittedCounter);
when(metricsSystem.createCounter( when(metricsSystem.createCounter(
MetricCategory.PERMISSIONING, PantheonMetricCategory.PERMISSIONING,
"sync_status_node_check_count_unpermitted", "sync_status_node_check_count_unpermitted",
"Number of times the sync status permissioning provider has been checked and returned unpermitted")) "Number of times the sync status permissioning provider has been checked and returned unpermitted"))
.thenReturn(checkUnpermittedCounter); .thenReturn(checkUnpermittedCounter);
@ -92,7 +92,7 @@ public class SyncStatusNodePermissioningProviderTest {
this.syncStatusListener = captor.getValue(); this.syncStatusListener = captor.getValue();
verify(metricsSystem) verify(metricsSystem)
.createIntegerGauge( .createIntegerGauge(
eq(MetricCategory.PERMISSIONING), eq(PantheonMetricCategory.PERMISSIONING),
eq("sync_status_node_sync_reached"), eq("sync_status_node_sync_reached"),
eq("Whether the sync status permissioning provider has realised sync yet"), eq("Whether the sync status permissioning provider has realised sync yet"),
syncGaugeCallbackCaptor.capture()); syncGaugeCallbackCaptor.capture());

@ -20,25 +20,26 @@ import java.util.stream.Stream;
public interface MetricsSystem { public interface MetricsSystem {
default Counter createCounter( default Counter createCounter(
final MetricCategory category, final String name, final String help) { final PantheonMetricCategory category, final String name, final String help) {
return createLabelledCounter(category, name, help, new String[0]).labels(); return createLabelledCounter(category, name, help, new String[0]).labels();
} }
LabelledMetric<Counter> createLabelledCounter( LabelledMetric<Counter> createLabelledCounter(
MetricCategory category, String name, String help, String... labelNames); PantheonMetricCategory category, String name, String help, String... labelNames);
default OperationTimer createTimer( default OperationTimer createTimer(
final MetricCategory category, final String name, final String help) { final PantheonMetricCategory category, final String name, final String help) {
return createLabelledTimer(category, name, help, new String[0]).labels(); return createLabelledTimer(category, name, help, new String[0]).labels();
} }
LabelledMetric<OperationTimer> createLabelledTimer( LabelledMetric<OperationTimer> createLabelledTimer(
MetricCategory category, String name, String help, String... labelNames); PantheonMetricCategory category, String name, String help, String... labelNames);
void createGauge(MetricCategory category, String name, String help, DoubleSupplier valueSupplier); void createGauge(
PantheonMetricCategory category, String name, String help, DoubleSupplier valueSupplier);
default void createIntegerGauge( default void createIntegerGauge(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final IntSupplier valueSupplier) { final IntSupplier valueSupplier) {
@ -46,16 +47,16 @@ public interface MetricsSystem {
} }
default void createLongGauge( default void createLongGauge(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final LongSupplier valueSupplier) { final LongSupplier valueSupplier) {
createGauge(category, name, help, () -> (double) valueSupplier.getAsLong()); createGauge(category, name, help, () -> (double) valueSupplier.getAsLong());
} }
Stream<Observation> streamObservations(MetricCategory category); Stream<Observation> streamObservations(PantheonMetricCategory category);
default Stream<Observation> streamObservations() { default Stream<Observation> streamObservations() {
return Stream.of(MetricCategory.values()).flatMap(this::streamObservations); return Stream.of(PantheonMetricCategory.values()).flatMap(this::streamObservations);
} }
} }

@ -18,13 +18,13 @@ import java.util.Objects;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
public class Observation { public class Observation {
private final MetricCategory category; private final PantheonMetricCategory category;
private final String metricName; private final String metricName;
private final List<String> labels; private final List<String> labels;
private final Object value; private final Object value;
public Observation( public Observation(
final MetricCategory category, final PantheonMetricCategory category,
final String metricName, final String metricName,
final Object value, final Object value,
final List<String> labels) { final List<String> labels) {
@ -34,7 +34,7 @@ public class Observation {
this.labels = labels; this.labels = labels;
} }
public MetricCategory getCategory() { public PantheonMetricCategory getCategory() {
return category; return category;
} }

@ -15,7 +15,7 @@ package tech.pegasys.pantheon.metrics;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
public enum MetricCategory { public enum PantheonMetricCategory {
BIG_QUEUE("big_queue"), BIG_QUEUE("big_queue"),
BLOCKCHAIN("blockchain"), BLOCKCHAIN("blockchain"),
EXECUTORS("executors"), EXECUTORS("executors"),
@ -31,17 +31,17 @@ public enum MetricCategory {
TRANSACTION_POOL("transaction_pool"); TRANSACTION_POOL("transaction_pool");
// Why not BIG_QUEUE and ROCKSDB? They hurt performance under load. // Why not BIG_QUEUE and ROCKSDB? They hurt performance under load.
public static final Set<MetricCategory> DEFAULT_METRIC_CATEGORIES = public static final Set<PantheonMetricCategory> DEFAULT_METRIC_CATEGORIES =
EnumSet.complementOf(EnumSet.of(BIG_QUEUE, KVSTORE_ROCKSDB, KVSTORE_ROCKSDB_STATS)); EnumSet.complementOf(EnumSet.of(BIG_QUEUE, KVSTORE_ROCKSDB, KVSTORE_ROCKSDB_STATS));
private final String name; private final String name;
private final boolean pantheonSpecific; private final boolean pantheonSpecific;
MetricCategory(final String name) { PantheonMetricCategory(final String name) {
this(name, true); this(name, true);
} }
MetricCategory(final String name, final boolean pantheonSpecific) { PantheonMetricCategory(final String name, final boolean pantheonSpecific) {
this.name = name; this.name = name;
this.pantheonSpecific = pantheonSpecific; this.pantheonSpecific = pantheonSpecific;
} }

@ -14,11 +14,11 @@ package tech.pegasys.pantheon.metrics.noop;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.Observation; import tech.pegasys.pantheon.metrics.Observation;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.OperationTimer.TimingContext; import tech.pegasys.pantheon.metrics.OperationTimer.TimingContext;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.function.DoubleSupplier; import java.util.function.DoubleSupplier;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -42,7 +42,7 @@ public class NoOpMetricsSystem implements MetricsSystem {
@Override @Override
public LabelledMetric<Counter> createLabelledCounter( public LabelledMetric<Counter> createLabelledCounter(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final String... labelNames) { final String... labelNames) {
@ -64,7 +64,7 @@ public class NoOpMetricsSystem implements MetricsSystem {
@Override @Override
public LabelledMetric<OperationTimer> createLabelledTimer( public LabelledMetric<OperationTimer> createLabelledTimer(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final String... labelNames) { final String... labelNames) {
@ -82,13 +82,13 @@ public class NoOpMetricsSystem implements MetricsSystem {
@Override @Override
public void createGauge( public void createGauge(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final DoubleSupplier valueSupplier) {} final DoubleSupplier valueSupplier) {}
@Override @Override
public Stream<Observation> streamObservations(final MetricCategory category) { public Stream<Observation> streamObservations(final PantheonMetricCategory category) {
return Stream.empty(); return Stream.empty();
} }

@ -12,9 +12,9 @@
*/ */
package tech.pegasys.pantheon.metrics.prometheus; package tech.pegasys.pantheon.metrics.prometheus;
import static tech.pegasys.pantheon.metrics.MetricCategory.DEFAULT_METRIC_CATEGORIES; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.DEFAULT_METRIC_CATEGORIES;
import tech.pegasys.pantheon.metrics.MetricCategory; import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
@ -35,7 +35,7 @@ public class MetricsConfiguration {
private final boolean enabled; private final boolean enabled;
private final int port; private final int port;
private final String host; private final String host;
private final Set<MetricCategory> metricCategories; private final Set<PantheonMetricCategory> metricCategories;
private final boolean pushEnabled; private final boolean pushEnabled;
private final int pushPort; private final int pushPort;
private final String pushHost; private final String pushHost;
@ -51,7 +51,7 @@ public class MetricsConfiguration {
final boolean enabled, final boolean enabled,
final int port, final int port,
final String host, final String host,
final Set<MetricCategory> metricCategories, final Set<PantheonMetricCategory> metricCategories,
final boolean pushEnabled, final boolean pushEnabled,
final int pushPort, final int pushPort,
final String pushHost, final String pushHost,
@ -82,7 +82,7 @@ public class MetricsConfiguration {
return host; return host;
} }
public Set<MetricCategory> getMetricCategories() { public Set<PantheonMetricCategory> getMetricCategories() {
return metricCategories; return metricCategories;
} }
@ -166,7 +166,7 @@ public class MetricsConfiguration {
private boolean enabled = false; private boolean enabled = false;
private int port = DEFAULT_METRICS_PORT; private int port = DEFAULT_METRICS_PORT;
private String host = DEFAULT_METRICS_HOST; private String host = DEFAULT_METRICS_HOST;
private Set<MetricCategory> metricCategories = DEFAULT_METRIC_CATEGORIES; private Set<PantheonMetricCategory> metricCategories = DEFAULT_METRIC_CATEGORIES;
private boolean pushEnabled = false; private boolean pushEnabled = false;
private int pushPort = DEFAULT_METRICS_PUSH_PORT; private int pushPort = DEFAULT_METRICS_PUSH_PORT;
private String pushHost = DEFAULT_METRICS_PUSH_HOST; private String pushHost = DEFAULT_METRICS_PUSH_HOST;
@ -191,7 +191,7 @@ public class MetricsConfiguration {
return this; return this;
} }
public Builder metricCategories(final Set<MetricCategory> metricCategories) { public Builder metricCategories(final Set<PantheonMetricCategory> metricCategories) {
this.metricCategories = metricCategories; this.metricCategories = metricCategories;
return this; return this;
} }

@ -16,10 +16,10 @@ import static java.util.Arrays.asList;
import static java.util.Collections.singleton; import static java.util.Collections.singleton;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.Observation; import tech.pegasys.pantheon.metrics.Observation;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem; import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem;
import java.util.ArrayList; import java.util.ArrayList;
@ -49,14 +49,16 @@ import io.prometheus.client.hotspot.ThreadExports;
public class PrometheusMetricsSystem implements MetricsSystem { public class PrometheusMetricsSystem implements MetricsSystem {
private static final String PANTHEON_PREFIX = "pantheon_"; private static final String PANTHEON_PREFIX = "pantheon_";
private final Map<MetricCategory, Collection<Collector>> collectors = new ConcurrentHashMap<>(); private final Map<PantheonMetricCategory, Collection<Collector>> collectors =
new ConcurrentHashMap<>();
private final CollectorRegistry registry = new CollectorRegistry(true); private final CollectorRegistry registry = new CollectorRegistry(true);
private final Map<String, LabelledMetric<tech.pegasys.pantheon.metrics.Counter>> cachedCounters = private final Map<String, LabelledMetric<tech.pegasys.pantheon.metrics.Counter>> cachedCounters =
new ConcurrentHashMap<>(); new ConcurrentHashMap<>();
private final Map<String, LabelledMetric<tech.pegasys.pantheon.metrics.OperationTimer>> private final Map<String, LabelledMetric<tech.pegasys.pantheon.metrics.OperationTimer>>
cachedTimers = new ConcurrentHashMap<>(); cachedTimers = new ConcurrentHashMap<>();
private final EnumSet<MetricCategory> enabledCategories = EnumSet.allOf(MetricCategory.class); private final EnumSet<PantheonMetricCategory> enabledCategories =
EnumSet.allOf(PantheonMetricCategory.class);
PrometheusMetricsSystem() {} PrometheusMetricsSystem() {}
@ -66,14 +68,14 @@ public class PrometheusMetricsSystem implements MetricsSystem {
} }
final PrometheusMetricsSystem metricsSystem = new PrometheusMetricsSystem(); final PrometheusMetricsSystem metricsSystem = new PrometheusMetricsSystem();
metricsSystem.enabledCategories.retainAll(metricsConfiguration.getMetricCategories()); metricsSystem.enabledCategories.retainAll(metricsConfiguration.getMetricCategories());
if (metricsSystem.enabledCategories.contains(MetricCategory.PROCESS)) { if (metricsSystem.enabledCategories.contains(PantheonMetricCategory.PROCESS)) {
metricsSystem.collectors.put( metricsSystem.collectors.put(
MetricCategory.PROCESS, PantheonMetricCategory.PROCESS,
singleton(new StandardExports().register(metricsSystem.registry))); singleton(new StandardExports().register(metricsSystem.registry)));
} }
if (metricsSystem.enabledCategories.contains(MetricCategory.JVM)) { if (metricsSystem.enabledCategories.contains(PantheonMetricCategory.JVM)) {
metricsSystem.collectors.put( metricsSystem.collectors.put(
MetricCategory.JVM, PantheonMetricCategory.JVM,
asList( asList(
new MemoryPoolsExports().register(metricsSystem.registry), new MemoryPoolsExports().register(metricsSystem.registry),
new BufferPoolsExports().register(metricsSystem.registry), new BufferPoolsExports().register(metricsSystem.registry),
@ -86,7 +88,7 @@ public class PrometheusMetricsSystem implements MetricsSystem {
@Override @Override
public LabelledMetric<tech.pegasys.pantheon.metrics.Counter> createLabelledCounter( public LabelledMetric<tech.pegasys.pantheon.metrics.Counter> createLabelledCounter(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final String... labelNames) { final String... labelNames) {
@ -106,7 +108,7 @@ public class PrometheusMetricsSystem implements MetricsSystem {
@Override @Override
public LabelledMetric<OperationTimer> createLabelledTimer( public LabelledMetric<OperationTimer> createLabelledTimer(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final String... labelNames) { final String... labelNames) {
@ -135,7 +137,7 @@ public class PrometheusMetricsSystem implements MetricsSystem {
@Override @Override
public void createGauge( public void createGauge(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final DoubleSupplier valueSupplier) { final DoubleSupplier valueSupplier) {
@ -146,13 +148,14 @@ public class PrometheusMetricsSystem implements MetricsSystem {
} }
} }
public void addCollector(final MetricCategory category, final Collector metric) { public void addCollector(final PantheonMetricCategory category, final Collector metric) {
if (enabledCategories.contains(category)) { if (enabledCategories.contains(category)) {
addCollectorUnchecked(category, metric); addCollectorUnchecked(category, metric);
} }
} }
private void addCollectorUnchecked(final MetricCategory category, final Collector metric) { private void addCollectorUnchecked(
final PantheonMetricCategory category, final Collector metric) {
metric.register(registry); metric.register(registry);
collectors collectors
.computeIfAbsent(category, key -> Collections.newSetFromMap(new ConcurrentHashMap<>())) .computeIfAbsent(category, key -> Collections.newSetFromMap(new ConcurrentHashMap<>()))
@ -160,20 +163,22 @@ public class PrometheusMetricsSystem implements MetricsSystem {
} }
@Override @Override
public Stream<Observation> streamObservations(final MetricCategory category) { public Stream<Observation> streamObservations(final PantheonMetricCategory category) {
return collectors.getOrDefault(category, Collections.emptySet()).stream() return collectors.getOrDefault(category, Collections.emptySet()).stream()
.flatMap(collector -> collector.collect().stream()) .flatMap(collector -> collector.collect().stream())
.flatMap(familySamples -> convertSamplesToObservations(category, familySamples)); .flatMap(familySamples -> convertSamplesToObservations(category, familySamples));
} }
private Stream<Observation> convertSamplesToObservations( private Stream<Observation> convertSamplesToObservations(
final MetricCategory category, final MetricFamilySamples familySamples) { final PantheonMetricCategory category, final MetricFamilySamples familySamples) {
return familySamples.samples.stream() return familySamples.samples.stream()
.map(sample -> createObservationFromSample(category, sample, familySamples)); .map(sample -> createObservationFromSample(category, sample, familySamples));
} }
private Observation createObservationFromSample( private Observation createObservationFromSample(
final MetricCategory category, final Sample sample, final MetricFamilySamples familySamples) { final PantheonMetricCategory category,
final Sample sample,
final MetricFamilySamples familySamples) {
if (familySamples.type == Type.HISTOGRAM) { if (familySamples.type == Type.HISTOGRAM) {
return convertHistogramSampleNamesToLabels(category, sample, familySamples); return convertHistogramSampleNamesToLabels(category, sample, familySamples);
} }
@ -188,7 +193,9 @@ public class PrometheusMetricsSystem implements MetricsSystem {
} }
private Observation convertHistogramSampleNamesToLabels( private Observation convertHistogramSampleNamesToLabels(
final MetricCategory category, final Sample sample, final MetricFamilySamples familySamples) { final PantheonMetricCategory category,
final Sample sample,
final MetricFamilySamples familySamples) {
final List<String> labelValues = new ArrayList<>(sample.labelValues); final List<String> labelValues = new ArrayList<>(sample.labelValues);
if (sample.name.endsWith("_bucket")) { if (sample.name.endsWith("_bucket")) {
labelValues.add(labelValues.size() - 1, "bucket"); labelValues.add(labelValues.size() - 1, "bucket");
@ -203,7 +210,9 @@ public class PrometheusMetricsSystem implements MetricsSystem {
} }
private Observation convertSummarySampleNamesToLabels( private Observation convertSummarySampleNamesToLabels(
final MetricCategory category, final Sample sample, final MetricFamilySamples familySamples) { final PantheonMetricCategory category,
final Sample sample,
final MetricFamilySamples familySamples) {
final List<String> labelValues = new ArrayList<>(sample.labelValues); final List<String> labelValues = new ArrayList<>(sample.labelValues);
if (sample.name.endsWith("_sum")) { if (sample.name.endsWith("_sum")) {
labelValues.add("sum"); labelValues.add("sum");
@ -219,16 +228,18 @@ public class PrometheusMetricsSystem implements MetricsSystem {
labelValues); labelValues);
} }
public static String convertToPrometheusName(final MetricCategory category, final String name) { public static String convertToPrometheusName(
final PantheonMetricCategory category, final String name) {
return prometheusPrefix(category) + name; return prometheusPrefix(category) + name;
} }
private String convertFromPrometheusName(final MetricCategory category, final String metricName) { private String convertFromPrometheusName(
final PantheonMetricCategory category, final String metricName) {
final String prefix = prometheusPrefix(category); final String prefix = prometheusPrefix(category);
return metricName.startsWith(prefix) ? metricName.substring(prefix.length()) : metricName; return metricName.startsWith(prefix) ? metricName.substring(prefix.length()) : metricName;
} }
private static String prometheusPrefix(final MetricCategory category) { private static String prometheusPrefix(final PantheonMetricCategory category) {
return category.isPantheonSpecific() return category.isPantheonSpecific()
? PANTHEON_PREFIX + category.getName() + "_" ? PANTHEON_PREFIX + category.getName() + "_"
: category.getName() + "_"; : category.getName() + "_";

@ -13,8 +13,8 @@
package tech.pegasys.pantheon.metrics.vertx; package tech.pegasys.pantheon.metrics.vertx;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import io.vertx.core.spi.metrics.PoolMetrics; import io.vertx.core.spi.metrics.PoolMetrics;
@ -29,7 +29,7 @@ final class PoolMetricsAdapter implements PoolMetrics<Object> {
submittedCounter = submittedCounter =
metricsSystem metricsSystem
.createLabelledCounter( .createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"vertx_worker_pool_submitted_total", "vertx_worker_pool_submitted_total",
"Total number of tasks submitted to the Vertx worker pool", "Total number of tasks submitted to the Vertx worker pool",
"poolType", "poolType",
@ -39,7 +39,7 @@ final class PoolMetricsAdapter implements PoolMetrics<Object> {
completedCounter = completedCounter =
metricsSystem metricsSystem
.createLabelledCounter( .createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"vertx_worker_pool_completed_total", "vertx_worker_pool_completed_total",
"Total number of tasks completed by the Vertx worker pool", "Total number of tasks completed by the Vertx worker pool",
"poolType", "poolType",
@ -49,7 +49,7 @@ final class PoolMetricsAdapter implements PoolMetrics<Object> {
rejectedCounter = rejectedCounter =
metricsSystem metricsSystem
.createLabelledCounter( .createLabelledCounter(
MetricCategory.NETWORK, PantheonMetricCategory.NETWORK,
"vertx_worker_pool_rejected_total", "vertx_worker_pool_rejected_total",
"Total number of tasks rejected by the Vertx worker pool", "Total number of tasks rejected by the Vertx worker pool",
"poolType", "poolType",

@ -29,7 +29,7 @@ public class StubMetricsSystem implements MetricsSystem {
@Override @Override
public LabelledMetric<Counter> createLabelledCounter( public LabelledMetric<Counter> createLabelledCounter(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final String... labelNames) { final String... labelNames) {
@ -50,7 +50,7 @@ public class StubMetricsSystem implements MetricsSystem {
@Override @Override
public LabelledMetric<OperationTimer> createLabelledTimer( public LabelledMetric<OperationTimer> createLabelledTimer(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final String... labelNames) { final String... labelNames) {
@ -59,7 +59,7 @@ public class StubMetricsSystem implements MetricsSystem {
@Override @Override
public void createGauge( public void createGauge(
final MetricCategory category, final PantheonMetricCategory category,
final String name, final String name,
final String help, final String help,
final DoubleSupplier valueSupplier) { final DoubleSupplier valueSupplier) {
@ -75,7 +75,7 @@ public class StubMetricsSystem implements MetricsSystem {
} }
@Override @Override
public Stream<Observation> streamObservations(final MetricCategory category) { public Stream<Observation> streamObservations(final PantheonMetricCategory category) {
throw new UnsupportedOperationException("Observations aren't actually recorded"); throw new UnsupportedOperationException("Observations aren't actually recorded");
} }

@ -17,9 +17,9 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import org.junit.Test; import org.junit.Test;
@ -30,7 +30,8 @@ public class NoOpMetricsSystemTest {
@Test @Test
public void labelCountsMatchOnCounter() { public void labelCountsMatchOnCounter() {
final LabelledMetric<Counter> labeledCounter = final LabelledMetric<Counter> labeledCounter =
metricsSystem.createLabelledCounter(MetricCategory.PROCESS, "name", "help", "label1"); metricsSystem.createLabelledCounter(
PantheonMetricCategory.PROCESS, "name", "help", "label1");
assertThat(labeledCounter.labels("one")).isSameAs(NoOpMetricsSystem.NO_OP_COUNTER); assertThat(labeledCounter.labels("one")).isSameAs(NoOpMetricsSystem.NO_OP_COUNTER);
} }
@ -38,7 +39,7 @@ public class NoOpMetricsSystemTest {
public void failsWheLabelCountsDoNotMatchOnCounter() { public void failsWheLabelCountsDoNotMatchOnCounter() {
final LabelledMetric<Counter> labeledCounter = final LabelledMetric<Counter> labeledCounter =
metricsSystem.createLabelledCounter( metricsSystem.createLabelledCounter(
MetricCategory.PROCESS, "name", "help", "label1", "label2"); PantheonMetricCategory.PROCESS, "name", "help", "label1", "label2");
assertThatExceptionOfType(IllegalArgumentException.class) assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> labeledCounter.labels("one")) .isThrownBy(() -> labeledCounter.labels("one"))
@ -51,7 +52,7 @@ public class NoOpMetricsSystemTest {
@Test @Test
public void labelCountsMatchOnTimer() { public void labelCountsMatchOnTimer() {
final LabelledMetric<OperationTimer> labeledTimer = final LabelledMetric<OperationTimer> labeledTimer =
metricsSystem.createLabelledTimer(MetricCategory.PROCESS, "name", "help", "label1"); metricsSystem.createLabelledTimer(PantheonMetricCategory.PROCESS, "name", "help", "label1");
assertThat(labeledTimer.labels("one")).isSameAs(NoOpMetricsSystem.NO_OP_OPERATION_TIMER); assertThat(labeledTimer.labels("one")).isSameAs(NoOpMetricsSystem.NO_OP_OPERATION_TIMER);
} }
@ -59,7 +60,7 @@ public class NoOpMetricsSystemTest {
public void failsWheLabelCountsDoNotMatchOnTimer() { public void failsWheLabelCountsDoNotMatchOnTimer() {
final LabelledMetric<OperationTimer> labeledTimer = final LabelledMetric<OperationTimer> labeledTimer =
metricsSystem.createLabelledTimer( metricsSystem.createLabelledTimer(
MetricCategory.PROCESS, "name", "help", "label1", "label2"); PantheonMetricCategory.PROCESS, "name", "help", "label1", "label2");
assertThatExceptionOfType(IllegalArgumentException.class) assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> labeledTimer.labels("one")) .isThrownBy(() -> labeledTimer.labels("one"))

@ -17,18 +17,18 @@ import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static tech.pegasys.pantheon.metrics.MetricCategory.JVM; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.JVM;
import static tech.pegasys.pantheon.metrics.MetricCategory.NETWORK; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.NETWORK;
import static tech.pegasys.pantheon.metrics.MetricCategory.PEERS; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.PEERS;
import static tech.pegasys.pantheon.metrics.MetricCategory.RPC; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.RPC;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.LabelledMetric; import tech.pegasys.pantheon.metrics.LabelledMetric;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.Observation; import tech.pegasys.pantheon.metrics.Observation;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.OperationTimer.TimingContext; import tech.pegasys.pantheon.metrics.OperationTimer.TimingContext;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem; import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem;
import java.util.Comparator; import java.util.Comparator;
@ -175,7 +175,7 @@ public class PrometheusMetricsSystemTest {
public void shouldOnlyObserveEnabledMetrics() { public void shouldOnlyObserveEnabledMetrics() {
final MetricsConfiguration metricsConfiguration = final MetricsConfiguration metricsConfiguration =
MetricsConfiguration.builder() MetricsConfiguration.builder()
.metricCategories(EnumSet.of(MetricCategory.RPC)) .metricCategories(EnumSet.of(PantheonMetricCategory.RPC))
.enabled(true) .enabled(true)
.build(); .build();
final MetricsSystem localMetricSystem = PrometheusMetricsSystem.init(metricsConfiguration); final MetricsSystem localMetricSystem = PrometheusMetricsSystem.init(metricsConfiguration);

@ -12,7 +12,7 @@
*/ */
package tech.pegasys.pantheon.metrics.rocksdb; package tech.pegasys.pantheon.metrics.rocksdb;
import static tech.pegasys.pantheon.metrics.MetricCategory.KVSTORE_ROCKSDB_STATS; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.KVSTORE_ROCKSDB_STATS;
import tech.pegasys.pantheon.metrics.prometheus.PrometheusMetricsSystem; import tech.pegasys.pantheon.metrics.prometheus.PrometheusMetricsSystem;

@ -24,7 +24,7 @@ import static tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration.DEFAUL
import static tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration.DEFAULT_JSON_RPC_PORT; import static tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration.DEFAULT_JSON_RPC_PORT;
import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.DEFAULT_JSON_RPC_APIS; import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.DEFAULT_JSON_RPC_APIS;
import static tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration.DEFAULT_WEBSOCKET_PORT; import static tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration.DEFAULT_WEBSOCKET_PORT;
import static tech.pegasys.pantheon.metrics.MetricCategory.DEFAULT_METRIC_CATEGORIES; import static tech.pegasys.pantheon.metrics.PantheonMetricCategory.DEFAULT_METRIC_CATEGORIES;
import static tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration.DEFAULT_METRICS_PORT; import static tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration.DEFAULT_METRICS_PORT;
import static tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration.DEFAULT_METRICS_PUSH_PORT; import static tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration.DEFAULT_METRICS_PUSH_PORT;
@ -61,8 +61,8 @@ import tech.pegasys.pantheon.ethereum.permissioning.LocalPermissioningConfigurat
import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfiguration; import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfiguration;
import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfigurationBuilder; import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfigurationBuilder;
import tech.pegasys.pantheon.ethereum.permissioning.SmartContractPermissioningConfiguration; import tech.pegasys.pantheon.ethereum.permissioning.SmartContractPermissioningConfiguration;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration; import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration;
import tech.pegasys.pantheon.metrics.prometheus.PrometheusMetricsSystem; import tech.pegasys.pantheon.metrics.prometheus.PrometheusMetricsSystem;
import tech.pegasys.pantheon.metrics.vertx.VertxMetricsAdapterFactory; import tech.pegasys.pantheon.metrics.vertx.VertxMetricsAdapterFactory;
@ -412,7 +412,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
arity = "1..*", arity = "1..*",
description = description =
"Comma separated list of categories to track metrics for (default: ${DEFAULT-VALUE})") "Comma separated list of categories to track metrics for (default: ${DEFAULT-VALUE})")
private final Set<MetricCategory> metricCategories = DEFAULT_METRIC_CATEGORIES; private final Set<PantheonMetricCategory> metricCategories = DEFAULT_METRIC_CATEGORIES;
@Option( @Option(
names = {"--metrics-push-enabled"}, names = {"--metrics-push-enabled"},

@ -49,7 +49,7 @@ import tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL;
import tech.pegasys.pantheon.ethereum.permissioning.LocalPermissioningConfiguration; import tech.pegasys.pantheon.ethereum.permissioning.LocalPermissioningConfiguration;
import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfiguration; import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfiguration;
import tech.pegasys.pantheon.ethereum.permissioning.SmartContractPermissioningConfiguration; import tech.pegasys.pantheon.ethereum.permissioning.SmartContractPermissioningConfiguration;
import tech.pegasys.pantheon.metrics.MetricCategory; import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration; import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
@ -2054,13 +2054,13 @@ public class PantheonCommandTest extends CommandTestAbstract {
@Test @Test
public void metricsCategoryPropertyMustBeUsed() { public void metricsCategoryPropertyMustBeUsed() {
parseCommand("--metrics-enabled", "--metrics-category", MetricCategory.JVM.toString()); parseCommand("--metrics-enabled", "--metrics-category", PantheonMetricCategory.JVM.toString());
verify(mockRunnerBuilder).metricsConfiguration(metricsConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).metricsConfiguration(metricsConfigArgumentCaptor.capture());
verify(mockRunnerBuilder).build(); verify(mockRunnerBuilder).build();
assertThat(metricsConfigArgumentCaptor.getValue().getMetricCategories()) assertThat(metricsConfigArgumentCaptor.getValue().getMetricCategories())
.containsExactly(MetricCategory.JVM); .containsExactly(PantheonMetricCategory.JVM);
assertThat(commandOutput.toString()).isEmpty(); assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty();

@ -13,9 +13,9 @@
package tech.pegasys.pantheon.services.kvstore; package tech.pegasys.pantheon.services.kvstore;
import tech.pegasys.pantheon.metrics.Counter; import tech.pegasys.pantheon.metrics.Counter;
import tech.pegasys.pantheon.metrics.MetricCategory;
import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.MetricsSystem;
import tech.pegasys.pantheon.metrics.OperationTimer; import tech.pegasys.pantheon.metrics.OperationTimer;
import tech.pegasys.pantheon.metrics.PantheonMetricCategory;
import tech.pegasys.pantheon.metrics.prometheus.PrometheusMetricsSystem; import tech.pegasys.pantheon.metrics.prometheus.PrometheusMetricsSystem;
import tech.pegasys.pantheon.metrics.rocksdb.RocksDBStats; import tech.pegasys.pantheon.metrics.rocksdb.RocksDBStats;
import tech.pegasys.pantheon.services.util.RocksDbUtil; import tech.pegasys.pantheon.services.util.RocksDbUtil;
@ -76,7 +76,7 @@ public class RocksDbKeyValueStorage implements KeyValueStorage, Closeable {
readLatency = readLatency =
metricsSystem metricsSystem
.createLabelledTimer( .createLabelledTimer(
MetricCategory.KVSTORE_ROCKSDB, PantheonMetricCategory.KVSTORE_ROCKSDB,
"read_latency_seconds", "read_latency_seconds",
"Latency for read from RocksDB.", "Latency for read from RocksDB.",
"database") "database")
@ -84,7 +84,7 @@ public class RocksDbKeyValueStorage implements KeyValueStorage, Closeable {
removeLatency = removeLatency =
metricsSystem metricsSystem
.createLabelledTimer( .createLabelledTimer(
MetricCategory.KVSTORE_ROCKSDB, PantheonMetricCategory.KVSTORE_ROCKSDB,
"remove_latency_seconds", "remove_latency_seconds",
"Latency of remove requests from RocksDB.", "Latency of remove requests from RocksDB.",
"database") "database")
@ -92,7 +92,7 @@ public class RocksDbKeyValueStorage implements KeyValueStorage, Closeable {
writeLatency = writeLatency =
metricsSystem metricsSystem
.createLabelledTimer( .createLabelledTimer(
MetricCategory.KVSTORE_ROCKSDB, PantheonMetricCategory.KVSTORE_ROCKSDB,
"write_latency_seconds", "write_latency_seconds",
"Latency for write to RocksDB.", "Latency for write to RocksDB.",
"database") "database")
@ -100,7 +100,7 @@ public class RocksDbKeyValueStorage implements KeyValueStorage, Closeable {
commitLatency = commitLatency =
metricsSystem metricsSystem
.createLabelledTimer( .createLabelledTimer(
MetricCategory.KVSTORE_ROCKSDB, PantheonMetricCategory.KVSTORE_ROCKSDB,
"commit_latency_seconds", "commit_latency_seconds",
"Latency for commits to RocksDB.", "Latency for commits to RocksDB.",
"database") "database")
@ -111,7 +111,7 @@ public class RocksDbKeyValueStorage implements KeyValueStorage, Closeable {
} }
metricsSystem.createLongGauge( metricsSystem.createLongGauge(
MetricCategory.KVSTORE_ROCKSDB, PantheonMetricCategory.KVSTORE_ROCKSDB,
"rocks_db_table_readers_memory_bytes", "rocks_db_table_readers_memory_bytes",
"Estimated memory used for RocksDB index and filter blocks in bytes", "Estimated memory used for RocksDB index and filter blocks in bytes",
() -> { () -> {
@ -126,7 +126,7 @@ public class RocksDbKeyValueStorage implements KeyValueStorage, Closeable {
rollbackCount = rollbackCount =
metricsSystem metricsSystem
.createLabelledCounter( .createLabelledCounter(
MetricCategory.KVSTORE_ROCKSDB, PantheonMetricCategory.KVSTORE_ROCKSDB,
"rollback_count", "rollback_count",
"Number of RocksDB transactions rolled back.", "Number of RocksDB transactions rolled back.",
"database") "database")

Loading…
Cancel
Save