How to use the Bench function from hoek

Find comprehensive JavaScript hoek.Bench code examples handpicked from public code repositorys.

19
20
21
22
23
24
25
26
27
28
};


internals.ProcessMonitor.prototype.delay = function (callback) {

    var bench = new Hoek.Bench();
    setImmediate(function () {

        return callback(null, bench.elapsed());
    });
fork icon165
star icon1
watch icon2

+ 3 other calls in file

17
18
19
20
21
22
23
24
25
statsd.gauge('os.gauge.load.short', load.pop());
statsd.gauge('node.gauge.process.rss', memory.rss);
statsd.gauge('node.gauge.process.heapTotal', memory.heapTotal);
statsd.gauge('node.gauge.process.heapUsed', memory.heapUsed);

var bench = new hoek.Bench();
setImmediate(function () {
  statsd.gauge('node.gauge.process.event.delay', bench.elapsed());
});
fork icon1
star icon0
watch icon2

25
26
27
28
29
30
31
32
33

Events.EventEmitter.call(this);

// Take measurement as soon as possible

this._bench = new Hoek.Bench();
var now = Date.now();

// Public members
fork icon0
star icon0
watch icon10

64
65
66
67
68
69
70
71
72
};


internals.handler = function (request, callback) {

    var timer = new Hoek.Bench();
    var finalize = function (response) {

        // Check for Error result
fork icon0
star icon0
watch icon0

99
100
101
102
103
104
105
106
107
108
// Server load

Hoek.assert(this.settings.load.sampleInterval || (!this.settings.load.maxEventLoopDelay && !this.settings.load.maxHeapUsedBytes && !this.settings.load.maxRssBytes), 'Load sample interval must be set in enable load limits');

this._eventLoopTimer = null;
this._loadBench = new Hoek.Bench();
this.load = {
    eventLoopDelay: 0,
    heapUsed: 0,
    rss: 0
fork icon0
star icon0
watch icon3