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

Move snapshot UUID generation at serialization #7280

Merged
merged 1 commit into from
Jul 5, 2024
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
3 changes: 3 additions & 0 deletions .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ variables:
timeout: 1h
tags: ["runner:apm-k8s-tweaked-metal"]
image: $BASE_CI_IMAGE
needs: [ "build" ]
script:
- export ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${ARTIFACTS_DIR}"
- export CIRCLE_CI_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.circleci_token --with-decryption --query "Parameter.Value" --out text)
Expand Down Expand Up @@ -80,6 +81,7 @@ benchmarks-post-results:
interruptible: true
timeout: 1h
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:java-dsm-kafka
needs: [ "build" ]
script:
- git clone --branch java/kafka-dsm-overhead https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform.git platform && cd platform
- ./steps/run-benchmarks.sh
Expand Down Expand Up @@ -117,6 +119,7 @@ debugger-benchmarks:
interruptible: true
timeout: 1h
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:java-debugger
needs: ["build"]
script:
- export ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${ARTIFACTS_DIR}"
- git clone --branch java/debugger-benchmarks https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform.git /platform && cd /platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class Snapshot {
private String exceptionId;

public Snapshot(java.lang.Thread thread, ProbeImplementation probeImplementation, int maxDepth) {
this.id = UUID.randomUUID().toString();
this.version = VERSION;
this.timestamp = System.currentTimeMillis();
this.captures = new Captures();
Expand Down Expand Up @@ -105,6 +104,10 @@ public void addCaughtExceptions(List<CapturedContext.CapturedThrowable> throwabl
}

public String getId() {
// lazily generates snapshot id
if (id == null) {
id = UUID.randomUUID().toString();
}
return id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public boolean offer(Snapshot snapshot) {
}

String serializeSnapshot(String serviceName, Snapshot snapshot) {
snapshot.getId(); // Ensure id is generated
String str = DebuggerAgent.getSnapshotSerializer().serializeSnapshot(serviceName, snapshot);
String prunedStr = SnapshotPruner.prune(str, MAX_SNAPSHOT_SIZE, 4);
if (prunedStr.length() != str.length()) {
Expand Down
Loading