@Override public synchronized void connect() throws IllegalStateException, IOException { if (directService == null) { directService = new DataIngesterService(server, token); scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory(DEFAULT_SOURCE)); scheduler.scheduleAtFixedRate(this, 1, 1, TimeUnit.SECONDS); } }
@Override public synchronized void connect() throws IllegalStateException, IOException { if (directService == null) { directService = new DataIngesterService(server, token); scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory(DEFAULT_SOURCE)); scheduler.scheduleAtFixedRate(this, 1, 1, TimeUnit.SECONDS); } }
/** * Base constructor. * * @param entityType entity type that dictates the data processing flow. * @param handle handle (usually port number), that serves as an identifier for the metrics pipeline. * @param threadId thread number * @param itemsPerBatch max points per flush. * @param memoryBufferLimit max points in task's memory buffer before queueing. */ AbstractSenderTask(String entityType, String handle, int threadId, @Nullable final AtomicInteger itemsPerBatch, @Nullable final AtomicInteger memoryBufferLimit) { this.entityType = entityType; this.handle = handle; this.threadId = threadId; this.itemsPerBatch = itemsPerBatch == null ? new AtomicInteger(40000) : itemsPerBatch; this.memoryBufferLimit = memoryBufferLimit == null ? new AtomicInteger(32 * 40000) : memoryBufferLimit; this.scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("submitter-" + entityType + "-" + handle + "-" + String.valueOf(threadId))); this.flushExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.MINUTES, new SynchronousQueue<>(), new NamedThreadFactory("flush-" + entityType + "-" + handle + "-" + String.valueOf(threadId))); this.attemptedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "sent")); this.queuedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "queued")); this.blockedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "blocked")); this.receivedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "received")); this.bufferFlushCounter = Metrics.newCounter(new TaggedMetricName("buffer", "flush-count", "port", handle)); }
/** * Base constructor. * * @param entityType entity type that dictates the data processing flow. * @param handle handle (usually port number), that serves as an identifier for the metrics pipeline. * @param threadId thread number * @param itemsPerBatch max points per flush. * @param memoryBufferLimit max points in task's memory buffer before queueing. */ AbstractSenderTask(String entityType, String handle, int threadId, @Nullable final AtomicInteger itemsPerBatch, @Nullable final AtomicInteger memoryBufferLimit) { this.entityType = entityType; this.handle = handle; this.threadId = threadId; this.itemsPerBatch = itemsPerBatch == null ? new AtomicInteger(40000) : itemsPerBatch; this.memoryBufferLimit = memoryBufferLimit == null ? new AtomicInteger(32 * 40000) : memoryBufferLimit; this.scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("submitter-" + entityType + "-" + handle + "-" + String.valueOf(threadId))); this.flushExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.MINUTES, new SynchronousQueue<>(), new NamedThreadFactory("flush-" + entityType + "-" + handle + "-" + String.valueOf(threadId))); this.attemptedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "sent")); this.queuedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "queued")); this.blockedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "blocked")); this.receivedCounter = Metrics.newCounter(new MetricName(entityType + "." + handle, "", "received")); this.bufferFlushCounter = Metrics.newCounter(new TaggedMetricName("buffer", "flush-count", "port", handle)); }
public PostPushDataTimedTask(String pushFormat, ForceQueueEnabledAgentAPI agentAPI, UUID daemonId, String handle, int threadId, RecyclableRateLimiter pushRateLimiter, long pushFlushInterval) { this.pushFormat = pushFormat; this.daemonId = daemonId; this.handle = handle; this.threadId = threadId; this.pushFlushInterval = pushFlushInterval; this.agentAPI = agentAPI; this.pushRateLimiter = pushRateLimiter; this.scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("submitter-main-" + handle + "-" + String.valueOf(threadId))); this.flushExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.MINUTES, new SynchronousQueue<>(), new NamedThreadFactory("flush-" + handle + "-" + String.valueOf(threadId))); this.pointsAttempted = Metrics.newCounter(new MetricName("points." + handle, "", "sent")); this.pointsQueued = Metrics.newCounter(new MetricName("points." + handle, "", "queued")); this.pointsBlocked = Metrics.newCounter(new MetricName("points." + handle, "", "blocked")); this.pointsReceived = Metrics.newCounter(new MetricName("points." + handle, "", "received")); this.permitsGranted = Metrics.newCounter(new MetricName("limiter", "", "permits-granted")); this.permitsDenied = Metrics.newCounter(new MetricName("limiter", "", "permits-denied")); this.permitsRetried = Metrics.newCounter(new MetricName("limiter", "", "permits-retried")); this.batchesAttempted = Metrics.newCounter( new MetricName("push." + String.valueOf(handle) + ".thread-" + String.valueOf(threadId), "", "batches")); this.batchSendTime = Metrics.newTimer(new MetricName("push." + handle, "", "duration"), TimeUnit.MILLISECONDS, TimeUnit.MINUTES); this.bufferFlushCount = Metrics.newCounter(new MetricName("buffer", "", "flush-count")); this.scheduler.schedule(this, pushFlushInterval, TimeUnit.MILLISECONDS); }
if (activeHistogramAggregationTypes > 0) { /*Histograms enabled*/ histogramExecutor = Executors.newScheduledThreadPool(1 + activeHistogramAggregationTypes, new NamedThreadFactory("histogram-service")); histogramFlushExecutor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() / 2, new NamedThreadFactory("histogram-flush")); histogramScanExecutor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() / 2, new NamedThreadFactory("histogram-scan")); managedExecutors.add(histogramExecutor); managedExecutors.add(histogramFlushExecutor);
if (activeHistogramAggregationTypes > 0) { /*Histograms enabled*/ histogramExecutor = Executors.newScheduledThreadPool(1 + activeHistogramAggregationTypes, new NamedThreadFactory("histogram-service")); histogramFlushExecutor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() / 2, new NamedThreadFactory("histogram-flush")); histogramScanExecutor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() / 2, new NamedThreadFactory("histogram-scan")); managedExecutors.add(histogramExecutor); managedExecutors.add(histogramFlushExecutor);
public PostPushDataTimedTask(String pushFormat, ForceQueueEnabledAgentAPI agentAPI, UUID daemonId, String handle, int threadId, RecyclableRateLimiter pushRateLimiter, long pushFlushInterval) { this.pushFormat = pushFormat; this.daemonId = daemonId; this.handle = handle; this.threadId = threadId; this.pushFlushInterval = pushFlushInterval; this.agentAPI = agentAPI; this.pushRateLimiter = pushRateLimiter; this.scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("submitter-main-" + handle + "-" + String.valueOf(threadId))); this.flushExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.MINUTES, new SynchronousQueue<>(), new NamedThreadFactory("flush-" + handle + "-" + String.valueOf(threadId))); this.pointsAttempted = Metrics.newCounter(new MetricName("points." + handle, "", "sent")); this.pointsQueued = Metrics.newCounter(new MetricName("points." + handle, "", "queued")); this.pointsBlocked = Metrics.newCounter(new MetricName("points." + handle, "", "blocked")); this.pointsReceived = Metrics.newCounter(new MetricName("points." + handle, "", "received")); this.permitsGranted = Metrics.newCounter(new MetricName("limiter", "", "permits-granted")); this.permitsDenied = Metrics.newCounter(new MetricName("limiter", "", "permits-denied")); this.permitsRetried = Metrics.newCounter(new MetricName("limiter", "", "permits-retried")); this.batchesAttempted = Metrics.newCounter( new MetricName("push." + String.valueOf(handle) + ".thread-" + String.valueOf(threadId), "", "batches")); this.batchSendTime = Metrics.newTimer(new MetricName("push." + handle, "", "duration"), TimeUnit.MILLISECONDS, TimeUnit.MINUTES); this.bufferFlushCount = Metrics.newCounter(new MetricName("buffer", "", "flush-count")); this.scheduler.schedule(this, pushFlushInterval, TimeUnit.MILLISECONDS); }
new NamedThreadFactory("proxy-configuration")); private final ScheduledExecutorService queuedAgentExecutor = Executors.newScheduledThreadPool(retryThreads + 1, new NamedThreadFactory("submitter-queue")); protected UUID agentId; private final Runnable updateConfiguration = () -> {
new NamedThreadFactory("proxy-configuration")); private final ScheduledExecutorService queuedAgentExecutor = Executors.newScheduledThreadPool(retryThreads + 1, new NamedThreadFactory("submitter-queue")); protected UUID agentId; private final Runnable updateConfiguration = () -> {
this.discoveredHeartbeatMetrics = new ConcurrentHashMap<>(); this.scheduledExecutorService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("jaeger-heart-beater")); scheduledExecutorService.scheduleAtFixedRate(this, 1, 1, TimeUnit.MINUTES);
this.discoveredHeartbeatMetrics = new ConcurrentHashMap<>(); this.scheduledExecutorService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("zipkin-heart-beater")); scheduledExecutorService.scheduleAtFixedRate(this, 1, 1, TimeUnit.MINUTES);
public JaegerThriftCollectorHandler(String handle, ReportableEntityHandler<Span> spanHandler, @Nullable WavefrontSender wfSender, AtomicBoolean traceDisabled) { this.handle = handle; this.spanHandler = spanHandler; this.wfSender = wfSender; this.traceDisabled = traceDisabled; this.discardedTraces = Metrics.newCounter( new MetricName("spans." + handle, "", "discarded")); this.discardedBatches = Metrics.newCounter( new MetricName("spans." + handle + ".batches", "", "discarded")); this.processedBatches = Metrics.newCounter( new MetricName("spans." + handle + ".batches", "", "processed")); this.failedBatches = Metrics.newCounter( new MetricName("spans." + handle + ".batches", "", "failed")); this.discoveredHeartbeatMetrics = new ConcurrentHashMap<>(); this.scheduledExecutorService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("jaeger-heart-beater")); scheduledExecutorService.scheduleAtFixedRate(this, 1, 1, TimeUnit.MINUTES); if (wfSender != null) { wfInternalReporter = new WavefrontInternalReporter.Builder(). prefixedWith(TRACING_DERIVED_PREFIX).withSource(DEFAULT_SOURCE).reportMinuteDistribution(). build(wfSender); // Start the reporter wfInternalReporter.start(1, TimeUnit.MINUTES); } else { wfInternalReporter = null; } }
public ZipkinPortUnificationHandler(final String handle, ReportableEntityHandler<Span> spanHandler, @Nullable WavefrontSender wfSender, AtomicBoolean traceDisabled) { super(TokenAuthenticatorBuilder.create().setTokenValidationMethod(TokenValidationMethod.NONE).build(), handle, false, true); this.handle = handle; this.spanHandler = spanHandler; this.wfSender = wfSender; this.traceDisabled = traceDisabled; this.discardedBatches = Metrics.newCounter(new MetricName( "spans." + handle + ".batches", "", "discarded")); this.processedBatches = Metrics.newCounter(new MetricName( "spans." + handle + ".batches", "", "processed")); this.failedBatches = Metrics.newCounter(new MetricName( "spans." + handle + ".batches", "", "failed")); this.discoveredHeartbeatMetrics = new ConcurrentHashMap<>(); this.scheduledExecutorService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("zipkin-heart-beater")); scheduledExecutorService.scheduleAtFixedRate(this, 1, 1, TimeUnit.MINUTES); if (wfSender != null) { wfInternalReporter = new WavefrontInternalReporter.Builder(). prefixedWith("tracing.derived").withSource(DEFAULT_SOURCE).reportMinuteDistribution(). build(wfSender); // Start the reporter wfInternalReporter.start(1, TimeUnit.MINUTES); } else { wfInternalReporter = null; } }