web/null

web/null is /dev/null for the Web. It silently agrees with and eats up any request being VERBd to it, and keeps statistics of it.

web/null is great to use as a diagnostics end-socket of any distributed system you have, that works against another system sitting at an HTTP endpoint.

Replace any service with it, in order to have a real peek at what your other services are doing.

web/null is extremely useful (and being used) for getting stats data during stress testing a complex system.

Quick Start

via npm. It is preferrable (but not must) to run globally (sudo, -g)

$ sudo npm install webnull -g
$ webnull
== web/null v0.0.4. I eat your HTTP. ==
* Listening on port 4000.
* Flushing to webnull.log every 10 seconds.

Via Cloning

Alternatively, if you'd like to clone / run and tweak, clone this repository and run

$ npm install

You should then be able to run

$ node webnull
== web/null v0.0.4. I eat your HTTP. ==
* Listening on port 4000.
* Flushing to webnull.log every 10 seconds.

Output

And now just experiment. Here is apachebench

$ ab -n 10000 -c 10 "http://localhost:4000/"

Sample output, human-readable (debug)

...
127.0.0.1 - - [Wed, 09 Nov 2011 13:35:36 GMT] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
127.0.0.1 - - [Wed, 09 Nov 2011 13:35:36 GMT] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
1320845743    51 req(total) 0 bytes(total)  51 reqs 0 bytes 5.1 req(s)  0 bytes(avg)

Sample output, CSV (webnull.log)

...
1320845743,51,0,51,0,5.1,0

Doing more

Here's how help looks like:

$ node webnull --help
Usage: webnull [options]

Options:

  -h, --help                    output usage information
  -V, --version                 output the version number
  -d, --debug                   Show when flush happens.
  -c, --canned-response [file]  Existing file name to read a response from.
  -o, --output [file]           File name to output to.
  -i, --interval [seconds]      Flush interval.
  -p, --port [number]           Port to listen on.

Contributing

Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).

Copyright

Copyright (c) 2011 Dotan Nahum @jondot. See MIT-LICENSE for further details.



web/null

web / null是Web的 / dev / null 。它默默地同意并且吃了任何请求 对它进行 VERB d,并保存统计信息。

web / null非常适合用作任何分布式系统的诊断端口 具有这种功能,可以对付另一个位于HTTP端点的系统。

用它替换任何服务,以便真正了解什么 您的其他服务正在做。

web / null在压力期间获取统计数据非常有用(并被使用) 测试一个复杂的系统。

快速入门

通过 npm 。在全局运行(sudo,-g)

是最好的(但不是必须的)
$ sudo npm install webnull -g
$ webnull
== web/null v0.0.4. I eat your HTTP. ==
* Listening on port 4000.
* Flushing to webnull.log every 10 seconds.

通过克隆

或者,如果要克隆/运行和调整,请克隆该存储库并运行

$ npm install

然后应该可以运行

$ node webnull
== web/null v0.0.4. I eat your HTTP. ==
* Listening on port 4000.
* Flushing to webnull.log every 10 seconds.

输出

现在只是试验。这是apachebench

$ ab -n 10000 -c 10 "http://localhost:4000/"

示例输出,可读(调试)

…
127.0.0.1 - - [Wed, 09 Nov 2011 13:35:36 GMT] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
127.0.0.1 - - [Wed, 09 Nov 2011 13:35:36 GMT] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
1320845743    51 req(total) 0 bytes(total)  51 reqs 0 bytes 5.1 req(s)  0 bytes(avg)

样本输出,CSV(webnull.log)

…
1320845743,51,0,51,0,5.1,0

执行更多

以下是帮助如下:

$ node webnull –help
Usage: webnull [options]

Options:

-h, –help output usage information -V, –version output the version number -d, –debug Show when flush happens. -c, –canned-response [file] Existing file name to read a response from. -o, –output [file] File name to output to. -i, –interval [seconds] Flush interval. -p, –port [number] Port to listen on.

贡献

叉,实施,添加测试,拉请求,得到我永恒的感谢,并在这里有一个值得尊敬的地方:)。

版权所有

版权所有(c)2011 Dotan Nahum @jondot 。详见MIT-LICENSE。




相关问题推荐