Mercurial > public > ssdt-docker
annotate scripts/metrics.sh @ 605:46a67e7afd98 release/2.23.0 tip
flow: Created branch 'release/2.23.0'.
author | Marc Davis <marc.davis@mcoecn.org> |
---|---|
date | Wed, 18 Sep 2024 20:38:06 -0400 |
parents | 9afc8cb478f6 |
children |
rev | line source |
---|---|
55
77ff739c078d
add script to provide shortened docker ps with ssdt labels
smith@nwoca.org
parents:
diff
changeset
|
1 #!/bin/bash |
206
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
2 # Dump application metrics and thread stacks to console. |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
3 # |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
4 |
191
fea886ba7279
DEP-12: add source for .functions.sh to all scripts using compose
smith@nwoca.org
parents:
159
diff
changeset
|
5 source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh" |
fea886ba7279
DEP-12: add source for .functions.sh to all scripts using compose
smith@nwoca.org
parents:
159
diff
changeset
|
6 |
206
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
7 container=$(composeGetContainer ${1?"Must specify the app service to connect to"} ) |
159 | 8 |
206
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
9 project=$(composeGetProject ${1} ) |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
10 ip=$(docker inspect -f "{{with .NetworkSettings.Networks}}{{.${project}_default.IPAddress}}{{end}}" $container) |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
11 |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
12 echo "connecting to ${container} in ${project} at ${ip}:8080" |
574
9afc8cb478f6
Domain changed from ssdt.io to ssdt-ohio.org
Marc Davis <marc.davis@mcoecn.org>
parents:
206
diff
changeset
|
13 docker run --network ${project}_default --rm docker.ssdt-ohio.org/ssdt-utils curl -s http://${ip}:8080/metrics/admin/metrics?pretty=true |
9afc8cb478f6
Domain changed from ssdt.io to ssdt-ohio.org
Marc Davis <marc.davis@mcoecn.org>
parents:
206
diff
changeset
|
14 docker run --network ${project}_default --rm docker.ssdt-ohio.org/ssdt-utils curl -s http://${ip}:8080/metrics/admin/threads |