Skip to content

Commit 8ca1629

Browse files
[ENG-985]: Add support of Memory allocation in profiling.
1 parent ae21556 commit 8ca1629

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

examples/extension/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ version '1.0'
2222

2323
ext {
2424
versions = [
25-
pyroscopeVersion : "0.11.5",
25+
pyroscopeVersion : "0.12.2",
2626
// this line is managed by .github/scripts/update-sdk-version.sh
2727
opentelemetrySdk : "1.27.0",
2828

examples/extension/src/main/java/com/example/javaagent/config/EnvironmentConfig.java

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ public class EnvironmentConfig {
1111
public static final String MW_PROFILING_SERVER_URL =
1212
System.getenv().getOrDefault("MW_PROFILING_SERVER_URL", "https://profiling.middleware.io");
1313

14+
public static final String MW_PROFILING_ALLOC =
15+
System.getenv().getOrDefault("MW_PROFILING_ALLOC", "512k");
16+
17+
public static final String MW_PROFILING_LOCK =
18+
System.getenv().getOrDefault("MW_PROFILING_LOCK", "10ms");
19+
1420
public static final String MW_AGENT_SERVICE =
1521
System.getenv().getOrDefault("MW_AGENT_SERVICE", "localhost");
1622

examples/extension/src/main/java/com/example/profile/PyroscopeProfile.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public static void startProfiling() {
3737
new Config.Builder()
3838
.setApplicationName(SystemProperties.SERVICE_NAME)
3939
.setProfilingEvent(EventType.ITIMER)
40-
.setAllocLive(true)
40+
.setProfilingAlloc(EnvironmentConfig.MW_PROFILING_ALLOC)
41+
.setProfilingLock(EnvironmentConfig.MW_PROFILING_LOCK)
4142
.setServerAddress(EnvironmentConfig.MW_PROFILING_SERVER_URL)
4243
.setTenantID(tenantId)
4344
.build());

0 commit comments

Comments
 (0)