Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram refactoring #400

Merged
merged 3 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
language: java
jdk:
- oraclejdk8


addons:
apt:
packages:
- oracle-java8-installer
- openjdk8
82 changes: 43 additions & 39 deletions proxy/src/main/java/com/wavefront/agent/AbstractAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,28 +253,37 @@ public abstract class AbstractAgent {
protected Integer histogramAccumulatorFlushMaxBatchSize = -1;

@Parameter(
names = {"--histogramReceiveBufferFlushInterval"},
description = "Interval to send received points to the processing queue in millis (Default: 100)")
names = {"--histogramReceiveBufferFlushInterval"}, hidden = true,
description = "(DEPRECATED) Interval to send received points to the processing queue in " +
"millis (Default: 100)")
@Deprecated
protected Integer histogramReceiveBufferFlushInterval = 100;

@Parameter(
names = {"--histogramProcessingQueueScanInterval"},
names = {"--histogramProcessingQueueScanInterval"}, hidden = true,
description = "Processing queue scan interval in millis (Default: 20)")
@Deprecated
protected Integer histogramProcessingQueueScanInterval = 20;

@Parameter(
names = {"--histogramMaxReceivedLength"},
description = "Maximum line length for received histogram data (Default: 65536)")
protected Integer histogramMaxReceivedLength = 64 * 1024;

@Parameter(
names = {"--histogramHttpBufferSize"},
description = "Maximum line length for received histogram data (Default: 16MB)")
protected Integer histogramHttpBufferSize = 16 * 1024 * 1024;

@Parameter(
names = {"--histogramMinuteListenerPorts"},
description = "Comma-separated list of ports to listen on. Defaults to none.")
protected String histogramMinuteListenerPorts = "";

@Parameter(
names = {"--histogramMinuteAccumulators"},
description = "Number of accumulators per minute port")
names = {"--histogramMinuteAccumulators"}, hidden = true,
description = "(DEPRECATED) Number of accumulators per minute port")
@Deprecated
protected Integer histogramMinuteAccumulators = Runtime.getRuntime().availableProcessors();

@Parameter(
Expand Down Expand Up @@ -315,8 +324,9 @@ public abstract class AbstractAgent {
protected String histogramHourListenerPorts = "";

@Parameter(
names = {"--histogramHourAccumulators"},
description = "Number of accumulators per hour port")
names = {"--histogramHourAccumulators"}, hidden = true,
description = "(DEPRECATED) Number of accumulators per hour port")
@Deprecated
protected Integer histogramHourAccumulators = Runtime.getRuntime().availableProcessors();

@Parameter(
Expand Down Expand Up @@ -357,8 +367,9 @@ public abstract class AbstractAgent {
protected String histogramDayListenerPorts = "";

@Parameter(
names = {"--histogramDayAccumulators"},
description = "Number of accumulators per day port")
names = {"--histogramDayAccumulators"}, hidden = true,
description = "(DEPRECATED) Number of accumulators per day port")
@Deprecated
protected Integer histogramDayAccumulators = Runtime.getRuntime().availableProcessors();

@Parameter(
Expand Down Expand Up @@ -399,8 +410,9 @@ public abstract class AbstractAgent {
protected String histogramDistListenerPorts = "";

@Parameter(
names = {"--histogramDistAccumulators"},
description = "Number of accumulators per distribution port")
names = {"--histogramDistAccumulators"}, hidden = true,
description = "(DEPRECATED) Number of accumulators per distribution port")
@Deprecated
protected Integer histogramDistAccumulators = Runtime.getRuntime().availableProcessors();

@Parameter(
Expand Down Expand Up @@ -454,12 +466,14 @@ public abstract class AbstractAgent {
protected Integer avgHistogramDigestBytes = null;

@Parameter(
names = {"--persistMessages"},
description = "Whether histogram samples or distributions should be persisted to disk")
names = {"--persistMessages"}, hidden = true,
description = "(DEPRECATED) Whether histogram samples or distributions should be persisted to disk")
@Deprecated
protected boolean persistMessages = true;

@Parameter(names = {"--persistMessagesCompression"}, description = "Enable LZ4 compression for histogram samples " +
"persisted to disk. (Default: true)")
@Parameter(names = {"--persistMessagesCompression"}, hidden = true,
description = "(DEPRECATED) Enable LZ4 compression for histogram samples persisted to disk. (Default: true)")
@Deprecated
protected boolean persistMessagesCompression = true;

@Parameter(
Expand All @@ -471,6 +485,7 @@ public abstract class AbstractAgent {
names = {"--histogramCompression"}, hidden = true,
description = "(DEPRECATED FOR histogramMinuteCompression/histogramHourCompression/" +
"histogramDayCompression/histogramDistCompression)")
@Deprecated
protected Short histogramCompression = null;

@Parameter(names = {"--graphitePorts"}, description = "Comma-separated list of ports to listen on for graphite " +
Expand Down Expand Up @@ -926,41 +941,36 @@ private void loadListenerConfigurationFile() throws IOException {
histogramAccumulatorFlushInterval).longValue();
histogramAccumulatorFlushMaxBatchSize = config.getNumber("histogramAccumulatorFlushMaxBatchSize",
histogramAccumulatorFlushMaxBatchSize).intValue();
histogramReceiveBufferFlushInterval = config.getNumber("histogramReceiveBufferFlushInterval",
histogramReceiveBufferFlushInterval).intValue();
histogramProcessingQueueScanInterval = config.getNumber("histogramProcessingQueueScanInterval",
histogramProcessingQueueScanInterval).intValue();
histogramMaxReceivedLength = config.getNumber("histogramMaxReceivedLength",
histogramMaxReceivedLength).intValue();
histogramHttpBufferSize = config.getNumber("histogramHttpBufferSize",
histogramHttpBufferSize).intValue();
persistAccumulator = config.getBoolean("persistAccumulator", persistAccumulator);
persistMessages = config.getBoolean("persistMessages", persistMessages);
persistMessagesCompression = config.getBoolean("persistMessagesCompression",
persistMessagesCompression);

// Histogram: deprecated settings - fall back for backwards compatibility
if (config.isDefined("avgHistogramKeyBytes")) {
histogramMinuteAvgKeyBytes = histogramHourAvgKeyBytes = histogramDayAvgKeyBytes =
histogramDistAvgKeyBytes = config.getNumber("avgHistogramKeyBytes", avgHistogramKeyBytes).intValue();
histogramDistAvgKeyBytes = config.getNumber("avgHistogramKeyBytes",
avgHistogramKeyBytes).intValue();
}
if (config.isDefined("avgHistogramDigestBytes")) {
histogramMinuteAvgDigestBytes = histogramHourAvgDigestBytes = histogramDayAvgDigestBytes =
histogramDistAvgDigestBytes = config.getNumber("avgHistogramDigestBytes", avgHistogramDigestBytes).
intValue();
histogramDistAvgDigestBytes = config.getNumber("avgHistogramDigestBytes",
avgHistogramDigestBytes).intValue();
}
if (config.isDefined("histogramAccumulatorSize")) {
histogramMinuteAccumulatorSize = histogramHourAccumulatorSize = histogramDayAccumulatorSize =
histogramDistAccumulatorSize = config.getNumber("histogramAccumulatorSize",
histogramAccumulatorSize).longValue();
histogramMinuteAccumulatorSize = histogramHourAccumulatorSize =
histogramDayAccumulatorSize = histogramDistAccumulatorSize = config.getNumber(
"histogramAccumulatorSize", histogramAccumulatorSize).longValue();
}
if (config.isDefined("histogramCompression")) {
histogramMinuteCompression = histogramHourCompression = histogramDayCompression =
histogramDistCompression = config.getNumber("histogramCompression", null, 20, 1000).shortValue();
histogramDistCompression = config.getNumber("histogramCompression", null, 20, 1000).
shortValue();
}

// Histogram: minute accumulator settings
histogramMinuteListenerPorts = config.getString("histogramMinuteListenerPorts", histogramMinuteListenerPorts);
histogramMinuteAccumulators = config.getNumber("histogramMinuteAccumulators", histogramMinuteAccumulators).
intValue();
histogramMinuteFlushSecs = config.getNumber("histogramMinuteFlushSecs", histogramMinuteFlushSecs).intValue();
histogramMinuteCompression = config.getNumber("histogramMinuteCompression",
histogramMinuteCompression, 20, 1000).shortValue();
Expand All @@ -975,7 +985,6 @@ private void loadListenerConfigurationFile() throws IOException {

// Histogram: hour accumulator settings
histogramHourListenerPorts = config.getString("histogramHourListenerPorts", histogramHourListenerPorts);
histogramHourAccumulators = config.getNumber("histogramHourAccumulators", histogramHourAccumulators).intValue();
histogramHourFlushSecs = config.getNumber("histogramHourFlushSecs", histogramHourFlushSecs).intValue();
histogramHourCompression = config.getNumber("histogramHourCompression",
histogramHourCompression, 20, 1000).shortValue();
Expand All @@ -989,7 +998,6 @@ private void loadListenerConfigurationFile() throws IOException {

// Histogram: day accumulator settings
histogramDayListenerPorts = config.getString("histogramDayListenerPorts", histogramDayListenerPorts);
histogramDayAccumulators = config.getNumber("histogramDayAccumulators", histogramDayAccumulators).intValue();
histogramDayFlushSecs = config.getNumber("histogramDayFlushSecs", histogramDayFlushSecs).intValue();
histogramDayCompression = config.getNumber("histogramDayCompression",
histogramDayCompression, 20, 1000).shortValue();
Expand All @@ -1003,7 +1011,6 @@ private void loadListenerConfigurationFile() throws IOException {

// Histogram: dist accumulator settings
histogramDistListenerPorts = config.getString("histogramDistListenerPorts", histogramDistListenerPorts);
histogramDistAccumulators = config.getNumber("histogramDistAccumulators", histogramDistAccumulators).intValue();
histogramDistFlushSecs = config.getNumber("histogramDistFlushSecs", histogramDistFlushSecs).intValue();
histogramDistCompression = config.getNumber("histogramDistCompression",
histogramDistCompression, 20, 1000).shortValue();
Expand Down Expand Up @@ -1134,9 +1141,6 @@ private void postProcessConfig() {
blacklistRegex = graphiteBlacklistRegex;
}

if (!persistMessages) {
persistMessagesCompression = false;
}
if (pushRateLimit > 0) {
pushRateLimiter = RecyclableRateLimiter.create(pushRateLimit, pushRateLimitMaxBurstSeconds);
}
Expand All @@ -1159,8 +1163,8 @@ private void postProcessConfig() {
if (!customSourceTags.contains(tag)) {
customSourceTags.add(tag);
} else {
logger.warning("Custom source tag: " + tag + " was repeated. Check the customSourceTags property in " +
"wavefront.conf");
logger.warning("Custom source tag: " + tag + " was repeated. Check the customSourceTags " +
"property in wavefront.conf");
}
}

Expand Down
Loading