🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

graphite-cli

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphite-cli

a simple tool for making http calls to graphite

0.1.12
latest
Source
npm
Version published
Weekly downloads
10
233.33%
Maintainers
1
Weekly downloads
 
Created
Source

graphite-cli

makes requests to graphite's /render API

$ npm install -g graphite-cli
Usage: graphite [options]

  -t, --target String  target
  -f, --from String    interval - default: -1day
  -s, --stdin          read target from stdin
  -o, --format String  output format (json, csv, raw)
  -p, --print-target   print target
  -i, --image-url      print graph image URL
  -b, --browser        open as image in browser
  -c, --curl           send graph image data to stdout
  -h, --help           displays help

setup

graphite-cli reads URL to graphite from GRAPHITE_URL environment variable

$ export GRAPHITE_URL=http://graphite

examples

get data for a random walk as JSON for last 5 minutes

$ graphite --from=-5min --target="randomWalk('randomWalk')" -o csv
randomWalk,2015-03-05 15:32:03,0
randomWalk,2015-03-05 15:33:03,0.21089740446196048
randomWalk,2015-03-05 15:34:03,0.30473267268105897
randomWalk,2015-03-05 15:35:03,0.5150866652261553
randomWalk,2015-03-05 15:36:03,0.2311229472001599

read target from clipboard and open the graph in browser

$ pbpaste | graphite -s -b

print graph image url of target piped to stdin

$ echo "randomWalk('randomWalk')" | graphite -s -i
http://graphite/render?from=-1day&target=randomWalk('randomWalk')

get status codes for last hour summarized into 10min intervals

$ graphite --target="aliasByNode(summarize(counts.web.status_code.*), '10m', 'sum', false), 6)" \
  --from=-1h | tr '|' , | cut -d',' -f1,5- | sed 's/\.0//g' | column -t -s, | sort -k1
200  176  213  207  227  292  320  0
201  0    0    0    0    2    0    0
202  0    0    0    0    0    0    0
204  0    0    1    0    0    0    0
302  0    2    0    0    0    2    0
304  0    0    0    0    2    4    0
400  1    0    0    0    0    0    0
401  0    0    0    0    0    0    0
404  0    0    0    0    1    0    0
409  0    0    0    0    0    0    0
429  0    0    0    0    0    0    0
500  0    0    0    0    0    0    0

FAQs

Package last updated on 24 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts