protected ScheduledDropwizardReporter() { this.registry = new MetricRegistry(); }
public DropwizardRowIngestionMeters() { this.metricRegistry = new MetricRegistry(); this.processed = metricRegistry.meter(PROCESSED); this.processedWithError = metricRegistry.meter(PROCESSED_WITH_ERROR); this.unparseable = metricRegistry.meter(UNPARSEABLE); this.thrownAway = metricRegistry.meter(THROWN_AWAY); }
/** * Creates a timer of a default MetricRegistry * * @param name the name of the timer * @return a Timer instance */ static Timer of(String name) { return new TimerImpl(name, new MetricRegistry()); }
/** * 指定名字获取所属的实例。 * * @param name {@link MetricRegistry} 实例的名字。 * @return {@link MetricRegistry} 实例。 */ public static MetricRegistry getRegistryInstance(String name) { MetricRegistry instance = getRegistryCache.get(name); if (instance == null) { getRegistryCache.putIfAbsent(name, new MetricRegistry()); instance = getRegistryCache.get(name); } return instance; }
/** * 指定类类型和几个名字的关键词,依据 {@link MetricRegistry} 的名字生成规则获取所属的实例。 * * @param clazz 类的类型。 * @param names 关键字。 * @return {@link MetricRegistry} 实例。 */ public static MetricRegistry getRegistryInstance(Class<?> clazz, String... names) { final String key = MetricRegistry.name(clazz, names); MetricRegistry instance = getRegistryCache.get(key); if (instance == null) { getRegistryCache.putIfAbsent(key, new MetricRegistry()); instance = getRegistryCache.get(key); } return instance; }
/** * 指定几个名字的关键词,依据 {@link MetricRegistry} 的名字生成规则获取所属的实例。 * * @param name 关键字。 * @param names 剩余的关键字。 * @return {@link MetricRegistry} 实例。 */ public static MetricRegistry getRegistryInstance(String name, String... names) { final String key = MetricRegistry.name(name, names); MetricRegistry instance = getRegistryCache.get(key); if (instance == null) { getRegistryCache.putIfAbsent(key, new MetricRegistry()); instance = getRegistryCache.get(key); } return instance; }
public MetricRegistryProvider() { this.metricRegistry = new MetricRegistry(); metricRegistry.register("jvm.buffers", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); metricRegistry.register("jvm.cl", new ClassLoadingGaugeSet()); metricRegistry.register("jvm.gc", new GarbageCollectorMetricSet()); metricRegistry.register("jvm.memory", new MemoryUsageGaugeSet()); metricRegistry.register("jvm.threads", new ThreadStatesGaugeSet()); }
/** * Creates a new {@link Bootstrap} for the given application. * * @param application a Dropwizard {@link Application} */ public Bootstrap(Application<T> application) { this.application = application; this.objectMapper = Jackson.newObjectMapper(); this.configuredBundles = new ArrayList<>(); this.commands = new ArrayList<>(); this.validatorFactory = Validators.newValidatorFactory(); this.metricRegistry = new MetricRegistry(); this.configurationSourceProvider = new FileConfigurationSourceProvider(); this.classLoader = Thread.currentThread().getContextClassLoader(); this.configurationFactoryFactory = new DefaultConfigurationFactoryFactory<>(); this.healthCheckRegistry = new HealthCheckRegistry(); }
@Before public void setUp(){ metricRegistry = new MetricRegistry(); helloWorldService = mock(AsyncHelloWorldService.class); }
@Before public void setUp(){ metricRegistry = new MetricRegistry(); helloWorldService = mock(HelloWorldService.class); }
@Before public void setUp() { metricRegistry = new MetricRegistry(); helloWorldService = mock(HelloWorldService.class); executorService = Executors.newSingleThreadExecutor(); }
@Before public void setUp() { metricRegistry = new MetricRegistry(); helloWorldService = mock(HelloWorldService.class); }
@Before public void setUp(){ metricRegistry = new MetricRegistry(); helloWorldService = mock(HelloWorldService.class); }
/** * Creates a new {@link JvmSource} and register all JVM metrics. */ public JvmSource() { mMetricRegistry = new MetricRegistry(); mMetricRegistry.registerAll(new GarbageCollectorMetricSet()); mMetricRegistry.registerAll(new MemoryUsageGaugeSet()); }
@Before public void setUp(){ metricRegistry = new MetricRegistry(); timer = Timer.ofMetricRegistry(TimerTest.class.getName(), metricRegistry); helloWorldService = mock(HelloWorldService.class); }
CloseableLiquibase openLiquibase(final PooledDataSourceFactory dataSourceFactory, final Namespace namespace) throws SQLException, LiquibaseException { final CloseableLiquibase liquibase; final ManagedDataSource dataSource = dataSourceFactory.build(new MetricRegistry(), "liquibase"); final Database database = createDatabase(dataSource, namespace); final String migrationsFile = namespace.getString("migrations-file"); if (migrationsFile == null) { liquibase = new CloseableLiquibaseWithClassPathMigrationsFile(dataSource, database, migrationsFileName); } else { liquibase = new CloseableLiquibaseWithFileSystemMigrationsFile(dataSource, database, migrationsFile); } return liquibase; }
@Test public void testGetAzkabanURL() { final CommonMetrics commonMetrics = new CommonMetrics(new MetricsManager(new MetricRegistry())); final Emailer emailer = new Emailer(this.props, commonMetrics, this.messageCreator, this.executorLoader); assertThat(emailer.getAzkabanURL()).isEqualTo("http://localhost:8786"); }
@Before public void setUp() { final MetricRegistry metricRegistry = new MetricRegistry(); this.testUtil = new MetricsTestUtility(metricRegistry); this.metrics = new CommonMetrics(new MetricsManager(metricRegistry)); }
@Before public void setUp() { final MetricRegistry metricRegistry = new MetricRegistry(); this.testUtil = new MetricsTestUtility(metricRegistry); this.metrics = new WebMetrics(new MetricsManager(metricRegistry)); }
@Before public void setUp() { final MetricRegistry metricRegistry = new MetricRegistry(); this.testUtil = new MetricsTestUtility(metricRegistry); this.metrics = new DBMetrics(new MetricsManager(metricRegistry)); }