recursivefunk / fly-metrix

AWS CloudWatch metrics, with style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fly Metrix

workflow

Stylish (API that I like) CloudWatch metrics wrapper. Not production ready.

export AWS_ACCESS_KEY_ID=your_key # Has appropriate IAM rights for putMetricData()
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
export AWS_DEFAULT_REGION=us-east-1 # optional, defaults to us-east-1

Counter

const namespace = 'MyMetrics';
const FlyMetrix = require('fly-metrix');
const metrics = FlyMetrix(namespace);
const counter = metrics.Counter('the_things');

(async function () {
  counter.count(); // 0
  // ...
  counter.inc(); // 1
  // ...
  counter.inc(2); // 3
  await counter.report(); // Report 3 for 'MyMetrics/the_things'
  counter.count(); // 0
})();

About

AWS CloudWatch metrics, with style


Languages

Language:JavaScript 97.7%Language:Makefile 2.3%