Skip to content

Commit

Permalink
Merge remote branch 'mmattozzi/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjlee committed Jun 30, 2011
2 parents a4b0008 + e6a5c00 commit f5fc13c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/simpletest.ex.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ nl.run({
'result-codes',
{ name: 'latency', percentiles: [0.9, 0.99] },
'concurrency',
'rps',
'uniques',
{ name: 'http-errors', successCodes: [200,404], log: 'http-errors.log' }
],
Expand Down
9 changes: 9 additions & 0 deletions lib/monitoring/collectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var stats = require('../stats');
var Histogram = stats.Histogram;
var Peak = stats.Peak;
var ResultsCounter = stats.ResultsCounter;
var Rate = stats.Rate;
var Uniques = stats.Uniques;
var Accumulator = stats.Accumulator;
var LogFile = stats.LogFile;
Expand All @@ -41,6 +42,14 @@ StatsCollectors['result-codes'] = function ResultCodesCollector() {
self.end = function(context, http) { self.stats.put(http.res.statusCode); };
};

/** Track requests per second, storing stats in a stats.js#Rate object. The client must call
.end({res: http.ClientResponse}). */
StatsCollectors['rps'] = function RpsCollector() {
var self = this;
self.stats = new Rate();
self.end = function(context, http) { self.stats.put(); };
};

/** Track a status code that is returned in an HTTP header, storing stats in a stats.js#ResultsCounter
object. The client must call .end({res: http.ClientResponse}). */
StatsCollectors['header-code'] = function HeaderCodeCollector(params) {
Expand Down
4 changes: 2 additions & 2 deletions nodeload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f5fc13c

Please sign in to comment.