0.2.2 • Published 8 years ago

easy-stat v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

About

this is a tiny tool for recording and writing some statistic data to log files.

Usage

npm install easy-stat --save

// 'demo' is the name for identifying from different instances of EasyStat;

var opt = {
  interval: 10000,  // interval value in 'ms' for writing data to log file
  logger: console.log  // method to write log data
};

var demoStat = require('esay-stat')('demo', opt);
demoStat.launch();

// some where need to record the count of calling an api
// here I want record api_called for 5 times
demoStat.touch('api_called', 5);

then the demoStat will sum and write the total api_called to the log file which would looks like:

// name.key         timestamp  value
demoStat.api_called 1463582916 136
0.2.2

8 years ago

0.2.1

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago