Thank you for your quick reply! I have tried both approaches you have propose.
using traffic_ctl to zero the stat, but it does not have any effect, I tried to zero several statistics, then I get the value, it is still there. I have also tried traffic_ctl metric clear, it does not working either.
As for removing records.snap,
it gives me "Error getting stat: proxy.process.http.100_responses when calling TSRecordGetInt() failed: file "traffic_top/stats.h", line 281”
sometimes the error disappears if I rerun traffic_top, but sometimes it will always give this error.
Any thoughts why?
You can zero a metric while running ATS by running this command:
sudo /usr/local/bin/traffic_ctl metric zero proxy.process.http.completed_requests
Or you can shutdown ATS and remove the metrics file:
09:37:25 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
09:39:25 homer:~$ sudo /usr/local/bin/trafficserver stop
Stopping traffic_manager: [ OK ]
Stopping traffic_server: [ OK ]
09:39:36 homer:~$ sudo rm /usr/local/var/trafficserver/records.snap
09:40:08 homer:~$ sudo /usr/local/bin/trafficserver start
Starting Apache Traffic Server: [ OK ]
09:40:23 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
How can I reset the statistics? I have tried traffic_server -Cclear and delete everything under var/log and var/trafficserver, but it seems the statistics is not reset. Thank you!
It depends on what you mean as a miss. If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio?
By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin.