annotate scripts/metrics.sh @ 427:2201156ad763

USASR-5154 added tomcat for java 17
author belknapSSDT <zach.belknap@mcoecn.org>
date Wed, 27 Sep 2023 11:49:10 -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
303259c08b7d DEP-12: update backup scripts
smith@nwoca.org
parents: 85
diff changeset
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