From b8a724cf7f43b0d2bd1c078994dbbcf1dc7fbe3a Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Thu, 25 Jan 2024 11:12:42 +0700 Subject: [PATCH 01/10] asprof 3.0 --- .dockerignore | 3 + alpine-test.Dockerfile | 23 +++ async-profiler-context/build.gradle | 8 +- .../io/pyroscope/PyroscopeAsyncProfiler.java | 6 +- demo/src/main/java/App.java | 14 +- demo/src/main/java/Fib.class | Bin 0 -> 2081 bytes demo/src/main/java/Fib.java | 58 ++++++ docker-compose-itest.yaml | 51 +++++ dockertest.sh | 33 ++++ itest/query/go.mod | 19 ++ itest/query/go.sum | 15 ++ itest/query/main.go | 180 ++++++++++++++++++ ubuntu-test.Dockerfile | 25 +++ 13 files changed, 418 insertions(+), 17 deletions(-) create mode 100644 .dockerignore create mode 100644 alpine-test.Dockerfile create mode 100644 demo/src/main/java/Fib.class create mode 100644 demo/src/main/java/Fib.java create mode 100644 docker-compose-itest.yaml create mode 100755 dockertest.sh create mode 100644 itest/query/go.mod create mode 100644 itest/query/go.sum create mode 100644 itest/query/main.go create mode 100644 ubuntu-test.Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..16b7427 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.gradle +**/build/ +**/out/ \ No newline at end of file diff --git a/alpine-test.Dockerfile b/alpine-test.Dockerfile new file mode 100644 index 0000000..46be570 --- /dev/null +++ b/alpine-test.Dockerfile @@ -0,0 +1,23 @@ +ARG IMAGE_VERSION=3.16 +FROM alpine:${IMAGE_VERSION} +RUN apk add openjdk11 +WORKDIR /app +ADD gradlew build.gradle settings.gradle /app/ +ADD gradle gradle +RUN ./gradlew --no-daemon --version +ADD agent agent +ADD async-profiler-context async-profiler-context +add demo/build.gradle demo/ + +RUN ./gradlew --no-daemon shadowJar + +ADD demo demo + +RUN /usr/lib/jvm/default-jvm/jre/bin/javac demo/src/main/java/Fib.java + +ENV PYROSCOPE_LOG_LEVEL=debug +ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040 +ARG IMAGE_VERSION=3.16 +ENV PYROSCOPE_APPLICATION_NAME=alpine-${IMAGE_VERSION} + +CMD ["java", "-javaagent:/app/agent/build/libs/pyroscope.jar", "-cp", "demo/src/main/java/", "Fib"] diff --git a/async-profiler-context/build.gradle b/async-profiler-context/build.gradle index 5cecf78..45afb16 100644 --- a/async-profiler-context/build.gradle +++ b/async-profiler-context/build.gradle @@ -21,7 +21,7 @@ repositories { mavenCentral() } -def asyncProfilerVersion = "2.9.0.2" +def asyncProfilerVersion = "3.0.11" def pyroscopeVersion = project.properties['pyroscope_version'] dependencies { api files("$buildDir/async-profiler/async-profiler.jar") @@ -75,6 +75,7 @@ task asyncProfilerLib { ['linux-arm64', 'tar.gz'], ['linux-x64', 'tar.gz'], ['linux-musl-x64', 'tar.gz'], + ['linux-musl-arm64', 'tar.gz'], ['macos', 'zip'] ] @@ -87,7 +88,8 @@ task asyncProfilerLib { doLast { suffixes.forEach { suffix, ext -> // def repo = "https://github.com/jvm-profiling-tools/async-profiler" - def repo = "https://github.com/pyroscope-io/async-profiler" + def repo = "https://github.com/korniltsev/async-profiler" +// def repo = "https://github.com/grafana/async-profiler" download { src "$repo/releases/download/v${asyncProfilerVersion}/async-profiler-${asyncProfilerVersion}-${suffix}.${ext}" dest new File(asyncProfilerDir, "async-profiler-${asyncProfilerVersion}-${suffix}.${ext}") @@ -101,7 +103,7 @@ task asyncProfilerLib { } else { from tarTree(resources.gzip("$asyncProfilerDir/async-profiler-${asyncProfilerVersion}-${suffix}.${ext}")) } - include '**/libasyncProfiler.so' + include '**/libasyncProfiler.*' eachFile { it.relativePath = new RelativePath(true, "native/", "libasyncProfiler-${suffix}.so") } diff --git a/async-profiler-context/src/main/java/io/pyroscope/labels/io/pyroscope/PyroscopeAsyncProfiler.java b/async-profiler-context/src/main/java/io/pyroscope/labels/io/pyroscope/PyroscopeAsyncProfiler.java index 6d01c6e..c365c92 100644 --- a/async-profiler-context/src/main/java/io/pyroscope/labels/io/pyroscope/PyroscopeAsyncProfiler.java +++ b/async-profiler-context/src/main/java/io/pyroscope/labels/io/pyroscope/PyroscopeAsyncProfiler.java @@ -86,7 +86,11 @@ private static String libraryFileName() { break; case "aarch64": - arch = "arm64"; + if (isMusl()) { + arch = "musl-arm64"; + } else { + arch = "arm64"; + } break; default: diff --git a/demo/src/main/java/App.java b/demo/src/main/java/App.java index cf9480e..dbf1224 100644 --- a/demo/src/main/java/App.java +++ b/demo/src/main/java/App.java @@ -1,12 +1,9 @@ import io.pyroscope.http.Format; import io.pyroscope.javaagent.PyroscopeAgent; -import io.pyroscope.javaagent.Snapshot; -import io.pyroscope.javaagent.api.Exporter; import io.pyroscope.javaagent.api.Logger; import io.pyroscope.javaagent.config.Config; -import io.pyroscope.javaagent.impl.DefaultConfigurationProvider; -import io.pyroscope.labels.Pyroscope; import io.pyroscope.labels.LabelsSet; +import io.pyroscope.labels.Pyroscope; import java.util.HashMap; import java.util.Map; @@ -26,7 +23,6 @@ public static void main(String[] args) { .setLogLevel(Logger.Level.DEBUG) .setLabels(mapOf("user", "tolyan")) .build()) -// .setExporter(new MyStdoutExporter()) .build() ); Pyroscope.setStaticLabels(mapOf("region", "us-east-1")); @@ -68,14 +64,6 @@ private static long fib(Long n) throws InterruptedException { if (n == 1L) { return 1L; } - Thread.sleep(100); return fib(n - 1) + fib(n - 2); } - - private static class MyStdoutExporter implements Exporter { - @Override - public void export(Snapshot snapshot) { - System.out.printf("Export %d %d%n", snapshot.data.length, snapshot.labels.toByteArray().length); - } - } } diff --git a/demo/src/main/java/Fib.class b/demo/src/main/java/Fib.class new file mode 100644 index 0000000000000000000000000000000000000000..26cbb8ec49d359b7060c5b9b11e9a48bf26640b8 GIT binary patch literal 2081 zcma)7T~iZR7=BI?vdLzF@F8NP7Hq5`RD(d(7Nk{#@)5uiiXXJqljHy^o88Q2m*Rb| zdflsDdc&17dZTD(`~jW*5NEvaMQ2+2p3TNAg?40yJ$v5sKJUl#K6~=p->+T+xB{V~ z8y8fBaZy1|#V{^)(!u2f25?2eRTT;@B#_2uDn7@!d`w91Yc1p@|3ZzIeg%^%zQC9A zab3X;hWOI`)!CKl>o*GwY>uII$}(#XH=Q+ZxFSsG7(;YIH+5%{A)FapV~9*yWx>#% z*G;kHR*J%2I?>^lq6w5r_Xe>QU4h74#OJYWsl*DHA;zdb@hEqss_z)=y zPeujP8fNenL-K}YIW@=T)kWcKS>;-L6thXBXqnS6j|B~REK)9yQ;&gJUfUuTG%R6R z!7UA6V?{#&s~XND!*Hfa|D5Rv+jgstD8DOQ!8aP#a9hJ2Sx&O)yExz&Magw6yCCcxy+qx$Hr=S4MqaPPV_?Krrzw7z(RW38b;}mKe9N*7hQZ9- zU|_t*ApL}-?Yp=qwY^Rx+ODTHAL?ms#WhVSMH*qW<`yeDwK5u<;yZ``NI2t4HAw|j zUBX@sV(Z+D2Q=YZf))5ChPEcDQaU77gBI_rqUaf^BxOf_V^Z>6nfYK4Piu$fQm2au z_eas#cV~jQx|OPr>y4=^_*TPrAo*qGsLwX5(#;)fTjcVdfJu3LgO_Nwj~Eh_=1u{9 ztkJw>ZM!sIZO$}>J!SA(P0%!d57Ohut7~|cn`J}P(sf{vGyggWuy_c#`lu>`?(ctC zPx=4YAX$FoDQ*}A-4S%7lo`$);pe!18bbFpcc?EIe+V7nLk$r@ko+r?KtBdA5e?z?kBsddyp^FskV$*wkyqgvDO)JC zckpKDDY*vIWe~$4b(*Ex2PxSn&2*}QG^I+HCFib38LIR`2;uw)|*{dLeP(r1Oh;L%FBdN;o$LIDQ z)xhYaw;S#C6nFLx{#e*Y=W}%JA^glcRndwLzt mD9kJ9h|@Ym`w;Q)fL4_veUBpU( { + while (true) { + try { + fib(32L); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + break; + } + } + }); + } + } + + private static Map mapOf(String... args) { + Map staticLabels = new HashMap<>(); + for (int i = 0; i < args.length; i += 2) { + staticLabels.put(args[i], args[i + 1]); + } + return staticLabels; + } + + private static long fib(Long n) throws InterruptedException { + if (n == 0L) { + return 0L; + } + if (n == 1L) { + return 1L; + } + return fib(n - 1) + fib(n - 2); + } + +} diff --git a/docker-compose-itest.yaml b/docker-compose-itest.yaml new file mode 100644 index 0000000..65057ec --- /dev/null +++ b/docker-compose-itest.yaml @@ -0,0 +1,51 @@ +version: '3.9' +services: + alpine-3.16: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.16 + alpine-3.17: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.17 + alpine-3.18: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.18 + alpine-3.19: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.19 + ubuntu-18.04: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 18.04 + ubuntu-20.04: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 20.04 + ubuntu-22.04: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 22.04 + + pyroscope: + image: 'grafana/pyroscope:latest' + ports: + - 4040:4040 + + diff --git a/dockertest.sh b/dockertest.sh new file mode 100755 index 0000000..7b15d22 --- /dev/null +++ b/dockertest.sh @@ -0,0 +1,33 @@ +#!/usr/bin/zsh +set -ex + +DOCKERFILE=$1 +IMAGE_VERSION=$2 +PORT=$3 + +function usage() { + echo "Usage: ./itest.sh " + exit 1 +} +if [ -z "${DOCKERFILE}" ]; then + usage +fi + +if [ -z "${IMAGE_VERSION}" ]; then + usage +fi + +TEST_NAME="pyroscope-java-dockertest-$(basename ${DOCKERFILE} | cut -f 1 -d .)-${IMAGE_VERSION}" +SERVER_CONTAINER_NAME="${TEST_NAME}-server" +TEST_CONTAINER_NAME="${TEST_NAME}-test" + +docker kill ${SERVER_CONTAINER_NAME} || true +docker kill ${TEST_CONTAINER_NAME} || true + + +docker pull grafana/pyroscope:latest +docker run --rm -tid -p${PORT}:4040 --name=${SERVER_CONTAINER_NAME} grafana/pyroscope:latest + +docker build -t ${TEST_CONTAINER_NAME} --build-arg="IMAGE_VERSION=${IMAGE_VERSION}" -f ${DOCKERFILE} . +docker run --rm --name=${TEST_CONTAINER_NAME} ${TEST_CONTAINER_NAME} + diff --git a/itest/query/go.mod b/itest/query/go.mod new file mode 100644 index 0000000..4ebbd92 --- /dev/null +++ b/itest/query/go.mod @@ -0,0 +1,19 @@ +module java-test-querier + +go 1.21 + +require ( + connectrpc.com/connect v1.14.0 + github.com/grafana/pyroscope/api v0.4.0 +) + +require ( + github.com/golang/protobuf v1.5.3 // indirect + github.com/gorilla/mux v1.8.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect +) diff --git a/itest/query/go.sum b/itest/query/go.sum new file mode 100644 index 0000000..025de64 --- /dev/null +++ b/itest/query/go.sum @@ -0,0 +1,15 @@ +connectrpc.com/connect v1.14.0/go.mod h1:uoAq5bmhhn43TwhaKdGKN/bZcGtzPW1v+ngDTn5u+8s= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grafana/pyroscope/api v0.4.0/go.mod h1:MFnZNeUM4RDsDOnbgKW3GWoLSBpLzMMT9nkvhHHo81o= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/itest/query/main.go b/itest/query/main.go new file mode 100644 index 0000000..2350b2f --- /dev/null +++ b/itest/query/main.go @@ -0,0 +1,180 @@ +package main + +import ( + "context" + "fmt" + "net/http" + "os" + "slices" + "strings" + "sync" + "time" + + "connectrpc.com/connect" + profilev1 "github.com/grafana/pyroscope/api/gen/proto/go/google/v1" + querierv1 "github.com/grafana/pyroscope/api/gen/proto/go/querier/v1" + + "github.com/grafana/pyroscope/api/gen/proto/go/querier/v1/querierv1connect" +) + +func main() { + type result struct { + target string + err error + } + targets := []string{ + "alpine-3.16", + "alpine-3.17", + "alpine-3.18", + "alpine-3.19", + "ubuntu-18.04", + "ubuntu-20.04", + "ubuntu-22.04", + } + url := "http://localhost:4040" + qc := querierv1connect.NewQuerierServiceClient( + http.DefaultClient, + url, + ) + wg := sync.WaitGroup{} + ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(time.Minute)) + results := make(chan result, len(targets)) + for _, target := range targets { + wg.Add(1) + go func(target string) { + defer wg.Done() + err := testTarget(ctx, qc, target) + results <- result{target: target, err: err} + }(target) + } + wg.Wait() + close(results) + + failed := false + for r := range results { + if r.err != nil { + fmt.Printf("[%s] %s\n", r.target, r.err.Error()) + failed = true + } else { + fmt.Printf("[%s] OK\n", r.target) + } + } + if failed { + os.Exit(1) + } +} + +func testTarget(ctx context.Context, qc querierv1connect.QuerierServiceClient, target string) error { + needle := "Fib$$Lambda$_.run;Fib.lambda$appLogic$0;Fib.fib;Fib.fib;Fib.fib;Fib.fib;" + ticker := time.NewTicker(time.Second * 5) + n := 0 + for { + select { + case <-ctx.Done(): + return fmt.Errorf("timed out waiting for target %s. tried %d times", target, n) + case <-ticker.C: + n += 1 + to := time.Now() + from := to.Add(-time.Minute * 1) + + resp, err := qc.SelectMergeProfile(context.Background(), connect.NewRequest(&querierv1.SelectMergeProfileRequest{ + ProfileTypeID: "process_cpu:cpu:nanoseconds:cpu:nanoseconds", + Start: from.UnixMilli(), + End: to.UnixMilli(), + LabelSelector: fmt.Sprintf("{service_name=\"%s\"}", target), + })) + if err != nil { + fmt.Printf("[%s] %d %s\n", target, n, err.Error()) + continue + } + + ss := stackCollapseProto(resp.Msg, false) + if !strings.Contains(ss, needle) { + fmt.Printf("[%s] %d not found yet\n%s\n", target, n, ss) + continue + } + fmt.Printf("[%s] %d OK\n", target, n) + return nil + } + } + +} + +func stackCollapseProto(p *profilev1.Profile, lineNumbers bool) string { + allZeros := func(a []int64) bool { + for _, v := range a { + if v != 0 { + return false + } + } + return true + } + addValues := func(a, b []int64) { + for i := range a { + a[i] += b[i] + } + } + + type stack struct { + funcs string + value []int64 + } + locMap := make(map[int64]*profilev1.Location) + funcMap := make(map[int64]*profilev1.Function) + for _, l := range p.Location { + locMap[int64(l.Id)] = l + } + for _, f := range p.Function { + funcMap[int64(f.Id)] = f + } + + var ret []stack + for _, s := range p.Sample { + var funcs []string + for i := range s.LocationId { + locID := s.LocationId[len(s.LocationId)-1-i] + loc := locMap[int64(locID)] + for _, line := range loc.Line { + f := funcMap[int64(line.FunctionId)] + fname := p.StringTable[f.Name] + if lineNumbers { + fname = fmt.Sprintf("%s:%d", fname, line.Line) + } + funcs = append(funcs, fname) + } + } + + vv := make([]int64, len(s.Value)) + copy(vv, s.Value) + ret = append(ret, stack{ + funcs: strings.Join(funcs, ";"), + value: vv, + }) + } + slices.SortFunc(ret, func(i, j stack) int { + return strings.Compare(i.funcs, j.funcs) + }) + var unique []stack + for _, s := range ret { + if allZeros(s.value) { + continue + } + if len(unique) == 0 { + unique = append(unique, s) + continue + } + + if unique[len(unique)-1].funcs == s.funcs { + addValues(unique[len(unique)-1].value, s.value) + continue + } + unique = append(unique, s) + + } + + res := make([]string, 0, len(unique)) + for _, s := range unique { + res = append(res, fmt.Sprintf("%s %v", s.funcs, s.value)) + } + return strings.Join(res, "\n") +} diff --git a/ubuntu-test.Dockerfile b/ubuntu-test.Dockerfile new file mode 100644 index 0000000..7cace3d --- /dev/null +++ b/ubuntu-test.Dockerfile @@ -0,0 +1,25 @@ +ARG IMAGE_VERSION=18.04 +FROM ubuntu:${IMAGE_VERSION} +RUN apt-get update && apt-get install -y openjdk-11-jdk +WORKDIR /app +ADD gradlew build.gradle settings.gradle /app/ +ADD gradle gradle +RUN ./gradlew --no-daemon --version +ADD agent agent +ADD async-profiler-context async-profiler-context +add demo/build.gradle demo/ + +RUN ./gradlew --no-daemon shadowJar + +ADD demo demo + +RUN javac demo/src/main/java/Fib.java + +ENV PYROSCOPE_LOG_LEVEL=debug +ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040 +ENV PYROSCOPE_UPLOAD_INTERVAL=5s +ARG IMAGE_VERSION=18.04 +ENV PYROSCOPE_APPLICATION_NAME=ubuntu-${IMAGE_VERSION} + + +CMD ["java", "-javaagent:/app/agent/build/libs/pyroscope.jar", "-cp", "demo/src/main/java/", "Fib"] From ff4d83488f5ed67d7fdb6f5f6c31c0eae61c2a8e Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Thu, 25 Jan 2024 11:19:45 +0700 Subject: [PATCH 02/10] change url --- async-profiler-context/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/async-profiler-context/build.gradle b/async-profiler-context/build.gradle index 45afb16..b5c4583 100644 --- a/async-profiler-context/build.gradle +++ b/async-profiler-context/build.gradle @@ -88,8 +88,8 @@ task asyncProfilerLib { doLast { suffixes.forEach { suffix, ext -> // def repo = "https://github.com/jvm-profiling-tools/async-profiler" - def repo = "https://github.com/korniltsev/async-profiler" -// def repo = "https://github.com/grafana/async-profiler" +// def repo = "https://github.com/korniltsev/async-profiler" + def repo = "https://github.com/grafana/async-profiler" download { src "$repo/releases/download/v${asyncProfilerVersion}/async-profiler-${asyncProfilerVersion}-${suffix}.${ext}" dest new File(asyncProfilerDir, "async-profiler-${asyncProfilerVersion}-${suffix}.${ext}") From f26662efc31a047fae8d0e37446af668fbf3d66a Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Thu, 25 Jan 2024 12:39:13 +0700 Subject: [PATCH 03/10] tests --- .github/workflows/itest.yml | 18 +++ Makefile | 6 + alpine-test.Dockerfile | 14 ++- async-profiler-context/build.gradle | 2 +- docker-compose-itest.yaml | 135 +++++++++++++++++++++-- gradle/wrapper/gradle-wrapper.properties | 2 +- itest/query/go.sum | 12 ++ itest/query/main.go | 30 +++-- ubuntu-test.Dockerfile | 8 +- 9 files changed, 201 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/itest.yml diff --git a/.github/workflows/itest.yml b/.github/workflows/itest.yml new file mode 100644 index 0000000..4935050 --- /dev/null +++ b/.github/workflows/itest.yml @@ -0,0 +1,18 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.6 + - run: make itest diff --git a/Makefile b/Makefile index f2929c9..b11bd25 100644 --- a/Makefile +++ b/Makefile @@ -33,3 +33,9 @@ docker-example-expt: build cp agent/build/libs/pyroscope.jar examples docker-compose -f examples/docker-compose-expt.yml build docker-compose -f examples/docker-compose-expt.yml up + +.PHONY: itest +itest: + docker compose -f docker-compose-itest.yaml up --build --force-recreate + cd itest/query && go run . + docker compose -f docker-compose-itest.yaml down diff --git a/alpine-test.Dockerfile b/alpine-test.Dockerfile index 46be570..5b2a009 100644 --- a/alpine-test.Dockerfile +++ b/alpine-test.Dockerfile @@ -1,6 +1,8 @@ -ARG IMAGE_VERSION=3.16 +ARG IMAGE_VERSION FROM alpine:${IMAGE_VERSION} -RUN apk add openjdk11 +ARG IMAGE_VERSION +ARG JAVA_VERSION +RUN apk add openjdk${JAVA_VERSION} WORKDIR /app ADD gradlew build.gradle settings.gradle /app/ ADD gradle gradle @@ -13,11 +15,13 @@ RUN ./gradlew --no-daemon shadowJar ADD demo demo -RUN /usr/lib/jvm/default-jvm/jre/bin/javac demo/src/main/java/Fib.java +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/default-jvm/jre/bin + + +RUN javac demo/src/main/java/Fib.java ENV PYROSCOPE_LOG_LEVEL=debug ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040 -ARG IMAGE_VERSION=3.16 -ENV PYROSCOPE_APPLICATION_NAME=alpine-${IMAGE_VERSION} +ENV PYROSCOPE_APPLICATION_NAME=alpine-${IMAGE_VERSION}-${JAVA_VERSION} CMD ["java", "-javaagent:/app/agent/build/libs/pyroscope.jar", "-cp", "demo/src/main/java/", "Fib"] diff --git a/async-profiler-context/build.gradle b/async-profiler-context/build.gradle index b5c4583..f71414b 100644 --- a/async-profiler-context/build.gradle +++ b/async-profiler-context/build.gradle @@ -21,7 +21,7 @@ repositories { mavenCentral() } -def asyncProfilerVersion = "3.0.11" +def asyncProfilerVersion = "3.0.0.0" def pyroscopeVersion = project.properties['pyroscope_version'] dependencies { api files("$buildDir/async-profiler/async-profiler.jar") diff --git a/docker-compose-itest.yaml b/docker-compose-itest.yaml index 65057ec..c26f468 100644 --- a/docker-compose-itest.yaml +++ b/docker-compose-itest.yaml @@ -1,48 +1,167 @@ version: '3.9' services: - alpine-3.16: + alpine-3.16-8: build: context: . dockerfile: alpine-test.Dockerfile args: IMAGE_VERSION: 3.16 - alpine-3.17: + JAVA_VERSION: 8 + alpine-3.16-11: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.16 + JAVA_VERSION: 11 + alpine-3.16-17: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.16 + JAVA_VERSION: 17 + alpine-3.17-8: build: context: . dockerfile: alpine-test.Dockerfile args: IMAGE_VERSION: 3.17 - alpine-3.18: + JAVA_VERSION: 8 + alpine-3.17-11: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.17 + JAVA_VERSION: 11 + alpine-3.17-17: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.17 + JAVA_VERSION: 17 + alpine-3.18-8: build: context: . dockerfile: alpine-test.Dockerfile args: IMAGE_VERSION: 3.18 - alpine-3.19: + JAVA_VERSION: 8 + alpine-3.18-11: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.18 + JAVA_VERSION: 11 + alpine-3.18-17: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.18 + JAVA_VERSION: 17 + alpine-3.19-8: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.19 + JAVA_VERSION: 8 + alpine-3.19-11: + build: + context: . + dockerfile: alpine-test.Dockerfile + args: + IMAGE_VERSION: 3.19 + JAVA_VERSION: 11 + alpine-3.19-17: build: context: . dockerfile: alpine-test.Dockerfile args: IMAGE_VERSION: 3.19 - ubuntu-18.04: + JAVA_VERSION: 17 + + ubuntu-18.04-8: build: context: . dockerfile: ubuntu-test.Dockerfile args: IMAGE_VERSION: 18.04 - ubuntu-20.04: + JAVA_VERSION: 8 + ubuntu-18.04-11: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 18.04 + JAVA_VERSION: 11 + ubuntu-18.04-17: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 18.04 + JAVA_VERSION: 17 + ubuntu-20.04-8: build: context: . dockerfile: ubuntu-test.Dockerfile args: IMAGE_VERSION: 20.04 - ubuntu-22.04: + JAVA_VERSION: 8 + ubuntu-20.04-11: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 20.04 + JAVA_VERSION: 11 + ubuntu-20.04-17: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 20.04 + JAVA_VERSION: 17 + ubuntu-20.04-21: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 20.04 + JAVA_VERSION: 21 + ubuntu-22.04-8: build: context: . dockerfile: ubuntu-test.Dockerfile args: IMAGE_VERSION: 22.04 - + JAVA_VERSION: 8 + ubuntu-22.04-11: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 22.04 + JAVA_VERSION: 11 + ubuntu-22.04-17: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 22.04 + JAVA_VERSION: 17 + ubuntu-22.04-21: + build: + context: . + dockerfile: ubuntu-test.Dockerfile + args: + IMAGE_VERSION: 22.04 + JAVA_VERSION: 21 pyroscope: image: 'grafana/pyroscope:latest' ports: diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..a595206 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/itest/query/go.sum b/itest/query/go.sum index 025de64..2f60bbe 100644 --- a/itest/query/go.sum +++ b/itest/query/go.sum @@ -1,15 +1,27 @@ +connectrpc.com/connect v1.14.0 h1:PDS+J7uoz5Oui2VEOMcfz6Qft7opQM9hPiKvtGC01pA= connectrpc.com/connect v1.14.0/go.mod h1:uoAq5bmhhn43TwhaKdGKN/bZcGtzPW1v+ngDTn5u+8s= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grafana/pyroscope/api v0.4.0 h1:J86DxoNeLOvtJhB1Cn65JMZkXe682D+RqeoIUiYc/eo= github.com/grafana/pyroscope/api v0.4.0/go.mod h1:MFnZNeUM4RDsDOnbgKW3GWoLSBpLzMMT9nkvhHHo81o= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/itest/query/main.go b/itest/query/main.go index 2350b2f..75529ea 100644 --- a/itest/query/main.go +++ b/itest/query/main.go @@ -23,13 +23,29 @@ func main() { err error } targets := []string{ - "alpine-3.16", - "alpine-3.17", - "alpine-3.18", - "alpine-3.19", - "ubuntu-18.04", - "ubuntu-20.04", - "ubuntu-22.04", + "alpine-3.16-8", + "alpine-3.16-11", + "alpine-3.16-17", + "alpine-3.17-8", + "alpine-3.17-11", + "alpine-3.17-17", + "alpine-3.18-8", + "alpine-3.18-11", + "alpine-3.18-18", + "alpine-3.19-8", + "alpine-3.19-11", + "alpine-3.19-17", + "ubuntu-18.04-8", + "ubuntu-18.04-11", + "ubuntu-18.04-17", + "ubuntu-20.04-8", + "ubuntu-20.04-11", + "ubuntu-20.04-17", + "ubuntu-20.04-21", + "ubuntu-22.04-8", + "ubuntu-22.04-11", + "ubuntu-22.04-17", + "ubuntu-22.04-21", } url := "http://localhost:4040" qc := querierv1connect.NewQuerierServiceClient( diff --git a/ubuntu-test.Dockerfile b/ubuntu-test.Dockerfile index 7cace3d..7b0b001 100644 --- a/ubuntu-test.Dockerfile +++ b/ubuntu-test.Dockerfile @@ -1,6 +1,8 @@ ARG IMAGE_VERSION=18.04 FROM ubuntu:${IMAGE_VERSION} -RUN apt-get update && apt-get install -y openjdk-11-jdk +ARG IMAGE_VERSION=18.04 +ARG JAVA_VERSION=11 +RUN apt-get update && apt-get install -y openjdk-${JAVA_VERSION}-jdk-headless WORKDIR /app ADD gradlew build.gradle settings.gradle /app/ ADD gradle gradle @@ -18,8 +20,6 @@ RUN javac demo/src/main/java/Fib.java ENV PYROSCOPE_LOG_LEVEL=debug ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040 ENV PYROSCOPE_UPLOAD_INTERVAL=5s -ARG IMAGE_VERSION=18.04 -ENV PYROSCOPE_APPLICATION_NAME=ubuntu-${IMAGE_VERSION} - +ENV PYROSCOPE_APPLICATION_NAME=ubuntu-${IMAGE_VERSION}-${JAVA_VERSION} CMD ["java", "-javaagent:/app/agent/build/libs/pyroscope.jar", "-cp", "demo/src/main/java/", "Fib"] From c2463039275930a2a2961e8be639913979a90565 Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Thu, 25 Jan 2024 13:05:17 +0700 Subject: [PATCH 04/10] fix --- .github/workflows/itest.yml | 30 +++++++++++++++++++++ Makefile | 8 +++--- alpine-test.Dockerfile | 2 +- itest/query/main.go | 53 ++++++++++++++++++++----------------- 4 files changed, 64 insertions(+), 29 deletions(-) diff --git a/.github/workflows/itest.yml b/.github/workflows/itest.yml index 4935050..f161119 100644 --- a/.github/workflows/itest.yml +++ b/.github/workflows/itest.yml @@ -9,6 +9,33 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + svc: + - 'alpine-3.16-8\' + - 'alpine-3.16-11' + - 'alpine-3.16-17' + - 'alpine-3.17-8' + - 'alpine-3.17-11' + - 'alpine-3.17-17' + - 'alpine-3.18-8' + - 'alpine-3.18-11' + - 'alpine-3.18-18' + - 'alpine-3.19-8' + - 'alpine-3.19-11' + - 'alpine-3.19-17' + - 'ubuntu-18.04-8' + - 'ubuntu-18.04-11' + - 'ubuntu-18.04-17' + - 'ubuntu-20.04-8' + - 'ubuntu-20.04-11' + - 'ubuntu-20.04-17' + - 'ubuntu-20.04-21' + - 'ubuntu-22.04-8' + - 'ubuntu-22.04-11' + - 'ubuntu-22.04-17' + - 'ubuntu-22.04-21' steps: - uses: actions/checkout@v2 - name: Install Go @@ -16,3 +43,6 @@ jobs: with: go-version: 1.21.6 - run: make itest + shell: bash + env: + ITEST_SERVICE: ${{ matrix.svc }} diff --git a/Makefile b/Makefile index b11bd25..e208d2c 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,10 @@ docker-example-expt: build docker-compose -f examples/docker-compose-expt.yml build docker-compose -f examples/docker-compose-expt.yml up +ITEST_SERVICE ?= + .PHONY: itest itest: - docker compose -f docker-compose-itest.yaml up --build --force-recreate - cd itest/query && go run . - docker compose -f docker-compose-itest.yaml down + docker compose -f docker-compose-itest.yaml up --build --force-recreate -d pyroscope $(ITEST_SERVICE) + cd itest/query && go run . $(ITEST_SERVICE) + docker compose -f docker-compose-itest.yaml down pyroscope $(ITEST_SERVICE) diff --git a/alpine-test.Dockerfile b/alpine-test.Dockerfile index 5b2a009..b880699 100644 --- a/alpine-test.Dockerfile +++ b/alpine-test.Dockerfile @@ -22,6 +22,6 @@ RUN javac demo/src/main/java/Fib.java ENV PYROSCOPE_LOG_LEVEL=debug ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040 - ENV PYROSCOPE_APPLICATION_NAME=alpine-${IMAGE_VERSION}-${JAVA_VERSION} +ENV PYROSCOPE_UPLOAD_INTERVAL=15s CMD ["java", "-javaagent:/app/agent/build/libs/pyroscope.jar", "-cp", "demo/src/main/java/", "Fib"] diff --git a/itest/query/main.go b/itest/query/main.go index 75529ea..534d941 100644 --- a/itest/query/main.go +++ b/itest/query/main.go @@ -22,31 +22,34 @@ func main() { target string err error } - targets := []string{ - "alpine-3.16-8", - "alpine-3.16-11", - "alpine-3.16-17", - "alpine-3.17-8", - "alpine-3.17-11", - "alpine-3.17-17", - "alpine-3.18-8", - "alpine-3.18-11", - "alpine-3.18-18", - "alpine-3.19-8", - "alpine-3.19-11", - "alpine-3.19-17", - "ubuntu-18.04-8", - "ubuntu-18.04-11", - "ubuntu-18.04-17", - "ubuntu-20.04-8", - "ubuntu-20.04-11", - "ubuntu-20.04-17", - "ubuntu-20.04-21", - "ubuntu-22.04-8", - "ubuntu-22.04-11", - "ubuntu-22.04-17", - "ubuntu-22.04-21", - } + targets := os.Args[1:] + if len(targets) == 0 { + targets = []string{ + "alpine-3.16-8", + "alpine-3.16-11", + "alpine-3.16-17", + "alpine-3.17-8", + "alpine-3.17-11", + "alpine-3.17-17", + "alpine-3.18-8", + "alpine-3.18-11", + "alpine-3.18-18", + "alpine-3.19-8", + "alpine-3.19-11", + "alpine-3.19-17", + "ubuntu-18.04-8", + "ubuntu-18.04-11", + "ubuntu-18.04-17", + "ubuntu-20.04-8", + "ubuntu-20.04-11", + "ubuntu-20.04-17", + "ubuntu-20.04-21", + "ubuntu-22.04-8", + "ubuntu-22.04-11", + "ubuntu-22.04-17", + "ubuntu-22.04-21", + } + } url := "http://localhost:4040" qc := querierv1connect.NewQuerierServiceClient( http.DefaultClient, From 3b17607afc4829fb78d693a418546bae2354b735 Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Thu, 25 Jan 2024 13:12:38 +0700 Subject: [PATCH 05/10] fix --- dockertest.sh | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100755 dockertest.sh diff --git a/dockertest.sh b/dockertest.sh deleted file mode 100755 index 7b15d22..0000000 --- a/dockertest.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/zsh -set -ex - -DOCKERFILE=$1 -IMAGE_VERSION=$2 -PORT=$3 - -function usage() { - echo "Usage: ./itest.sh " - exit 1 -} -if [ -z "${DOCKERFILE}" ]; then - usage -fi - -if [ -z "${IMAGE_VERSION}" ]; then - usage -fi - -TEST_NAME="pyroscope-java-dockertest-$(basename ${DOCKERFILE} | cut -f 1 -d .)-${IMAGE_VERSION}" -SERVER_CONTAINER_NAME="${TEST_NAME}-server" -TEST_CONTAINER_NAME="${TEST_NAME}-test" - -docker kill ${SERVER_CONTAINER_NAME} || true -docker kill ${TEST_CONTAINER_NAME} || true - - -docker pull grafana/pyroscope:latest -docker run --rm -tid -p${PORT}:4040 --name=${SERVER_CONTAINER_NAME} grafana/pyroscope:latest - -docker build -t ${TEST_CONTAINER_NAME} --build-arg="IMAGE_VERSION=${IMAGE_VERSION}" -f ${DOCKERFILE} . -docker run --rm --name=${TEST_CONTAINER_NAME} ${TEST_CONTAINER_NAME} - From ff30e9bdc0a342dea0efa62857672afcb5f4feb5 Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Thu, 25 Jan 2024 13:32:15 +0700 Subject: [PATCH 06/10] fix --- .github/workflows/itest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/itest.yml b/.github/workflows/itest.yml index f161119..25165e8 100644 --- a/.github/workflows/itest.yml +++ b/.github/workflows/itest.yml @@ -1,4 +1,4 @@ -name: Test +name: Integration smoke test on: push: @@ -7,13 +7,13 @@ on: branches: [main] jobs: - test: + integration-smoke-test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: svc: - - 'alpine-3.16-8\' + - 'alpine-3.16-8' - 'alpine-3.16-11' - 'alpine-3.16-17' - 'alpine-3.17-8' From 28c4b53a6d5d81f7f035b6df9659ef116052234a Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Fri, 26 Jan 2024 10:27:13 +0700 Subject: [PATCH 07/10] fix --- .github/workflows/itest.yml | 2 +- itest/query/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/itest.yml b/.github/workflows/itest.yml index 25165e8..5c8141c 100644 --- a/.github/workflows/itest.yml +++ b/.github/workflows/itest.yml @@ -21,7 +21,7 @@ jobs: - 'alpine-3.17-17' - 'alpine-3.18-8' - 'alpine-3.18-11' - - 'alpine-3.18-18' + - 'alpine-3.18-17' - 'alpine-3.19-8' - 'alpine-3.19-11' - 'alpine-3.19-17' diff --git a/itest/query/main.go b/itest/query/main.go index 534d941..0bc125d 100644 --- a/itest/query/main.go +++ b/itest/query/main.go @@ -33,7 +33,7 @@ func main() { "alpine-3.17-17", "alpine-3.18-8", "alpine-3.18-11", - "alpine-3.18-18", + "alpine-3.18-17", "alpine-3.19-8", "alpine-3.19-11", "alpine-3.19-17", From 903479bb8db6c9c1ac6ad36837ed69ce910abfcf Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Fri, 26 Jan 2024 13:57:42 +0700 Subject: [PATCH 08/10] fix --- itest/query/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/itest/query/main.go b/itest/query/main.go index 0bc125d..9ff42dd 100644 --- a/itest/query/main.go +++ b/itest/query/main.go @@ -84,7 +84,8 @@ func main() { } func testTarget(ctx context.Context, qc querierv1connect.QuerierServiceClient, target string) error { - needle := "Fib$$Lambda$_.run;Fib.lambda$appLogic$0;Fib.fib;Fib.fib;Fib.fib;Fib.fib;" + //needle := "Fib$$Lambda_.run;Fib.lambda$appLogic$0;Fib.fib;Fib.fib;Fib.fib;Fib.fib;" // us this one when https://github.com/grafana/jfr-parser/pull/28/files lands pyroscope docker tag + needle := "run;Fib.lambda$appLogic$0;Fib.fib;Fib.fib;Fib.fib;Fib.fib;" ticker := time.NewTicker(time.Second * 5) n := 0 for { From 11965731fbc9079a2b5e2000f1e4e14ba01f486a Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Mon, 29 Jan 2024 19:57:54 +0700 Subject: [PATCH 09/10] review fixes --- alpine-test.Dockerfile | 2 +- demo/src/main/java/Fib.java | 8 -------- ubuntu-test.Dockerfile | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/alpine-test.Dockerfile b/alpine-test.Dockerfile index b880699..ebbcabf 100644 --- a/alpine-test.Dockerfile +++ b/alpine-test.Dockerfile @@ -9,7 +9,7 @@ ADD gradle gradle RUN ./gradlew --no-daemon --version ADD agent agent ADD async-profiler-context async-profiler-context -add demo/build.gradle demo/ +ADD demo/build.gradle demo/ RUN ./gradlew --no-daemon shadowJar diff --git a/demo/src/main/java/Fib.java b/demo/src/main/java/Fib.java index 83e94f2..7686294 100644 --- a/demo/src/main/java/Fib.java +++ b/demo/src/main/java/Fib.java @@ -37,14 +37,6 @@ private static void appLogic() { } } - private static Map mapOf(String... args) { - Map staticLabels = new HashMap<>(); - for (int i = 0; i < args.length; i += 2) { - staticLabels.put(args[i], args[i + 1]); - } - return staticLabels; - } - private static long fib(Long n) throws InterruptedException { if (n == 0L) { return 0L; diff --git a/ubuntu-test.Dockerfile b/ubuntu-test.Dockerfile index 7b0b001..a15966c 100644 --- a/ubuntu-test.Dockerfile +++ b/ubuntu-test.Dockerfile @@ -9,7 +9,7 @@ ADD gradle gradle RUN ./gradlew --no-daemon --version ADD agent agent ADD async-profiler-context async-profiler-context -add demo/build.gradle demo/ +ADD demo/build.gradle demo/ RUN ./gradlew --no-daemon shadowJar From 3562c0216b17dc96a6d887a2c230f13bdb0c982b Mon Sep 17 00:00:00 2001 From: Tolya Korniltsev Date: Mon, 29 Jan 2024 19:59:56 +0700 Subject: [PATCH 10/10] review fixes --- async-profiler-context/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/async-profiler-context/build.gradle b/async-profiler-context/build.gradle index f71414b..aa66c49 100644 --- a/async-profiler-context/build.gradle +++ b/async-profiler-context/build.gradle @@ -87,8 +87,6 @@ task asyncProfilerLib { doLast { suffixes.forEach { suffix, ext -> -// def repo = "https://github.com/jvm-profiling-tools/async-profiler" -// def repo = "https://github.com/korniltsev/async-profiler" def repo = "https://github.com/grafana/async-profiler" download { src "$repo/releases/download/v${asyncProfilerVersion}/async-profiler-${asyncProfilerVersion}-${suffix}.${ext}"