Statsum Client for Node.js
A Javascript client library for statsum.
Usage:
let Statsum = ; // Create a client objectlet configurer = async { // this might be fetched remotely, for example return // project name to which stats should be sent project: 'example-project' // base URL (hostname only) of the statsum server // NOTE: this is unrelated to the taskcluster "baseUrl" baseUrl: 'https://statsum.example.com' // access token token: 'KEY' // expiration date (before which configurer will be called again) expires: };let statsum = configurer project: 'test'; // Send metricsstatsum;statsum; // Create a child client (enforcing a prefix)let child = statsumprefix'child';child; // submitted as 'child.my-counter'child; // submitted as 'child.my-timer' // Send tagged metricsstatsum;// Will be reported 4 time, the equivalent of:statsum;statsum;statsum;statsum;// Use this feature with care, too many tags and the number of metrics explodes.