Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 1.07 KB

sample.md

File metadata and controls

42 lines (26 loc) · 1.07 KB

Metrics Example - Memory Usage

Installation

npm install gcmetrics -g

Auth

gcmetric -t auth -s 288173501788-9fh14iojjmehakjtgkhoubdiaguppn1h@developer.gserviceaccount.com \
  -k $HOME/.gcpkeys/mitac-cp300-taipei101/mitac-cp300-taipei101-8c0662095ef9.pem \
  -p mitac-cp300-taipei101

Create a metric

gcmetric -t init -n mymetric -i firstid -d "test first id"

Insert data to metric

while [ true ] ; do gcmetric -t simple -n mymetric -d `free | grep Mem | awk '{print $3}'`; sleep 3 ; done

Add to Cloud Monitor

Cloud Monitor is made by StackDriver and integrated to Google Cloud Platform, we can easily integrate it with chart and alert...

Setting the dashboard chart...

setup dashboard chart

The chart from custom metric...

chart with custom metric