/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { // Set up the metrics that are enabled regardless of instrumentation _watermarksInserted = _metricContext.meter(WATERMARKS_INSERTED_METER); _watermarksSwept = _metricContext.meter(WATERMARKS_SWEPT_METER); } }
/** * Get a {@link Meter} with the given name prefix and suffixes. * * @param prefix the given name prefix * @param suffixes the given name suffixes * @return a {@link Meter} with the given name prefix and suffixes */ public Meter getMeter(String prefix, String... suffixes) { return this.metricContext.meter(MetricRegistry.name(prefix, suffixes)); }
private synchronized void setRecordsWrittenMeter(boolean isInstrumentationEnabled) { if (isInstrumentationEnabled) { this.recordsWrittenMeter = Optional.of(this.metricContext.meter(MetricNames.DataWriterMetrics.RECORDS_WRITTEN_METER)); } else { this.recordsWrittenMeter = Optional.absent(); } }
private synchronized void setBytesWrittenMeter(boolean isInstrumentationEnabled) { if (isInstrumentationEnabled) { this.bytesWrittenMeter = Optional.of(this.metricContext.meter(MetricNames.DataWriterMetrics.BYTES_WRITTEN_METER)); } else { this.bytesWrittenMeter = Optional.absent(); } }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { if (isInstrumentationEnabled()) { this.datasetsCleanFailureMeter = Optional.of(this.metricContext.meter(DatasetCleanerMetrics.DATASETS_CLEAN_FAILURE)); this.datasetsCleanSuccessMeter = Optional.of(this.metricContext.meter(DatasetCleanerMetrics.DATASETS_CLEAN_SUCCESS)); } }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { // Set up the metrics that are enabled regardless of instrumentation this.recordsIn = this.metricContext.meter(MetricNames.DataWriterMetrics.RECORDS_IN_METER); this.recordsAttempted = this.metricContext.meter(MetricNames.DataWriterMetrics.RECORDS_ATTEMPTED_METER); this.recordsSuccess = this.metricContext.meter(MetricNames.DataWriterMetrics.SUCCESSFUL_WRITES_METER); this.recordsFailed = this.metricContext.meter(MetricNames.DataWriterMetrics.FAILED_WRITES_METER); this.bytesWritten = this.metricContext.meter(MetricNames.DataWriterMetrics.BYTES_WRITTEN_METER); if (isInstrumentationEnabled()) { this.dataWriterTimer = Optional.<Timer>of(this.metricContext.timer(MetricNames.DataWriterMetrics.WRITE_TIMER)); } else { this.dataWriterTimer = Optional.absent(); } }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { if (isInstrumentationEnabled()) { this.recordsInMeter = Optional.of(this.metricContext.meter(MetricNames.ConverterMetrics.RECORDS_IN_METER)); this.recordsOutMeter = Optional.of(this.metricContext.meter(MetricNames.ConverterMetrics.RECORDS_OUT_METER)); this.recordsExceptionMeter = Optional.of( this.metricContext.meter(MetricNames.ConverterMetrics.RECORDS_FAILED_METER)); this.converterTimer = Optional.<Timer>of(this.metricContext.timer(MetricNames.ConverterMetrics.CONVERT_TIMER)); } }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { if (isInstrumentationEnabled()) { this.inputMeter = Optional.of(this.metricContext.meter(MetricNames.ForkOperatorMetrics.RECORDS_IN_METER)); this.outputForks = Optional.of(this.metricContext.meter(MetricNames.ForkOperatorMetrics.FORKS_OUT_METER)); this.forkOperatorTimer = Optional.<Timer>of(this.metricContext.timer(MetricNames.ForkOperatorMetrics.FORK_TIMER)); } else { this.inputMeter = Optional.absent(); this.outputForks = Optional.absent(); this.forkOperatorTimer = Optional.absent(); } }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { if (isInstrumentationEnabled()) { this.readRecordsMeter = Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_READ_METER)); this.dataRecordExceptionsMeter = Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_FAILED_METER)); this.extractorTimer = Optional.<Timer>of(this.metricContext.timer(MetricNames.ExtractorMetrics.EXTRACT_TIMER)); } else { this.readRecordsMeter = Optional.absent(); this.dataRecordExceptionsMeter = Optional.absent(); this.extractorTimer = Optional.absent(); } }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { if(isInstrumentationEnabled()) { this.recordsMeter = Optional.of(this.metricContext.meter(MetricNames.RowLevelPolicyMetrics.RECORDS_IN_METER)); this.passedRecordsMeter = Optional.of( this.metricContext.meter(MetricNames.RowLevelPolicyMetrics.RECORDS_PASSED_METER)); this.failedRecordsMeter = Optional.of( this.metricContext.meter(MetricNames.RowLevelPolicyMetrics.RECORDS_FAILED_METER)); this.policyTimer = Optional.<Timer>of( this.metricContext.timer(MetricNames.RowLevelPolicyMetrics.CHECK_TIMER)); } else { this.recordsMeter = Optional.absent(); this.passedRecordsMeter = Optional.absent(); this.failedRecordsMeter = Optional.absent(); this.policyTimer = Optional.absent(); } }
/** User needs to provide eventhub properties */ public EventhubDataWriter(Properties properties) { PasswordManager manager = PasswordManager.getInstance(properties); namespaceName = properties.getProperty(BatchedEventhubDataWriter.EVH_NAMESPACE); eventHubName = properties.getProperty(BatchedEventhubDataWriter.EVH_HUBNAME); sasKeyName = properties.getProperty(BatchedEventhubDataWriter.EVH_SAS_KEYNAME); String encodedSasKey = properties.getProperty(BatchedEventhubDataWriter.EVH_SAS_KEYVALUE); sasKey = manager.readPassword(encodedSasKey); targetURI = "https://" + namespaceName + ".servicebus.windows.net/" + eventHubName + "/messages"; httpclient = HttpClients.createDefault(); metricContext = Instrumented.getMetricContext(new State(properties),EventhubDataWriter.class); recordsAttempted = this.metricContext.meter(EventhubMetricNames.EventhubDataWriterMetrics.RECORDS_ATTEMPTED_METER); recordsSuccess = this.metricContext.meter(EventhubMetricNames.EventhubDataWriterMetrics.RECORDS_SUCCESS_METER); recordsFailed = this.metricContext.meter(EventhubMetricNames.EventhubDataWriterMetrics.RECORDS_FAILED_METER); bytesWritten = this.metricContext.meter(EventhubMetricNames.EventhubDataWriterMetrics.BYTES_WRITTEN_METER); writeTimer = this.metricContext.timer(EventhubMetricNames.EventhubDataWriterMetrics.WRITE_TIMER); }
@Builder private RestliServiceBasedLimiter(String resourceLimited, String serviceIdentifier, MetricContext metricContext, RequestSender requestSender) { Preconditions.checkNotNull(requestSender, "Request sender cannot be null."); this.bachedPermitsContainer = BatchedPermitsRequester.builder() .resourceId(resourceLimited).requestorIdentifier(serviceIdentifier).requestSender(requestSender).build(); this.metricContext = Optional.fromNullable(metricContext); if (this.metricContext.isPresent()) { this.permitsRequestedMeter = Optional.of(this.metricContext.get().meter(PERMITS_REQUESTED_METER_NAME)); this.permitsGrantedMeter = Optional.of(this.metricContext.get().meter(PERMITS_GRANTED_METER_NAME)); } else { this.permitsRequestedMeter = Optional.absent(); this.permitsGrantedMeter = Optional.absent(); } }
@Override protected void createMetrics() { super.createMetrics(); this.messageParseFailures = this.getMetricContext().meter( RuntimeMetrics.GOBBLIN_JOB_MONITOR_KAFKA_MESSAGE_PARSE_FAILURES); }
/** * Generates metrics for the instrumentation of this class. */ protected void regenerateMetrics() { if (isInstrumentationEnabled()) { this.recordsInMeter = Optional.of(this.metricContext.meter(MetricNames.DataWriterMetrics.RECORDS_IN_METER)); this.successfulWritesMeter = Optional.of(this.metricContext.meter(MetricNames.DataWriterMetrics.SUCCESSFUL_WRITES_METER)); this.failedWritesMeter = Optional.of(this.metricContext.meter(MetricNames.DataWriterMetrics.FAILED_WRITES_METER)); setRecordsWrittenMeter(isInstrumentationEnabled()); setBytesWrittenMeter(isInstrumentationEnabled()); this.dataWriterTimer = Optional.<Timer>of(this.metricContext.timer(MetricNames.DataWriterMetrics.WRITE_TIMER)); } else { this.recordsInMeter = Optional.absent(); this.successfulWritesMeter = Optional.absent(); this.failedWritesMeter = Optional.absent(); setRecordsWrittenMeter(isInstrumentationEnabled()); setBytesWrittenMeter(isInstrumentationEnabled()); this.dataWriterTimer = Optional.absent(); } }
if (instrumentationEnabled) { this.metricContext = Instrumented.getMetricContext(ConfigUtils.configToState(config), IdentityFlowToJobSpecCompiler.class); this.flowCompilationSuccessFulMeter = Optional.of(this.metricContext.meter(ServiceMetricNames.FLOW_COMPILATION_SUCCESSFUL_METER)); this.flowCompilationFailedMeter = Optional.of(this.metricContext.meter(ServiceMetricNames.FLOW_COMPILATION_FAILED_METER)); this.flowCompilationTimer = Optional.<Timer>of(this.metricContext.timer(ServiceMetricNames.FLOW_COMPILATION_TIMER));
this.flowOrchestrationSuccessFulMeter = Optional.of(this.metricContext.meter(ServiceMetricNames.FLOW_ORCHESTRATION_SUCCESSFUL_METER)); this.flowOrchestrationFailedMeter = Optional.of(this.metricContext.meter(ServiceMetricNames.FLOW_ORCHESTRATION_FAILED_METER)); this.flowOrchestrationTimer = Optional.of(this.metricContext.timer(ServiceMetricNames.FLOW_ORCHESTRATION_TIMER)); this.eventSubmitter = Optional.of(new EventSubmitter.Builder(this.metricContext, "org.apache.gobblin.service").build());
final Optional<Meter> retryMeter = Optional.of(Instrumented.getMetricContext(state, getClass()).meter(FAILED_RETRY_WRITES_METER));
this.actualProcessedCopyableFile = Optional.absent(); this.copySpeedMeter = getMetricContext().meter(GOBBLIN_COPY_BYTES_COPIED_METER);
@Builder private MetricsUpdater(int depth, int counters, int meters, int histograms, int timers, MetricContext baseContext) { this.depth = depth; this.random = new Random(); MetricContext tmpContext = baseContext == null ? RootMetricContext.get() : baseContext; while(depth > 0) { tmpContext = tmpContext.childBuilder(UUID.randomUUID().toString()).build(); depth--; } this.context = tmpContext; this.counters = Lists.newArrayList(); for(int i = 0; i < counters; i++) { this.counters.add(this.context.counter("gobblin.performance.test.counter" + i)); } this.meters = Lists.newArrayList(); for(int i = 0; i < meters; i++) { this.meters.add(this.context.meter("gobblin.performance.test.meter" + i)); } this.histograms = Lists.newArrayList(); for(int i = 0; i < histograms; i++) { this.histograms.add(this.context.histogram("gobblin.performance.test.histogram" + i)); } this.timers = Lists.newArrayList(); for(int i = 0; i < timers; i++) { this.timers.add(this.context.timer("gobblin.performance.test.timer" + i)); } }