[
https://issues.apache.org/jira/browse/TS-1631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13619103#comment-13619103
]
ASF subversion and git services commented on TS-1631:
-----------------------------------------------------
Commit 850ca412deb9bd0a477c5ac1f43e15bafaa425c8 in branch refs/heads/master
from [~kopely]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=850ca41 ]
TS-1631 Mgmt API to clear stats does not actually clear it
Review and minor mods: Leif.
> Clear Stats doesn't work - old value return
> -------------------------------------------
>
> Key: TS-1631
> URL: https://issues.apache.org/jira/browse/TS-1631
> Project: Traffic Server
> Issue Type: Bug
> Components: Management API, Stats
> Reporter: Yakov Kopel
> Assignee: Leif Hedstrom
> Fix For: 3.3.2
>
> Attachments: clear_stats_ver_1.diff, clear_stats_ver_2.diff,
> clear_stats_ver_3.diff
>
>
> I’m trying to clear stats using traffic_line -c/-C and it doesn’t appear to
> work. After a couple of seconds the old values return.
> CLI sample output:
> traffic_line -r proxy.process.http.total_client_connections_ipv4
> 208
> traffic_line -c
> traffic_line -r proxy.process.http.total_client_connections_ipv4
> 0
> traffic_line -r proxy.process.http.total_client_connections_ipv4
> 210
> I think this is due to not updating the sum/count in the net-threads.
> When traffic_line -c/-C is called - it clear the records table but not the
> net-threads sum/count variables.
> In the next time the RecRawStatSyncCount func will be called it will override
> the "zero" value in the records table.
> For example - http_total_client_connections_ipv4_stat
> 1. This stat is used in proxy/http/HttpClientSession.cc
> 2. The macro HTTP_INCREMENT_DYN_STAT using the RecIncrRawStat func to
> increament the stat value.
> 3. The RecIncrRawStat increament the sum counter on the specific net thread.
> 4. RecRawStatSyncCount is called in a loop and summarize all the stats in
> the net thread to one global value.
> 5. RecRegisterRawStatSyncCb is called to update the global value in the
> records table.
>
> I'm attaching a patch to fix it.
> 1. add -z/-Z otipns to traffic_line - to reset specific stat.
> 2. I added a version variable to the record of the stat - so that if we want
> to reset a record - we will increase this record.
> 3. On the next sync to global call (RecExecRawStatSyncCbs in RecProcess.cc)
> it will clear the sum/counter in the net-tread variables.
> There is another issue about the RecDecrRawStat function - I'll open on it
> another Jira.
> Regards,
> Yakov Kopel.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira