Cargo watch ignores local metrics (#4384)

This commit is contained in:
Jack May 2019-05-22 00:08:18 -07:00 committed by GitHub
parent 578c2ad3ea
commit e5b7aead12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 6 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
/book/src/img/
/book/src/tests.ok
/farf/
/metrics/scripts/lib/
/solana-release/
solana-release.tar.bz2
/target/

View File

@ -1 +0,0 @@
/lib

View File

@ -7,7 +7,7 @@ Start the local metric services:
`$ ./start.sh`
Metrics are enabled on a per-shell basis which means you must `source` the following scripts in each shell in which you start an application you wish to collect metrics from. For example, if running a Solana fullnode you must call `source ./enable.sh` before starting the node.
Metrics are enabled on a per-shell basis which means you must `source` the following scripts in each shell in which you start an application you wish to collect metrics from. For example, if running a Solana fullnode you must call `source ./enable.sh` before starting the node:
`$ source ./enable.sh`
@ -15,6 +15,11 @@ Once metrics have been started and you have an application running you can view
http://localhost:3000/d/local/local-monitor
To test that things are working correctly you can send a test airdrop data point and then check the
metrics dashboard:
`$ ./test.sh`
Stop metric services:
`$ ./stop.sh`
@ -26,11 +31,10 @@ adhoc metrics collection/viewing
* Linux - `sudo apt-get install influxdb-client`
* macOS - `brew install influxdb`
Simple example of pulling all airdrop measurements out of the `testnet` database:
Simple example of pulling all `thinclient` measurements out
of the `local` database:
```sh
$ influx -database local -username admin -password admin -execute 'select * from thinclient'
$ influx -database testnet -username admin -password admin -execute 'SELECT * FROM "drone-airdrop"'
```
Reference: https://docs.influxdata.com/influxdb/v1.5/query_language/
@ -39,7 +43,7 @@ Reference: https://docs.influxdata.com/influxdb/v1.5/query_language/
To monitor activity, run one of:
```
```sh
$ docker logs -f influxdb
$ docker logs -f grafana
```

27
metrics/scripts/test.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Test local metrics by sending a airdrop datapoint
#
set -e
cd "$(dirname "$0")"
# shellcheck source=metrics/scripts/enable.sh
source ./enable.sh
if [[ -z $INFLUX_DATABASE || -z $INFLUX_USERNAME || -z $INFLUX_PASSWORD ]]; then
echo Influx user credentials not found
exit 0
fi
host="https://localhost:8086"
if [[ -n $INFLUX_HOST ]]; then
host="$INFLUX_HOST"
fi
set -x
point="drone-airdrop,localmetrics=test request_amount=1i,request_current=1i"
echo "${host}/write?db=${INFLUX_DATABASE}&u=${INFLUX_USERNAME}&p={$INFLUX_PASSWORD}" \
| xargs curl -XPOST --data-binary "$point"