inversionhourglass opened a new issue, #10092:
URL: https://github.com/apache/skywalking/issues/10092

   ### 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
   
   The implementation logic of 
[readMetricsValue](https://github.com/apache/skywalking-query-protocol/blob/master/metrics-v2.graphqls#L146)
 defined in Query Protocol in oap-server is to calculate the average value 
within the time range and return it. Now the API returns a Long type value. For 
the average value, it may be more appropriate to return a Float (double) type 
value.
   
   ### Use case
   
   In the process of using skywalking, I encountered a question, and I saw this 
question asked by others in the community. For example, the success rate of 
some services in the figure below is less than 100%, but no request actually 
fails. The reason for this problem is that there are no requests for some time 
periods within the currently selected time range, and the sla for these time 
periods without requests will be set to 0 to participate in the average 
calculation.
   I understand that if the number of requests is too small, you should go to 
the service details page to view the linear chart,  I also understand that if 
this algorithm is not used, the calculation of the failure rate will be 
abnormal. But I prefer that each displayed indicator can clearly show its value.
   **In fact, skywalking has already supported this kind of demand very well.** 
For the four indicators in the figure below, the api we call is 
`readMetricsValues`, which queries all the indicator values ​​in the time 
period. There is no metric data for unit time The zero-assignment process is 
performed, and the average value is finally calculated on the UI. This 
calculation method is very suitable for CPM indicators. If there is no request 
per unit time, it should be counted as zero request. For the other three 
indicators, we can use the `readMetricsValue` api. This interface will not fill 
in zeros for the time period without indicator values. The only small problem 
now is that the Long type value returned by this interface is not accurate 
enough.
   
   
![image](https://user-images.githubusercontent.com/15099549/205570816-7a335543-74fc-4563-bcd1-0606473cf977.png)
   
   
   ### 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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to