Mercurial > public > ssdt-docker
annotate scripts/metrics.sh @ 388:23d40b345e1e
INV-197 create db backup helper scripts for inventory and workflow
author | Matt Calmes <calmes@ssdt-ohio.org> |
---|---|
date | Mon, 18 Oct 2021 06:33:33 -0400 |
parents | 5c36bfba7014 |
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" |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
13 docker run --network ${project}_default --rm docker.ssdt.io/ssdt-utils curl -s http://${ip}:8080/metrics/admin/metrics?pretty=true |
5c36bfba7014
DEP-12: script to dump application metrics and thread dumps to stdout
smith@nwoca.org
parents:
191
diff
changeset
|
14 docker run --network ${project}_default --rm docker.ssdt.io/ssdt-utils curl -s http://${ip}:8080/metrics/admin/threads |