Skip to content

Commit

Permalink
chore(examples): update examples (#2655)
Browse files Browse the repository at this point in the history
  • Loading branch information
korniltsev authored Nov 9, 2023
1 parent 25084ea commit aec1df6
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 24 deletions.
6 changes: 3 additions & 3 deletions docs/sources/configure-client/language-sdks/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ aliases:
1. Obtain `Pyroscope.Profiler.Native.so` and `Pyroscope.Linux.ApiWrapper.x64.so` from the [latest tarball](https://github.com/pyroscope-io/pyroscope-dotnet/releases/):

```bash
curl -s -L https://github.com/grafana/pyroscope-dotnet/releases/download/v0.8.10-pyroscope/pyroscope.0.8.10-glibc-x86_64.tar.gz | tar xvz -C .
curl -s -L https://github.com/grafana/pyroscope-dotnet/releases/download/v0.8.14-pyroscope/pyroscope.0.8.14-glibc-x86_64.tar.gz | tar xvz -C .
```
Or copy them from the [latest docker image](https://hub.docker.com/r/pyroscope/pyroscope-dotnet/tags):
```dockerfile
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
````

2. Set the following required environment variables to enable profiler
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/configure-client/language-sdks/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ First, add Pyroscope dependency
<dependency>
<groupId>io.pyroscope</groupId>
<artifactId>agent</artifactId>
<version>0.12.1</version>
<version>0.12.2</version>
</dependency>
```

```gradle
implementation("io.pyroscope:agent:0.12.1")
implementation("io.pyroscope:agent:0.12.2")
```

{{< /code >}}
Expand Down
4 changes: 2 additions & 2 deletions examples/dotnet/fast-slow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0

WORKDIR /dotnet

COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so

ADD example .

Expand Down
4 changes: 2 additions & 2 deletions examples/dotnet/fast-slow/musl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine

WORKDIR /dotnet

COPY --from=pyroscope/pyroscope-dotnet:0.8.10-musl /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-musl /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-musl /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-musl /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so

ADD example .

Expand Down
4 changes: 2 additions & 2 deletions examples/dotnet/rideshare/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0

WORKDIR /dotnet

COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so


ADD example .
Expand Down
6 changes: 6 additions & 0 deletions examples/dotnet/rideshare/example/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using Microsoft.AspNetCore.Http;

Expand All @@ -10,8 +11,13 @@ namespace Example;

public static class Program
{
private static readonly List<FileStream> Files = new();
public static void Main(string[] args)
{
for (int i = 0; i < 1024; i++)
{
Files.Add(File.Open("/dev/null", FileMode.Open, FileAccess.Read, FileShare.Read));
}
object globalLock = new();
var strings = new List<string>();
var orderService = new OrderService();
Expand Down
1 change: 1 addition & 0 deletions examples/dotnet/rideshare/load-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'us-east',
'eu-north',
'ap-south',
'ap-south-alpine',
]

VEHICLES = [
Expand Down
4 changes: 2 additions & 2 deletions examples/dotnet/rideshare/musl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine

WORKDIR /dotnet

COPY --from=pyroscope/pyroscope-dotnet:0.8.10-musl /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-musl /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-musl /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-musl /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so


ADD example .
Expand Down
4 changes: 2 additions & 2 deletions examples/dotnet/web-new/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:6.0

WORKDIR /dotnet

COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.10-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so
COPY --from=pyroscope/pyroscope-dotnet:0.8.14-glibc /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so

ADD example .

Expand Down
2 changes: 0 additions & 2 deletions examples/golang-push/rideshare/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,6 @@ github.com/grafana/pyroscope-go v1.0.4 h1:oyQX0BOkL+iARXzHuCdIF5TQ7/sRSel1YFViMH
github.com/grafana/pyroscope-go v1.0.4/go.mod h1:0d7ftwSMBV/Awm7CCiYmHQEG8Y44Ma3YSjt+nWcWztY=
github.com/grafana/pyroscope-go/godeltaprof v0.1.4 h1:mDsJ3ngul7UfrHibGQpV66PbZ3q1T8glz/tK3bQKKEk=
github.com/grafana/pyroscope-go/godeltaprof v0.1.4/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko=
github.com/grafana/pyroscope-go/otelpyroscope v0.0.0-20231102111113-9e49fee7f8d6 h1:QM3xkDAxlYqU/tYpXhkoHwmWbbPTWpKz242AcCx2Djg=
github.com/grafana/pyroscope-go/otelpyroscope v0.0.0-20231102111113-9e49fee7f8d6/go.mod h1:OhQkRYO2Iepoi2sRGUhyMp0tq1w57idp1/sz6OZGAA4=
github.com/grafana/pyroscope-go/otelpyroscope v0.0.0-20231106043052-bafdc31ed4ec h1:ATck53IKZX2ChrWsrYzoAIs6b85EO7r0Qktwk2Qcnfg=
github.com/grafana/pyroscope-go/otelpyroscope v0.0.0-20231106043052-bafdc31ed4ec/go.mod h1:OhQkRYO2Iepoi2sRGUhyMp0tq1w57idp1/sz6OZGAA4=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
Expand Down
2 changes: 1 addition & 1 deletion examples/java/fib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /opt/app

RUN apt-get update && apt-get install ca-certificates -y && update-ca-certificates && apt-get install -y git

ADD https://github.com/grafana/pyroscope-java/releases/download/v0.12.1/pyroscope.jar /opt/app/pyroscope.jar
ADD https://github.com/grafana/pyroscope-java/releases/download/v0.12.2/pyroscope.jar /opt/app/pyroscope.jar

COPY Main.java ./

Expand Down
2 changes: 1 addition & 1 deletion examples/java/rideshare/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ COPY --from=builder /opt/app/build/libs/rideshare-1.0-SNAPSHOT.jar /opt/app/buil

WORKDIR /opt/app

ADD https://github.com/grafana/pyroscope-java/releases/download/v0.12.1/pyroscope.jar /opt/app/pyroscope.jar
ADD https://github.com/grafana/pyroscope-java/releases/download/v0.12.2/pyroscope.jar /opt/app/pyroscope.jar

CMD ["java", "-Dserver.port=5000", "-javaagent:pyroscope.jar", "-jar", "./build/libs/rideshare-1.0-SNAPSHOT.jar" ]
2 changes: 1 addition & 1 deletion examples/java/rideshare/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
implementation("io.pyroscope:agent:0.12.1")
implementation("io.pyroscope:agent:0.12.2")
implementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
Expand Down
2 changes: 1 addition & 1 deletion examples/java/simple/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM openjdk:11.0.11-jdk

WORKDIR /opt/app

ADD https://github.com/grafana/pyroscope-java/releases/download/v0.12.1/pyroscope.jar /opt/app/pyroscope.jar
ADD https://github.com/grafana/pyroscope-java/releases/download/v0.12.2/pyroscope.jar /opt/app/pyroscope.jar

COPY Main.java ./Main.java
RUN javac Main.java
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/grafana/dskit v0.0.0-20231003142331-80423d8864b9
github.com/grafana/jfr-parser v0.7.2-0.20230831140626-08fa3a941bf8
github.com/grafana/pyroscope-go v1.0.3
github.com/grafana/pyroscope-go/godeltaprof v0.1.4
github.com/grafana/pyroscope-go/godeltaprof v0.1.5
github.com/grafana/pyroscope/api v0.0.0-00010101000000-000000000000
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ github.com/grafana/objstore v0.0.0-20230727114110-2394c72a3ec7 h1:UrHG0C+TawTkMx
github.com/grafana/objstore v0.0.0-20230727114110-2394c72a3ec7/go.mod h1:IS7Z25+0KaknyU2P5PTP/5hwY6Yr/FzbInF88Yd5auU=
github.com/grafana/pyroscope-go v1.0.3 h1:8WWmItzLfg4m8G+j//ElSjMeMr88Y6Lvblar6qeTyKk=
github.com/grafana/pyroscope-go v1.0.3/go.mod h1:0d7ftwSMBV/Awm7CCiYmHQEG8Y44Ma3YSjt+nWcWztY=
github.com/grafana/pyroscope-go/godeltaprof v0.1.4 h1:mDsJ3ngul7UfrHibGQpV66PbZ3q1T8glz/tK3bQKKEk=
github.com/grafana/pyroscope-go/godeltaprof v0.1.4/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko=
github.com/grafana/pyroscope-go/godeltaprof v0.1.5 h1:gkFVqihFRL1Nro2FCC0u6mW47jclef96Zu8I/ykq+4E=
github.com/grafana/pyroscope-go/godeltaprof v0.1.5/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
Expand Down

0 comments on commit aec1df6

Please sign in to comment.