Skip to content

Commit

Permalink
when config.advertisedAddr is null, use default
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed Sep 20, 2022
1 parent 99595e4 commit 7ff2165
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ public void start() throws PulsarServerException {

// Register pulsar system namespaces and start transaction meta store service
if (config.isTransactionCoordinatorEnabled()) {
MLTransactionMetadataStoreProvider.initBufferedWriterMetrics(getConfiguration().getAdvertisedAddress());
MLPendingAckStoreProvider.initBufferedWriterMetrics(getConfiguration().getAdvertisedAddress());
MLTransactionMetadataStoreProvider.initBufferedWriterMetrics(getAdvertisedAddress());
MLPendingAckStoreProvider.initBufferedWriterMetrics(getAdvertisedAddress());

this.transactionBufferSnapshotService = new SystemTopicBaseTxnBufferSnapshotService(getClient());
this.transactionTimer =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.help("Records per batch histogram")
.buckets(RECORD_COUNT_PER_ENTRY_BUCKETS)
.register(collectorRegistry);
recordsPerBatchHistogram = recordsPerBatchMetric.labels(labelValues);
recordsPerBatchHistogram = recordsPerBatchMetric.labels(this.labelValues);

String batchSizeBytesMetricName = String.format("%s_bufferedwriter_batch_size_bytes", metricsPrefix);
batchSizeBytesMetric = new Histogram.Builder()
Expand All @@ -119,7 +119,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.help("Batch size in bytes histogram")
.buckets(BYTES_SIZE_PER_ENTRY_BUCKETS)
.register(collectorRegistry);
batchSizeBytesHistogram = batchSizeBytesMetric.labels(labelValues);
batchSizeBytesHistogram = batchSizeBytesMetric.labels(this.labelValues);

String oldestRecordInBatchDelayTimeSecondsMetricName =
String.format("%s_bufferedwriter_batch_oldest_record_delay_time_second", metricsPrefix);
Expand All @@ -130,7 +130,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.buckets(MAX_DELAY_TIME_BUCKETS)
.register(collectorRegistry);
oldestRecordInBatchDelayTimeSecondsHistogram =
oldestRecordInBatchDelayTimeSecondsMetric.labels(labelValues);
oldestRecordInBatchDelayTimeSecondsMetric.labels(this.labelValues);

String batchFlushTriggeringByMaxRecordsMetricName =
String.format("%s_bufferedwriter_flush_trigger_max_records", metricsPrefix);
Expand All @@ -139,7 +139,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.labelNames(this.labelNames)
.help("Event count of batch flush triggered by max records count")
.register(collectorRegistry);
batchFlushTriggeredByMaxRecordsCounter = batchFlushTriggeredByMaxRecordsMetric.labels(labelValues);
batchFlushTriggeredByMaxRecordsCounter = batchFlushTriggeredByMaxRecordsMetric.labels(this.labelValues);

String batchFlushTriggeringByMaxSizeMetricName =
String.format("%s_bufferedwriter_flush_trigger_max_size", metricsPrefix);
Expand All @@ -148,7 +148,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.labelNames(this.labelNames)
.help("Event count of batch flush triggered by max bytes size")
.register(collectorRegistry);
batchFlushTriggeredByMaxSizeCounter = batchFlushTriggeredByMaxSizeMetric.labels(labelValues);
batchFlushTriggeredByMaxSizeCounter = batchFlushTriggeredByMaxSizeMetric.labels(this.labelValues);

String batchFlushTriggeringByMaxDelayMetricName =
String.format("%s_bufferedwriter_flush_trigger_max_delay", metricsPrefix);
Expand All @@ -158,7 +158,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.help("Event count of batch flush triggered by max delay time")
.register(collectorRegistry);
batchFlushTriggeredByMaxDelayCounter =
batchFlushTriggeredByMaxDelayMetric.labels(labelValues);
batchFlushTriggeredByMaxDelayMetric.labels(this.labelValues);

String batchFlushTriggeringByLargeSingleDataMetricName =
String.format("%s_bufferedwriter_flush_trigger_large_data", metricsPrefix);
Expand All @@ -168,7 +168,7 @@ public TxnLogBufferedWriterMetricsStats(String metricsPrefix, String[] labelName
.help("Event count of batch flush triggered by the single large data write")
.register(collectorRegistry);
batchFlushTriggeredByLargeSingleDataCounter =
batchFlushTriggeredByLargeSingleDataMetric.labels(labelValues);
batchFlushTriggeredByLargeSingleDataMetric.labels(this.labelValues);

this.closed = new AtomicBoolean(false);
}
Expand Down

0 comments on commit 7ff2165

Please sign in to comment.