@OnScheduled public void setup(final ConfigurationContext context) throws IOException { final Map<String, ?> config = Collections.emptyMap(); factory = Json.createBuilderFactory(config); client = createClient(); virtualMachineMetrics = VirtualMachineMetrics.getInstance(); previousMetrics = null; }
/** * Performs setup operations when the processor is scheduled to run. This includes evaluating the processor's * properties, as well as reloading the script (from file or the "Script Body" property) * * @param context the context in which to perform the setup operations */ @OnScheduled public void setup(final ConfigurationContext context) { scriptingComponentHelper.setupVariables(context); // Create a script engine for each possible task scriptingComponentHelper.setup(1, getLogger()); scriptToRun = scriptingComponentHelper.getScriptBody(); try { String scriptPath = scriptingComponentHelper.getScriptPath(); if (scriptToRun == null && scriptPath != null) { try (final FileInputStream scriptStream = new FileInputStream(scriptPath)) { scriptToRun = IOUtils.toString(scriptStream, Charset.defaultCharset()); } } } catch (IOException ioe) { throw new ProcessException(ioe); } vmMetrics = VirtualMachineMetrics.getInstance(); }
final VirtualMachineMetrics virtualMachineMetrics = VirtualMachineMetrics.getInstance(); final Map<String, ?> config = Collections.emptyMap(); final JsonBuilderFactory factory = Json.createBuilderFactory(config);
@OnScheduled public void setup(final ConfigurationContext context) { metricsService = getMetricsService(); ddMetricRegistryBuilder = getMetricRegistryBuilder(); metricRegistry = getMetricRegistry(); metricsMap = getMetricsMap(); metricsPrefix = METRICS_PREFIX.getDefaultValue(); environment = ENVIRONMENT.getDefaultValue(); virtualMachineMetrics = VirtualMachineMetrics.getInstance(); ddMetricRegistryBuilder.setMetricRegistry(metricRegistry) .setTags(metricsService.getAllTagsList()); }
/** * Creates a new {@link DeadlockHealthCheck}. */ @SuppressWarnings("UnusedDeclaration") public DeadlockHealthCheck() { this(VirtualMachineMetrics.getInstance()); }
/** * Creates a new {@link GraphiteReporter}. * * @param metricsRegistry the metrics registry * @param prefix is prepended to all names reported to graphite * @param predicate filters metrics to be reported * @param socketProvider a {@link SocketProvider} instance * @param clock a {@link Clock} instance * @throws IOException if there is an error connecting to the Graphite server */ public GraphiteReporter(MetricsRegistry metricsRegistry, String prefix, MetricPredicate predicate, SocketProvider socketProvider, Clock clock) throws IOException { this(metricsRegistry, prefix, predicate, socketProvider, clock, VirtualMachineMetrics.getInstance()); }
/** * Creates a new {@link ThreadDumpServlet}. */ public ThreadDumpServlet() { this(VirtualMachineMetrics.getInstance()); }
public StatsDReporter(MetricsRegistry metricsRegistry, String prefix, MetricPredicate predicate, Clock clock, StatsD statsD) { this(metricsRegistry, prefix, predicate, clock, VirtualMachineMetrics.getInstance(), statsD); }
public BundleReporter(TaskDataOutput output, AutoField name, AutoField value, AutoField group, AutoField units, long period, TimeUnit periodUnit, MetricsRegistry metricsRegistry) { super(metricsRegistry, "bundle-reporter"); this.output = output; this.name = name; this.value = value; this.group = group; this.units = units; this.vm = VirtualMachineMetrics.getInstance(); this.period = periodUnit.toNanos(period); }
/** * Creates a new {@link MetricsServlet}. */ public MetricsServletShim() { this(Clock.defaultClock(), VirtualMachineMetrics.getInstance(), Metrics.defaultRegistry(), DEFAULT_JSON_FACTORY, true); }
/** * Creates a new {@link MetricsServlet}. */ public MetricsServlet() { this(Clock.defaultClock(), VirtualMachineMetrics.getInstance(), Metrics.defaultRegistry(), DEFAULT_JSON_FACTORY, true); }
/** * Creates a new {@link MetricsServlet}. * * @param showJvmMetrics whether or not JVM-level metrics will be included in the output */ public MetricsServlet(boolean showJvmMetrics) { this(Clock.defaultClock(), VirtualMachineMetrics.getInstance(), Metrics.defaultRegistry(), DEFAULT_JSON_FACTORY, showJvmMetrics); }
public DatadogReporter(MetricsRegistry registry, String apiKey, String host) { this(registry, MetricPredicate.ALL, VirtualMachineMetrics.getInstance(), new HttpTransport("app.datadoghq.com", apiKey), Clock.defaultClock(), host); }
@OnScheduled public void setup(final ConfigurationContext context) throws IOException { final Map<String, ?> config = Collections.emptyMap(); factory = Json.createBuilderFactory(config); client = createClient(); virtualMachineMetrics = VirtualMachineMetrics.getInstance(); previousMetrics = null; }
@Override public AdminServlet get() { for (HealthCheck healthCheck : healthChecks) { healthCheckRegistry.register(healthCheck); } final JsonFactory factory = jsonFactory == null ? new JsonFactory(new ObjectMapper()) : jsonFactory; return new AdminServlet(new HealthCheckServlet(healthCheckRegistry), new MetricsServlet(Clock.defaultClock(), VirtualMachineMetrics.getInstance(), metricsRegistry, factory, true), new PingServlet(), new ThreadDumpServlet(VirtualMachineMetrics.getInstance()), healthcheckUri, metricsUri, pingUri, threadsUri); } }
/** * Performs setup operations when the processor is scheduled to run. This includes evaluating the processor's * properties, as well as reloading the script (from file or the "Script Body" property) * * @param context the context in which to perform the setup operations */ @OnScheduled public void setup(final ConfigurationContext context) { scriptingComponentHelper.setupVariables(context); // Create a script engine for each possible task scriptingComponentHelper.setup(1, getLogger()); scriptToRun = scriptingComponentHelper.getScriptBody(); try { String scriptPath = scriptingComponentHelper.getScriptPath(); if (scriptToRun == null && scriptPath != null) { try (final FileInputStream scriptStream = new FileInputStream(scriptPath)) { scriptToRun = IOUtils.toString(scriptStream, Charset.defaultCharset()); } } } catch (IOException ioe) { throw new ProcessException(ioe); } vmMetrics = VirtualMachineMetrics.getInstance(); }
final VirtualMachineMetrics virtualMachineMetrics = VirtualMachineMetrics.getInstance(); final Map<String, ?> config = Collections.emptyMap(); final JsonBuilderFactory factory = Json.createBuilderFactory(config);