/** * Convenient method to disable the metric collector at the AWS SDK * level. */ public static void disableMetrics() { setMetricCollector(MetricCollector.NONE); }
MetricCollector instance = f.getInstance(); if (instance != null) { setMetricCollector(instance); return true;
/** * Convenient method to disable the metric collector at the AWS SDK level. */ public static void disableMetrics() { setMetricCollector(MetricCollector.NONE); }
/** * Convenient method to disable the metric collector at the AWS SDK * level. */ public static void disableMetrics() { setMetricCollector(MetricCollector.NONE); }
MetricCollector instance = f.getInstance(); if (instance != null) { setMetricCollector(instance); return true;
/** * Starts the default AWS SDK metric collector, but only if no metric * collector is currently in use at the AWS SDK level. * * @return true if the default AWS SDK metric collector has been * successfully started by this call; false otherwise. */ public static synchronized boolean enableDefaultMetrics() { if (mc == null || !mc.isEnabled()) { if (dirtyEnabling) { throw new IllegalStateException("Reentrancy is not allowed"); } dirtyEnabling = true; try { Class<?> c = Class.forName(DEFAULT_METRIC_COLLECTOR_FACTORY); MetricCollector.Factory f = (MetricCollector.Factory) c.newInstance(); MetricCollector instance = f.getInstance(); if (instance != null) { setMetricCollector(instance); return true; } } catch (Exception e) { LogFactory.getLog(AwsSdkMetrics.class) .warn("Failed to enable the default metrics", e); } finally { dirtyEnabling = false; } } return false; }
/** * Convenient method to disable the metric collector at the AWS SDK level. */ public static void disableMetrics() { setMetricCollector(MetricCollector.NONE); }
/** * Convenient method to disable the metric collector at the AWS SDK * level. */ public static void disableMetrics() { setMetricCollector(MetricCollector.NONE); }
/** * Convenient method to disable the metric collector at the AWS SDK level. */ public static void disableMetrics() { setMetricCollector(MetricCollector.NONE); }
AwsSdkMetrics.setMetricCollector(MetricCollector.NONE); assertFalse(AwsSdkMetrics.isMetricsEnabled()); AwsSdkMetrics.setMetricCollector(new MetricCollector() { @Override public boolean start() {
@Bean @ConditionalOnProperty(value = "aws.metrics.enabled", matchIfMissing = true) SpectatorMetricCollector spectatorMetricsCollector(Registry registry) { SpectatorMetricCollector collector = new SpectatorMetricCollector(registry); AwsSdkMetrics.setMetricCollector(collector); return collector; } }
/** * Starts the default AWS SDK metric collector, but only if no metric * collector is currently in use at the AWS SDK level. * * @return true if the default AWS SDK metric collector has been * successfully started by this call; false otherwise. */ public static synchronized boolean enableDefaultMetrics() { if (mc == null || !mc.isEnabled()) { if (dirtyEnabling) { throw new IllegalStateException("Reentrancy is not allowed"); } dirtyEnabling = true; try { Class<?> c = Class.forName(DEFAULT_METRIC_COLLECTOR_FACTORY); MetricCollector.Factory f = (MetricCollector.Factory) c.newInstance(); MetricCollector instance = f.getInstance(); if (instance != null) { setMetricCollector(instance); return true; } } catch (Exception e) { LogFactory.getLog(AwsSdkMetrics.class) .warn("Failed to enable the default metrics", e); } finally { dirtyEnabling = false; } } return false; }
MetricCollector instance = f.getInstance(); if (instance != null) { setMetricCollector(instance); return true;
assertNull(actualType); AwsSdkMetrics.setMetricCollector(new MetricCollector() { @Override public boolean start() {
/** * Starts the default AWS SDK metric collector, but only if no metric * collector is currently in use at the AWS SDK level. * * @return true if the default AWS SDK metric collector has been * successfully started by this call; false otherwise. */ public static synchronized boolean enableDefaultMetrics() { if (mc == null || !mc.isEnabled()) { if (dirtyEnabling) { throw new IllegalStateException("Reentrancy is not allowed"); } dirtyEnabling = true; try { Class<?> c = Class.forName(DEFAULT_METRIC_COLLECTOR_FACTORY); MetricCollector.Factory f = (MetricCollector.Factory) c.newInstance(); MetricCollector instance = f.getInstance(); if (instance != null) { setMetricCollector(instance); return true; } } catch (Exception e) { LogFactory.getLog(AwsSdkMetrics.class) .warn("Failed to enable the default metrics", e); } finally { dirtyEnabling = false; } } return false; }