io.micrometer.jmx.JmxConfig Java Examples
The following examples show how to use
io.micrometer.jmx.JmxConfig.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VertxJmxMetricsOptions.java From vertx-micrometer-metrics with Apache License 2.0 | 6 votes |
/** * Convert these options to a Micrometer's {@code JmxConfig} object */ public JmxConfig toMicrometerConfig() { return new JmxConfig() { @Override public String get(String s) { return null; } @Override public String domain() { return domain; } @Override public Duration step() { return Duration.ofSeconds(step); } }; }
Example #2
Source File: SampleRegistries.java From micrometer with Apache License 2.0 | 5 votes |
public static JmxMeterRegistry jmx() { return new JmxMeterRegistry(new JmxConfig() { @Override public Duration step() { return Duration.ofSeconds(10); } @Override @Nullable public String get(String k) { return null; } }, Clock.SYSTEM); }
Example #3
Source File: MicroMeterMetricCollector.java From secor with Apache License 2.0 | 5 votes |
@Override public void initialize(SecorConfig config) { if (config.getMicroMeterCollectorStatsdEnabled()) { MeterRegistry statsdRegistry = new StatsdMeterRegistry(StatsdConfig.DEFAULT, Clock.SYSTEM); Metrics.addRegistry(statsdRegistry); } if (config.getMicroMeterCollectorJmxEnabled()) { MeterRegistry jmxRegistry = new JmxMeterRegistry(JmxConfig.DEFAULT, Clock.SYSTEM); Metrics.addRegistry(jmxRegistry); } }
Example #4
Source File: MetricsService.java From ari-proxy with GNU Affero General Public License v3.0 | 4 votes |
@Override public void preStart() throws Exception { super.preStart(); registry = new JmxMeterRegistry(JmxConfig.DEFAULT, Clock.SYSTEM); }
Example #5
Source File: MonitoringConfiguration.java From waggle-dance with Apache License 2.0 | 4 votes |
@Bean public JmxMeterRegistry jmxMeterRegistry() { return new JmxMeterRegistry(JmxConfig.DEFAULT, Clock.SYSTEM); }
Example #6
Source File: Main.java From blog-examples with Apache License 2.0 | 4 votes |
public static void main(String[] args) throws InterruptedException { MeterRegistry registry = new JmxMeterRegistry(new JmxConfig() { @Override public Duration step() { return Duration.ofSeconds(1); } @Override public String get(String s) { return null; } }, Clock.SYSTEM); Counter counter = Counter .builder("my.counter") .description("counts something important") .tag("environment", "test") .tag("region", "us-east") .register(registry); counter.increment(); counter.increment(2.5); Timer timer = Timer.builder("my.timer").register(registry); timer.record(() -> { System.out.println("sleeping"); try { Thread.sleep(550); } catch (InterruptedException e) { e.printStackTrace(); } }); timer.record(Duration.ofMillis(3)); // Wait some time before application exit // This gives some time to use JConsole to connect to the // application and inspect the metrics System.out.println("Keeping application alive"); Thread.sleep(240000); System.out.println("done"); }