Skip to content

Commit

Permalink
fix: warn if alloc/lock set to 0 (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
korniltsev authored Sep 4, 2023
1 parent ad2d979 commit 7039d94
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion agent/src/main/java/io/pyroscope/javaagent/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ public final class Config {
"auth token is ignored (both auth token and basic auth specified)");
}
this.samplingEventOrder = resolve(samplingEventOrder, profilingEvent, profilingAlloc, profilingLock, this.samplingDuration);
if ("0".equals(this.profilingAlloc)) {
DefaultLogger.PRECONFIG_LOGGER.log(Logger.Level.WARN,
"Setting PYROSCOPE_PROFILER_ALLOC to 0 registers every allocation event, causing significant overhead and results in large profiles, making it not ideal for production. We recommend a starting value of 512k, adjusting as needed.");
}
if ("0".equals(this.profilingLock)) {
DefaultLogger.PRECONFIG_LOGGER.log(Logger.Level.WARN,
"Setting PYROSCOPE_PROFILER_LOCK to 0 registers every lock event, causing significant overhead and results in large profiles, making it not ideal for production. We recommend a starting value of 10ms, adjusting as needed.");
}
}

public long profilingIntervalInHertz() {
Expand Down Expand Up @@ -356,7 +364,7 @@ private static List<EventType> samplingEventOrder(final ConfigurationProvider cp
return Stream.of(samplingEventOrder.split("\\s*,\\s*"))
.map(s -> {
try {
return EventType.fromId(s);
return EventType.fromId(s);
} catch (final IllegalArgumentException e) {
return null;
}
Expand Down

0 comments on commit 7039d94

Please sign in to comment.