Skip to content

Commit d2fe833

Browse files
authored
Merge pull request #11 from tejal29/patch-1
Add Kaniko example to run SlowJam inside a K8 container
2 parents fdbd863 + 7d3407b commit d2fe833

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ By default, this will poll the stack every 125ms.
5757

5858
Install slowjam:
5959

60-
`go install github.com/google/slowjam/cmd/slowjam`
60+
`go get github.com/google/slowjam/cmd/slowjam`
6161

6262
Analyze a stacklog using the interactive webserver:
6363

@@ -77,7 +77,9 @@ To output a text summary to `out.txt`:
7777
slowjam -html out.txt /path/to/stack.slog
7878
```
7979

80-
## Real World Example
80+
## Real World Examples
81+
82+
1. Integrating SlowJam with Go binary.
8183

8284
Here's an example PR to integrate SlowJam analysis into minikube: [minikube#8329](https://github.com/kubernetes/minikube/pull/8329).
8385

@@ -95,4 +97,14 @@ What minikube contributors discovered with these results were:
9597
* Functions which could obviously be run in parallel were executed in serial.
9698
* Functions which we expected to be fast (<1s) were slow (10s). In many cases we were able to remove or rewrite these functions to do less work.
9799

98-
The net result was a 2.5X reduction in start-up latency: from ~66 seconds to ~26 seconds.
100+
The net result was a 2.5X reduction in start-up latency: from ~66 seconds to ~26 seconds.
101+
102+
2. Analyzing an integrated Go binary in kubernetes cluster.
103+
104+
Here's an pod config to analyze a Go binary running on a kuberenets cluster: [Pod SlowJam Profile](https://github.com/GoogleContainerTools/kaniko/blob/master/examples/pod-build-profile.yaml)
105+
106+
In this Pod Config,
107+
1. Set the environment variable `STACKLOG_PATH` to to generate slowjam profile.
108+
2. Copy the generated stack samples to a accessible location in [Container Lifecyle hooks](https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/#define-poststart-and-prestop-handlers) `pre-stop`.
109+
110+

0 commit comments

Comments
 (0)