Skip to content

samsel/wreck-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wreck-stats

wreck-stats is wreck with a stats logging feature.

Build Status

Usage

var Wreck = require('wreck-stats');

// All the methods exposed by Wreck
// https://github.com/hapijs/wreck#advanced
// are available while using wreck-stats.

// Additionally, you can define your logger on Wreck-Stats like below

// your logger
function Logger(stats) {
  console.log(stats);
}

// give your logger to Wreck for logging
// Note: this is a one time configuration.
Wreck.setLogger(Logger);

Wreck.get('https://google.com/', function (err, res, payload) {
    /* do stuff */
});

stats

The object that contains the stats info for each request made by Wreck. It has the below properties.

  • id - A unique identifier string for each request.
  • method - The HTTP methods of the request.
  • uri - The URI of the request.
  • statusCode - The HTTP response status code.
  • duration - The duration taken to process the request (in milliseconds).

About

wreck-stats is wreck with a stats logging feature.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published