mirror of https://github.com/mthenw/frontail.git
Track --number param
parent
29d660623f
commit
4d5f29b209
2
index.js
2
index.js
|
@ -26,7 +26,7 @@ if (program.args.length === 0) {
|
|||
/**
|
||||
* Init usage statistics
|
||||
*/
|
||||
const stats = usageStats(!program.disableUsageStats);
|
||||
const stats = usageStats(!program.disableUsageStats, program);
|
||||
stats.track('runtime', 'init');
|
||||
stats.time('runtime', 'runtime');
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ const pkg = require('../package.json');
|
|||
const trackingID = 'UA-129582046-1';
|
||||
|
||||
// Usage stats
|
||||
function Stats(enabled) {
|
||||
function Stats(enabled, opts) {
|
||||
this.timer = {};
|
||||
|
||||
if (enabled === true) {
|
||||
|
@ -30,6 +30,7 @@ function Stats(enabled) {
|
|||
tracker.set('cd2', process.arch); // arch
|
||||
tracker.set('cd3', process.version.match(/^v(\d+\.\d+)/)[1]); // Node version
|
||||
tracker.set('cd4', isDocker()); // is Docker
|
||||
tracker.set('cd5', opts.number !== 10); // is --number parameter set
|
||||
this.tracker = tracker;
|
||||
}
|
||||
|
||||
|
@ -63,4 +64,4 @@ Stats.prototype.timeEnd = function timeEnd(category, action, cb) {
|
|||
this.tracker.timing(category, action, Date.now() - this.timer[category][action]).send(cb);
|
||||
};
|
||||
|
||||
module.exports = enabled => new Stats(enabled);
|
||||
module.exports = (enabled, opts) => new Stats(enabled, opts);
|
||||
|
|
Loading…
Reference in New Issue