Mercurial > public > ssdt-docker
annotate scripts/metrics.sh @ 246:7441285bf326 production v2.0.1
flow: Merged <hotfix> 'v2.0.1' to <master> ('production').
author | smith@nwoca.org |
---|---|
date | Thu, 11 Jan 2018 18:32:51 +0000 |
parents | 5c36bfba7014 |
children | 9afc8cb478f6 |
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 |