You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/04/18 00:25:07 UTC
git commit: TS-1755: add basic logstats tests
Updated Branches:
refs/heads/master bb275c046 -> 664ca3987
TS-1755: add basic logstats tests
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/664ca398
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/664ca398
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/664ca398
Branch: refs/heads/master
Commit: 664ca3987b77d718f2272998c7bd23b791ef2e2e
Parents: bb275c0
Author: James Peach <jp...@apache.org>
Authored: Mon Mar 18 15:06:49 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed Apr 17 15:23:57 2013 -0700
----------------------------------------------------------------------
CHANGES | 3 +-
lib/ts/Layout.cc | 4 +-
proxy/Makefile.am | 4 +
proxy/tests/logstats.blog | Bin 0 -> 14976 bytes
proxy/tests/logstats.json | 243 ++++++++++++++++++++++++++++++++
proxy/tests/logstats.summary | 164 +++++++++++++++++++++
proxy/tests/test_logstats_json | 26 ++++
proxy/tests/test_logstats_summary | 25 ++++
8 files changed, 466 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index c7d8de1..db600ca 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
Changes with Apache Traffic Server 3.3.3
+ *) [TS-1755] add basic logstats tests
+
*) TS-1184 Additional whitespace in proxy.config.admin.user_id value results
in error.
@@ -17,7 +19,6 @@
*) [TS-1826] Remove DumpStats/http_dump dead code.
-
Changes with Apache Traffic Server 3.3.2
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/lib/ts/Layout.cc
----------------------------------------------------------------------
diff --git a/lib/ts/Layout.cc b/lib/ts/Layout.cc
index d4240f1..0ca75d2 100644
--- a/lib/ts/Layout.cc
+++ b/lib/ts/Layout.cc
@@ -184,9 +184,9 @@ Layout::Layout(const char *_prefix)
// TODO: Use a propper Debug logging
//
#define PrintSTR(var) \
- fprintf(stdout, "%18s = '%s'\n", "--" #var, (var == NULL? "NULL" : var));
+ fprintf(stderr, "%18s = '%s'\n", "--" #var, (var == NULL? "NULL" : var));
- fprintf(stdout, "Layout configuration\n");
+ fprintf(stderr, "Layout configuration\n");
PrintSTR(prefix);
PrintSTR(exec_prefix);
PrintSTR(bindir);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index 288261d..28151ef 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -31,6 +31,10 @@ bin_PROGRAMS = \
traffic_sac
endif
+TESTS = \
+ tests/test_logstats_json \
+ tests/test_logstats_summary
+
AM_CPPFLAGS = \
$(iocore_include_dirs) \
-I$(top_srcdir)/lib/records \
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/logstats.blog
----------------------------------------------------------------------
diff --git a/proxy/tests/logstats.blog b/proxy/tests/logstats.blog
new file mode 100644
index 0000000..229c1d2
Binary files /dev/null and b/proxy/tests/logstats.blog differ
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/logstats.json
----------------------------------------------------------------------
diff --git a/proxy/tests/logstats.json b/proxy/tests/logstats.json
new file mode 100644
index 0000000..907c2dd
--- /dev/null
+++ b/proxy/tests/logstats.json
@@ -0,0 +1,243 @@
+{ "total": {
+ "hit.direct" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.ims" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.refresh" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.total" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "miss.direct" : { "req": "56", "req_pct": "83.58", "bytes": "5874019", "bytes_pct": "88.98" },
+ "miss.ims" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "miss.refresh" : { "req": "10", "req_pct": "14.93", "bytes": "727203", "bytes_pct": "11.02" },
+ "miss.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "miss.total" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "error.client_abort" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "error.connect_failed" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.invalid_request" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.unknown" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.total" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "status.100" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.200" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "status.201" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.202" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.203" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.204" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.205" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.206" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.2xx" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "status.300" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.301" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.302" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.303" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.304" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.305" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.307" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.3xx" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.400" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.401" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.402" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.403" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.404" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.405" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.406" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.407" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.408" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.409" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.410" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.411" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.412" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.413" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.414" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.415" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.416" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.417" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.4xx" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.500" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.501" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.502" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.503" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.504" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.505" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.5xx" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.000" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.none" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.direct" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "hier.sibling" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.parent" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.empty" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.invalid" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.options" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.get" : { "req": "67", "req_pct": "100.00", "bytes": "6601222", "bytes_pct": "100.00" },
+ "method.head" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.post" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.put" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.delete" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.trace" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.connect" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.purge" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.none" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "scheme.http" : { "req": "67", "req_pct": "100.00", "bytes": "6601222", "bytes_pct": "100.00" },
+ "scheme.https" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "scheme.none" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "scheme.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.javascript" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.css" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.html" : { "req": "49", "req_pct": "73.13", "bytes": "4329503", "bytes_pct": "65.59" },
+ "content.text.xml" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.plain" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.total" : { "req": "49", "req_pct": "73.13", "bytes": "4329503", "bytes_pct": "65.59" },
+ "content.image.jpeg" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.image.gif" : { "req": "1", "req_pct": "1.49", "bytes": "2662", "bytes_pct": "0.04" },
+ "content.image.png" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.image.bmp" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.image.other" : { "req": "1", "req_pct": "1.49", "bytes": "1468", "bytes_pct": "0.02" },
+ "content.image.total" : { "req": "2", "req_pct": "2.99", "bytes": "4130", "bytes_pct": "0.06" },
+ "content.audio.x-wav" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.audio.x-mpeg" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.audio.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.audio.total" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.shockwave" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.javascript" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.quicktime" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.zip" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.rss_xml" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.rss_atom" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.other" : { "req": "15", "req_pct": "22.39", "bytes": "2267589", "bytes_pct": "34.35" },
+ "content.application.total" : { "req": "15", "req_pct": "22.39", "bytes": "2267589", "bytes_pct": "34.35" },
+ "content.none" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "content.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.direct.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.ims.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.refresh.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.other.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.total.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "miss.direct.latency" : { "min": "88", "max": "1059", "avg": "449.64", "dev": "199.97" },
+ "miss.ims.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "miss.refresh.latency" : { "min": "168", "max": "491", "avg": "278.80", "dev": "117.47" },
+ "miss.other.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "miss.total.latency" : { "min": "88", "max": "1059", "avg": "423.76", "dev": "199.43" },
+ },
+ "imgur.com": {
+ "hit.direct" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.ims" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.refresh" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.total" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "miss.direct" : { "req": "56", "req_pct": "83.58", "bytes": "5874019", "bytes_pct": "88.98" },
+ "miss.ims" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "miss.refresh" : { "req": "10", "req_pct": "14.93", "bytes": "727203", "bytes_pct": "11.02" },
+ "miss.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "miss.total" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "error.client_abort" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "error.connect_failed" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.invalid_request" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.unknown" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "error.total" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "status.100" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.200" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "status.201" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.202" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.203" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.204" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.205" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.206" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.2xx" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "status.300" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.301" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.302" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.303" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.304" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.305" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.307" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.3xx" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.400" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.401" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.402" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.403" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.404" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.405" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.406" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.407" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.408" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.409" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.410" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.411" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.412" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.413" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.414" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.415" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.416" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.417" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.4xx" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.500" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.501" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.502" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.503" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.504" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.505" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.5xx" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "status.000" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.none" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.direct" : { "req": "66", "req_pct": "98.51", "bytes": "6601222", "bytes_pct": "100.00" },
+ "hier.sibling" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.parent" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.empty" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.invalid" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hier.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.options" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.get" : { "req": "67", "req_pct": "100.00", "bytes": "6601222", "bytes_pct": "100.00" },
+ "method.head" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.post" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.put" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.delete" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.trace" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.connect" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.purge" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.none" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "method.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "scheme.http" : { "req": "67", "req_pct": "100.00", "bytes": "6601222", "bytes_pct": "100.00" },
+ "scheme.https" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "scheme.none" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "scheme.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.javascript" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.css" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.html" : { "req": "49", "req_pct": "73.13", "bytes": "4329503", "bytes_pct": "65.59" },
+ "content.text.xml" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.plain" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.text.total" : { "req": "49", "req_pct": "73.13", "bytes": "4329503", "bytes_pct": "65.59" },
+ "content.image.jpeg" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.image.gif" : { "req": "1", "req_pct": "1.49", "bytes": "2662", "bytes_pct": "0.04" },
+ "content.image.png" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.image.bmp" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.image.other" : { "req": "1", "req_pct": "1.49", "bytes": "1468", "bytes_pct": "0.02" },
+ "content.image.total" : { "req": "2", "req_pct": "2.99", "bytes": "4130", "bytes_pct": "0.06" },
+ "content.audio.x-wav" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.audio.x-mpeg" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.audio.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.audio.total" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.shockwave" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.javascript" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.quicktime" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.zip" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.rss_xml" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.rss_atom" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "content.application.other" : { "req": "15", "req_pct": "22.39", "bytes": "2267589", "bytes_pct": "34.35" },
+ "content.application.total" : { "req": "15", "req_pct": "22.39", "bytes": "2267589", "bytes_pct": "34.35" },
+ "content.none" : { "req": "1", "req_pct": "1.49", "bytes": "0", "bytes_pct": "0.00" },
+ "content.other" : { "req": "0", "req_pct": "0.00", "bytes": "0", "bytes_pct": "0.00" },
+ "hit.direct.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.ims.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.refresh.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.other.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "hit.total.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "miss.direct.latency" : { "min": "88", "max": "1059", "avg": "449.64", "dev": "199.97" },
+ "miss.ims.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "miss.refresh.latency" : { "min": "168", "max": "491", "avg": "278.80", "dev": "117.47" },
+ "miss.other.latency" : { "min": "-1", "max": "0", "avg": "0.00", "dev": "0.00" },
+ "miss.total.latency" : { "min": "88", "max": "1059", "avg": "423.76", "dev": "199.43" },
+ }
+}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/logstats.summary
----------------------------------------------------------------------
diff --git a/proxy/tests/logstats.summary b/proxy/tests/logstats.summary
new file mode 100644
index 0000000..21f7fe3
--- /dev/null
+++ b/proxy/tests/logstats.summary
@@ -0,0 +1,164 @@
+ Totals (all Origins combined)
+
+Request Result Count Percent Bytes Percent
+------------------------------------------------------------------------------
+Cache hit 0 0.00% 0.00KB 0.00%
+Cache hit IMS 0 0.00% 0.00KB 0.00%
+Cache hit refresh 0 0.00% 0.00KB 0.00%
+Cache hit other 0 0.00% 0.00KB 0.00%
+Cache hit total 0 0.00% 0.00KB 0.00%
+
+Cache miss 56 83.58% 5.60MB 88.98%
+Cache miss IMS 0 0.00% 0.00KB 0.00%
+Cache miss refresh 10 14.93% 710.16KB 11.02%
+Cache miss other 0 0.00% 0.00KB 0.00%
+Cache miss total 66 98.51% 6.30MB 100.00%
+
+Client aborted 1 1.49% 0.00KB 0.00%
+Connect failed 0 0.00% 0.00KB 0.00%
+Invalid request 0 0.00% 0.00KB 0.00%
+Unknown error(99) 0 0.00% 0.00KB 0.00%
+Other errors 0 0.00% 0.00KB 0.00%
+Errors total 1 1.49% 0.00KB 0.00%
+..............................................................................
+Total requests 67 100.00% 6.30MB 100.00%
+
+
+HTTP return codes Count Percent Bytes Percent
+------------------------------------------------------------------------------
+100 Continue 0 0.00% 0.00KB 0.00%
+200 OK 66 98.51% 6.30MB 100.00%
+201 Created 0 0.00% 0.00KB 0.00%
+202 Accepted 0 0.00% 0.00KB 0.00%
+203 Non-Authoritative Info 0 0.00% 0.00KB 0.00%
+204 No content 0 0.00% 0.00KB 0.00%
+205 Reset Content 0 0.00% 0.00KB 0.00%
+206 Partial content 0 0.00% 0.00KB 0.00%
+2xx Total 66 98.51% 6.30MB 100.00%
+
+300 Multiple Choices 0 0.00% 0.00KB 0.00%
+301 Moved permanently 0 0.00% 0.00KB 0.00%
+302 Found 0 0.00% 0.00KB 0.00%
+303 See Other 0 0.00% 0.00KB 0.00%
+304 Not modified 0 0.00% 0.00KB 0.00%
+305 Use Proxy 0 0.00% 0.00KB 0.00%
+307 Temporary Redirect 0 0.00% 0.00KB 0.00%
+3xx Total 0 0.00% 0.00KB 0.00%
+
+400 Bad request 0 0.00% 0.00KB 0.00%
+401 Unauthorized 0 0.00% 0.00KB 0.00%
+402 Payment Required 0 0.00% 0.00KB 0.00%
+403 Forbidden 0 0.00% 0.00KB 0.00%
+404 Not found 0 0.00% 0.00KB 0.00%
+405 Method Not Allowed 0 0.00% 0.00KB 0.00%
+406 Not Acceptable 0 0.00% 0.00KB 0.00%
+407 Proxy Auth Required 0 0.00% 0.00KB 0.00%
+408 Request Timeout 0 0.00% 0.00KB 0.00%
+409 Conflict 0 0.00% 0.00KB 0.00%
+410 Gone 0 0.00% 0.00KB 0.00%
+411 Length Required 0 0.00% 0.00KB 0.00%
+412 Precondition Failed 0 0.00% 0.00KB 0.00%
+413 Request Entity Too Large 0 0.00% 0.00KB 0.00%
+414 Request-URI Too Long 0 0.00% 0.00KB 0.00%
+415 Unsupported Media Type 0 0.00% 0.00KB 0.00%
+416 Req Range Not Satisfiable 0 0.00% 0.00KB 0.00%
+417 Expectation Failed 0 0.00% 0.00KB 0.00%
+4xx Total 0 0.00% 0.00KB 0.00%
+
+500 Internal Server Error 0 0.00% 0.00KB 0.00%
+501 Not implemented 0 0.00% 0.00KB 0.00%
+502 Bad gateway 0 0.00% 0.00KB 0.00%
+503 Service unavailable 0 0.00% 0.00KB 0.00%
+504 Gateway Timeout 0 0.00% 0.00KB 0.00%
+505 HTTP Ver. Not Supported 0 0.00% 0.00KB 0.00%
+5xx Total 0 0.00% 0.00KB 0.00%
+
+000 Unknown 1 1.49% 0.00KB 0.00%
+
+
+Origin hierarchies Count Percent Bytes Percent
+------------------------------------------------------------------------------
+NONE 0 0.00% 0.00KB 0.00%
+DIRECT 66 98.51% 6.30MB 100.00%
+SIBLING 0 0.00% 0.00KB 0.00%
+PARENT 0 0.00% 0.00KB 0.00%
+EMPTY 1 1.49% 0.00KB 0.00%
+invalid 0 0.00% 0.00KB 0.00%
+other 0 0.00% 0.00KB 0.00%
+
+
+HTTP Methods Count Percent Bytes Percent
+------------------------------------------------------------------------------
+OPTIONS 0 0.00% 0.00KB 0.00%
+GET 67 100.00% 6.30MB 100.00%
+HEAD 0 0.00% 0.00KB 0.00%
+POST 0 0.00% 0.00KB 0.00%
+PUT 0 0.00% 0.00KB 0.00%
+DELETE 0 0.00% 0.00KB 0.00%
+TRACE 0 0.00% 0.00KB 0.00%
+CONNECT 0 0.00% 0.00KB 0.00%
+PURGE 0 0.00% 0.00KB 0.00%
+none (-) 0 0.00% 0.00KB 0.00%
+other 0 0.00% 0.00KB 0.00%
+
+
+URL Schemes Count Percent Bytes Percent
+------------------------------------------------------------------------------
+HTTP (port 80) 67 100.00% 6.30MB 100.00%
+HTTPS (port 443) 0 0.00% 0.00KB 0.00%
+none 0 0.00% 0.00KB 0.00%
+other 0 0.00% 0.00KB 0.00%
+
+
+Content Types Count Percent Bytes Percent
+------------------------------------------------------------------------------
+text/javascript 0 0.00% 0.00KB 0.00%
+text/css 0 0.00% 0.00KB 0.00%
+text/html 49 73.13% 4.13MB 65.59%
+text/xml 0 0.00% 0.00KB 0.00%
+text/plain 0 0.00% 0.00KB 0.00%
+text/ other 0 0.00% 0.00KB 0.00%
+text/ total 49 73.13% 4.13MB 65.59%
+
+image/jpeg 0 0.00% 0.00KB 0.00%
+image/gif 1 1.49% 2.60KB 0.04%
+image/png 0 0.00% 0.00KB 0.00%
+image/bmp 0 0.00% 0.00KB 0.00%
+image/ other 1 1.49% 1.43KB 0.02%
+image/ total 2 2.99% 4.03KB 0.06%
+
+audio/x-wav 0 0.00% 0.00KB 0.00%
+audio/x-mpeg 0 0.00% 0.00KB 0.00%
+audio/ other 0 0.00% 0.00KB 0.00%
+audio/ total 0 0.00% 0.00KB 0.00%
+
+application/x-shockwave 0 0.00% 0.00KB 0.00%
+application/[x-]javascript 0 0.00% 0.00KB 0.00%
+application/x-quicktime 0 0.00% 0.00KB 0.00%
+application/zip 0 0.00% 0.00KB 0.00%
+application/rss+xml 0 0.00% 0.00KB 0.00%
+application/rss+atom 0 0.00% 0.00KB 0.00%
+application/ other 15 22.39% 2.16MB 34.35%
+application/ total 15 22.39% 2.16MB 34.35%
+
+none 1 1.49% 0.00KB 0.00%
+other 0 0.00% 0.00KB 0.00%
+
+
+Elapsed time stats Min Max Avg Std Deviation
+------------------------------------------------------------------------------
+Cache hit 0 0 0.000 0.000
+Cache hit IMS 0 0 0.000 0.000
+Cache hit refresh 0 0 0.000 0.000
+Cache hit other 0 0 0.000 0.000
+Cache hit total 0 0 0.000 0.000
+Cache miss 88 1,059 449.643 199.972
+Cache miss IMS 0 0 0.000 0.000
+Cache miss refresh 168 491 278.800 117.469
+Cache miss other 0 0 0.000 0.000
+Cache miss total 88 1,059 423.758 199.431
+
+______________________________________________________________________________
+
+
+
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/test_logstats_json
----------------------------------------------------------------------
diff --git a/proxy/tests/test_logstats_json b/proxy/tests/test_logstats_json
new file mode 100755
index 0000000..58de9f7
--- /dev/null
+++ b/proxy/tests/test_logstats_json
@@ -0,0 +1,26 @@
+#! /usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # exit on error
+
+TMPFILE=`mktemp -t logstats.XXXXXX` || exit 1
+
+# Note that the JSON has a timestamp in it that we have to filter out ...
+./traffic_logstats --log_file "$srcdir/tests/logstats.blog" --json | grep -v timestamp > $TMPFILE
+diff -q $TMPFILE "$srcdir/tests/logstats.json"
+rm -f $TMPFILE
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/test_logstats_summary
----------------------------------------------------------------------
diff --git a/proxy/tests/test_logstats_summary b/proxy/tests/test_logstats_summary
new file mode 100755
index 0000000..e41a33e
--- /dev/null
+++ b/proxy/tests/test_logstats_summary
@@ -0,0 +1,25 @@
+#! /usr/bin/env sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # exit on error
+
+TMPFILE=`mktemp -t logstats.XXXXXX` || exit 1
+
+./traffic_logstats --log_file "$srcdir/tests/logstats.blog" --summary > $TMPFILE
+diff -q $TMPFILE "$srcdir/tests/logstats.summary"
+rm -f $TMPFILE
Re: git commit: TS-1755: add basic logstats tests
Posted by Igor Galić <i....@brainsware.org>.
----- Original Message -----
> Updated Branches:
> refs/heads/master bb275c046 -> 664ca3987
>
>
> TS-1755: add basic logstats tests
>
[snip]
>
> ----------------------------------------------------------------------
> CHANGES | 3 +-
> lib/ts/Layout.cc | 4 +-
> proxy/Makefile.am | 4 +
> proxy/tests/logstats.blog | Bin 0 -> 14976 bytes
> proxy/tests/logstats.json | 243 ++++++++++++++++++++++++++++++++
> proxy/tests/logstats.summary | 164 +++++++++++++++++++++
> proxy/tests/test_logstats_json | 26 ++++
> proxy/tests/test_logstats_summary | 25 ++++
> 8 files changed, 466 insertions(+), 3 deletions(-)
> ----------------------------------------------------------------------
>
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/test_logstats_json
> ----------------------------------------------------------------------
> diff --git a/proxy/tests/test_logstats_json
> b/proxy/tests/test_logstats_json
> new file mode 100755
> index 0000000..58de9f7
> --- /dev/null
> +++ b/proxy/tests/test_logstats_json
> @@ -0,0 +1,26 @@
> +#! /usr/bin/env bash
This is bash. But..
[snip]
> +
> +set -e # exit on error
> +
> +TMPFILE=`mktemp -t logstats.XXXXXX` || exit 1
You're using ``, which is frowned upon sh syntax. (makes for poor readability
according to Bash gods. Use $( command )
Also: set -e not catches a faulty return from mktemp, no use to use || exit 1.
Please only use UPPERCASE for bash variables, not your OWN.
Is TMPFILE overridable from the outside? No, then THERE'S NO NEED FOR CAPS.
> +
> +# Note that the JSON has a timestamp in it that we have to filter
> out ...
> +./traffic_logstats --log_file "$srcdir/tests/logstats.blog" --json |
> grep -v timestamp > $TMPFILE
> +diff -q $TMPFILE "$srcdir/tests/logstats.json"
> +rm -f $TMPFILE
please use more quotes (around $TMPFILE ), and perhaps use rm -f --
so no one can accidentaly pass -r $TMPFILE
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/664ca398/proxy/tests/test_logstats_summary
> ----------------------------------------------------------------------
> diff --git a/proxy/tests/test_logstats_summary
> b/proxy/tests/test_logstats_summary
> new file mode 100755
> index 0000000..e41a33e
> --- /dev/null
> +++ b/proxy/tests/test_logstats_summary
> @@ -0,0 +1,25 @@
> +#! /usr/bin/env sh
This is "sh". Yay consistency.
> +# Licensed to the Apache Software Foundation (ASF) under one
> +# or more contributor license agreements. See the NOTICE file
> +# distributed with this work for additional information
> +# regarding copyright ownership. The ASF licenses this file
> +# to you under the Apache License, Version 2.0 (the
> +# "License"); you may not use this file except in compliance
> +# with the License. You may obtain a copy of the License at
> +#
> +# http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing,
> software
> +# distributed under the License is distributed on an "AS IS" BASIS,
> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> +# See the License for the specific language governing permissions
> and
> +# limitations under the License.
> +
> +set -e # exit on error
> +
> +TMPFILE=`mktemp -t logstats.XXXXXX` || exit 1
> +
> +./traffic_logstats --log_file "$srcdir/tests/logstats.blog"
> --summary > $TMPFILE
> +diff -q $TMPFILE "$srcdir/tests/logstats.summary"
> +rm -f $TMPFILE
same as obove..
In his day job Igor writes fierce reviews of horrific shell scripts,
which is why people have stopped committing stuff altogether..
Igor is NOT paranoid.
--
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE