Giter VIP home page Giter VIP logo

analog's Introduction

analog - Instrumentation of the Node.js request object for analytics

Makes it easy to collect data optimized for site analytics using whatever existing logging system you have.

Usage

var instrument = new (analog.Analog)();

var interaction_metadata = instrument.transform(request, response, response_body);

The above results in a flat dictionary of request data like the one below:

{ request.socket.bufferSize=0, request.socket.fd=8, request.socket.type=tcp4, request.socket.allowHalfOpen=true, request.socket.destroyed=false, request.socket.readable=true, request.socket.writable=true, request.socket.remoteAddress=64.119.130.114, request.socket.remotePort=57001, request.socket._idleTimeout=120000, request.socket._idleStart=Thu Jun 02 2011 20:34:03 GMT+0000 (UTC), request.connection.bufferSize=0, request.connection.fd=8, request.connection.type=tcp4, request.connection.allowHalfOpen=true, request.connection.destroyed=false, request.connection.readable=true, request.connection.writable=true, request.connection.remoteAddress=64.119.130.114, request.connection.remotePort=57001, request.connection._idleTimeout=120000, request.connection._idleStart=Thu Jun 02 2011 20:34:03 GMT+0000 (UTC), request.httpVersion=1.1, request.complete=true, request.headers.host=some-dev-server.com:8000, request.headers.connection=keep-alive, request.headers.accept=/, request.headers.user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24, request.headers.accept-encoding=gzip,deflate,sdch, request.headers.accept-language=en-US,en;q=0.8, request.headers.accept-charset=ISO-8859-1,utf-8;q=0.7,;q=0.3, request.headers.cookie=******, request.readable=true, request.url=/, request.method=GET, request.client.bufferSize=0, request.client.fd=8, request.client.type=tcp4, request.client.allowHalfOpen=true, request.client.destroyed=false, request.client.readable=true, request.client.writable=true, request.client.remoteAddress=64.119.130.114, request.client.remotePort=57001, request.client._idleTimeout=120000, request.client._idleStart=Thu Jun 02 2011 20:34:03 GMT+0000 (UTC), request.httpVersionMajor=1, request.httpVersionMinor=1, request.upgrade=false }

analog's People

Contributors

marksoper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.