You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2013/09/03 10:14:53 UTC

[jira] [Commented] (TS-1740) Improve precision of stats's values

    [ https://issues.apache.org/jira/browse/TS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756443#comment-13756443 ] 

ASF subversion and git services commented on TS-1740:
-----------------------------------------------------

Commit 8d95ab2f08842e6447b9617f0ad73a8d64ab3d7b in branch refs/heads/master from [~yunkai]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=8d95ab2 ]

TS-2173: RECD_COUNTER type is missing in setTokenValue()

After applied "TS-1740: Improve precision of stats values" patch,
each token will keep its original type instead of forcing to RecFloat.

So we should update setTokenValue() to deal with RECD_COUNTER case.

Signed-off-by: Yunkai Zhang <qi...@taobao.com>

                
> 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