alibaba/tsar — pull request #25 by chobits (2013-10-24 03:50:00+00:00)
Title: add new module: nginx domain

nginx domain module
---
This module works with nginx reqstat module, which will be merged into tengine (https://github.com/alibaba/tengine/pull/260).

It can collect information: connections per second, qps, 2XX-qps, 3XX-qps, 4XX-qps, 5XX-qps, other-qps, rt per domain.
An example is as following:

$ tsar --nginx_domain -li1
Time --------------8891-------------- --------------8892--------------
Time cps qps 2XX rt cps qps 2XX rt
22/10/13-15:44:29 797.00 797.00 797.00 2.06 20.00 2.0K 2.0K 0.00
22/10/13-15:44:30 607.00 607.00 607.00 2.74 20.00 1.9K 1.9K 0.00

(8891 and 8892 mean listening port of subdomain, domain name comes from nginx reqstat module)

nginx reqstat module raw data:

$ curl localhost/nginx_domain_status
8892,158,1049353,1,1,1,0,0,0,0,55
8891,158,1049353,1,1,1,0,0,0,0,42

raw data format:
domain_name, in_bytes, out_bytes, connections, requests, 2XX-requests, 3XX, 4XX, 5XX, other, response_time

some trivial patches
---
fix compiling warning (item_value is unused)
fix wrong alignment of mod_nginx help info