Add metrics related services to the Besu context for acceptance tests (#7797)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
pull/7779/merge
Fabio Di Fabio 1 month ago committed by GitHub
parent 76060a0416
commit b23fd78da2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java

@ -54,6 +54,7 @@ import org.hyperledger.besu.ethereum.trie.diffbased.bonsai.cache.BonsaiCachedMer
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.metrics.MetricCategoryRegistryImpl;
import org.hyperledger.besu.metrics.MetricsSystemModule;
import org.hyperledger.besu.metrics.ObservableMetricsSystem;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
@ -71,6 +72,7 @@ import org.hyperledger.besu.plugin.services.StorageService;
import org.hyperledger.besu.plugin.services.TransactionPoolValidatorService;
import org.hyperledger.besu.plugin.services.TransactionSelectionService;
import org.hyperledger.besu.plugin.services.TransactionSimulationService;
import org.hyperledger.besu.plugin.services.metrics.MetricCategoryRegistry;
import org.hyperledger.besu.plugin.services.storage.rocksdb.RocksDBPlugin;
import org.hyperledger.besu.services.BesuConfigurationImpl;
import org.hyperledger.besu.services.BesuEventsImpl;
@ -396,6 +398,12 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
retval.init(blockchain, transactionSimulator);
return retval;
}
@Provides
@Singleton
MetricCategoryRegistryImpl provideMetricCategoryRegistry() {
return new MetricCategoryRegistryImpl();
}
}
@Module
@ -476,6 +484,8 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
final RpcEndpointServiceImpl rpcEndpointServiceImpl,
final BesuConfiguration commonPluginConfiguration,
final PermissioningServiceImpl permissioningService,
final MetricCategoryRegistryImpl metricCategoryRegistry,
final MetricsSystem metricsSystem,
final @Named("ExtraCLIOptions") List<String> extraCLIOptions,
final @Named("RequestedPlugins") List<String> requestedPlugins) {
final CommandLine commandLine = new CommandLine(CommandSpec.create());
@ -492,6 +502,8 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
TransactionSimulationService.class, transactionSimulationServiceImpl);
besuPluginContext.addService(BlockchainService.class, blockchainServiceImpl);
besuPluginContext.addService(BesuConfiguration.class, commonPluginConfiguration);
besuPluginContext.addService(MetricCategoryRegistry.class, metricCategoryRegistry);
besuPluginContext.addService(MetricsSystem.class, metricsSystem);
final Path pluginsPath;
final String pluginDir = System.getProperty("besu.plugins.dir");

Loading…
Cancel
Save