[
https://issues.apache.org/jira/browse/TS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756694#comment-13756694
]
Leif Hedstrom commented on TS-1740:
-----------------------------------
Why was this committed on an old, closed bug? Please add the above commit
message to an appropriate bug, marked for Fix for v4.1.0. Also, can you take a
look at the existing bugs (I think there are several of them) that are related
to stats not working properly. Also, if the reports on missing stats is
serious, we might want to back port that to a 4.0.2 release, so please add that
to those bugs as a Backport version.
On the open bug(s) for v4.1.0, please add a link to this bug as well.
> Improve precision of stats's values
> -----------------------------------
>
> Key: TS-1740
> URL: https://issues.apache.org/jira/browse/TS-1740
> Project: Traffic Server
> Issue Type: Bug
> Components: Stats
> Reporter: Yunkai Zhang
> Assignee: Zhao Yongming
> Fix For: 3.3.2
>
> Attachments: 0001-Improve-precision-of-stats-s-values.patch
>
>
> Improve precision of stats's values
> Conversion between types, such as RecInt(int64_t) to RecFloat(float),
> may lead to loss of precision.
> In the old code, token value was defined with StatFloat type, it would casue
> unnecessary conversion when type of token is not StatFloat.
> it's best to keep value with the same type of token as much as possiable.
> ===
> For example, we have defined such expression in stats.config.xml:
> {code}
> <statistics>
>
> <destination>proxy.node.http.user_agent_total_request_bytes</destination>
> <destination
> scope="cluster">proxy.cluster.http.user_agent_total_request_bytes</destination>
> <expression>
> proxy.process.http.user_agent_request_document_total_size +
> proxy.process.http.user_agent_request_header_total_size
> </expression>
> </statistics>
> {code}
> So:
> proxy.node.http.user_agent_total_request_bytes = \
> proxy.process.http.user_agent_request_document_total_size + \
> proxy.process.http.user_agent_request_header_total_size
> These three stats token are all RecInt types, but the code would convert them
> to RecFloat when evaluating the expression, like that:
> proxy.node.http.user_agent_total_request_bytes = \
> (RecFloat)proxy.process.http.user_agent_request_document_total_size + \
> (RecFloat)proxy.process.http.user_agent_request_header_total_size
> As a result, we might get the following output from stats http API:
> {code}
> [root@test62 trafficserver]# cat ~/bin/list-cluster.sh
> elinks -dump http://localhost:8080/stat/ | grep proxy_name
> elinks -dump http://localhost:8080/stat/ | grep nodes
> elinks -dump http://localhost:8080/stat/ | grep
> proxy.process.http.origin_server_request_document_total_size
> elinks -dump http://localhost:8080/stat/ | grep
> proxy.process.http.origin_server_request_header_total_size
> elinks -dump http://localhost:8080/stat/ | grep
> proxy.node.http.origin_server_total_request_bytes
> [root@test62 trafficserver]# list-cluster.sh
> proxy.config.proxy_name=test62.63
> proxy.node.cluster.nodes=1
> proxy.process.cluster.nodes=1
> proxy.process.http.origin_server_request_document_total_size=0 <= #1
> proxy.process.http.origin_server_request_header_total_size=359209123 <= #2
> proxy.node.http.origin_server_total_request_bytes=359209120 <= #3
> != (#1 + #2)
> {code}
> As the value increasing, the loss of precision will become more and more
> seriously.
--
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