[
https://issues.apache.org/jira/browse/TS-5069?focusedWorklogId=32778&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-32778
]
ASF GitHub Bot logged work on TS-5069:
--------------------------------------
Author: ASF GitHub Bot
Created on: 01/Dec/16 23:21
Start Date: 01/Dec/16 23:21
Worklog Time Spent: 10m
Work Description: Github user zwoop commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/1239#discussion_r90557544
--- Diff: proxy/logstats.cc ---
@@ -594,15 +594,16 @@ struct CommandLineArgs {
int64_t min_hits;
int max_age;
int line_len;
- int incremental; // Do an incremental run
- int tail; // Tail the log file
- int summary; // Summary only
- int json; // JSON output
- int cgi; // CGI output (typically with json)
- int urls; // Produce JSON output of URL stats, arg is LRU size
- int show_urls; // Max URLs to show
- int as_object; // Show the URL stats as a single JSON object (not
array)
- int concise; // Eliminate metrics that can be inferred by other
values
+ int incremental; // Do an incremental run
+ int tail; // Tail the log file
+ int summary; // Summary only
+ int json; // JSON output
+ int cgi; // CGI output (typically with json)
+ int urls; // Produce JSON output of URL stats, arg is LRU
size
+ int show_urls; // Max URLs to show
+ int as_object; // Show the URL stats as a single JSON object (not
array)
+ int concise; // Eliminate metrics that can be inferred by other
values
+ bool report_per_user; // A flag to aggregate and report stats per user
instead of per host if 'true' (default 'false')
--- End diff --
I'm ok with this, but if we use bool here, we should use bool for the
others too (that are bool). The reason I initially had it as "int" (i think)
was because I assumed the parser needed the pointer to an int and not a bool.
If it's safe and ok to use bool there, we should switch consistently. So, these
```
-A, --as_object tog false Produce URL stats as a JSON
object instead of array
-C, --concise tog false Eliminate metrics that can be
inferred from other values
-i, --incremental tog false Incremental log parsing
-s, --summary tog false Only produce the summary
-j, --json tog false Produce JSON formatted output
-c, --cgi tog false Produce HTTP headers suitable as
a CGI
-r, --report_per_user tog false Report stats per user instead of
host
```
Issue Time Tracking
-------------------
Worklog Id: (was: 32778)
Time Spent: 1h 40m (was: 1.5h)
> logstats: add ability to report stats per user instead of host
> --------------------------------------------------------------
>
> Key: TS-5069
> URL: https://issues.apache.org/jira/browse/TS-5069
> Project: Traffic Server
> Issue Type: Bug
> Components: Logging, Tools
> Reporter: Gancho Tenev
> Assignee: Gancho Tenev
> Fix For: 7.1.0
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> We would like to enhance {{traffic_logstats}} with the ability to report
> stats per user instead of host (from the URI).
> Currently the {{traffic_logstats}} expects a binary squid log format defined
> in the following ATS log config and aggregates and reports stats per the
> authority part of the URI ({{host:port}} in an usual use-case)
> {code}
> <Format = "%<cqtq> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc>
> %<caun> %<phr>/%<pqsn> %<psct>"/>
> {code}
> It would be useful for our use-case to be able aggregate and report stats
> based on the 8th squid log field which is an username of the authenticated
> client {{%<caun>}}).
> In our use-case we need to aggregate and report stats per
> CDN-customer-specific-tag.
> For example the new functionality would allow us to replace {{%caun}} with a
> random header content {{%<\{@CustomerTagHeader\}cqh>}} and report stats per
> CDN customer by using a new command line parameter {{--report_per_user}} w/o
> adding extra fields to the binary squid format log expected by
> {{traffic_logstats}} and keep it backward compatible with the previous
> version.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)