You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/09/16 09:37:12 UTC
[GitHub] [skywalking] zhyyu opened a new issue, #9619: [Feature] making p50 not all 0 point when most request time is less than 10ms
zhyyu opened a new issue, #9619:
URL: https://github.com/apache/skywalking/issues/9619
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
When most request response time is less than 10ms (the default oal precision is 10), the percentile p50 will be all 0, like this
<img width="443" alt="image" src="https://user-images.githubusercontent.com/22634485/190603970-1a1fe1f0-77ba-410a-abb8-97c960b0b311.png"> , and this is obscure. I read the `PercentileMetrics` code and found the `combine` function
```java
public final void combine(@SourceFrom int value, @Arg int precision) {
this.isCalculated = false;
this.precision = precision;
String index = String.valueOf(value / precision);
dataset.valueAccumulation(index, 1L);
}
```
So the index will be 0 when response time is less than 10(default precision is 10, oal: `service_percentile = from(Service.latency).percentile(10);`) and the index key will be multi by precision when calculate funcition called
```java
percentileValues.put(String.valueOf(rankIdx), Long.parseLong(key) * precision);
```
So, the finally P50 will be 0.
Can we change the combine function in `PercentileMetrics`, do ceiling operate when calcuate index, so the index will not be 0, like this
```java
public final void combine(@SourceFrom int value, @Arg int precision) {
this.isCalculated = false;
this.precision = precision;
String index = String.valueOf(Math.ceil(value * 1.0 / precision));
dataset.valueAccumulation(index, 1L);
}
```
So, the P50 will be 10ms, when most response time is less than 10ms and easily to understand P50 that 50% req is less than 10ms.
### Use case
like above
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng closed issue #9619: [Feature] making p50 not all 0 point when most request time is less than 10ms
Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #9619: [Feature] making p50 not all 0 point when most request time is less than 10ms
URL: https://github.com/apache/skywalking/issues/9619
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on issue #9619: [Feature] making p50 not all 0 point when most request time is less than 10ms
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #9619:
URL: https://github.com/apache/skywalking/issues/9619#issuecomment-1249159308
If 10ms as precision is too long for you, what don't you change it through OAL? 10ms is only a general meaningful latency, but you don't have to follow it.
At the same time, less than 10ms == 10ms is very scary when ppl read metrics. The point of percentile is providing the layout of the latency, rather than an accurate number. We should not scare users.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org