dosubot[bot] commented on issue #7971:
URL: 
https://github.com/apache/incubator-devlake/issues/7971#issuecomment-2313125083

   <!-- Answer -->
   The discrepancy in the Change Failure Rate metric between the DORA home 
dashboard and the "DORA Details - Change Failure Rate" page is likely due to 
differences in how deployments and incidents are aggregated and counted. 
Specifically, DevLake considers multiple deployments triggered by one pipeline 
as a single deployment and uses the last deployment's finished date as the 
deployment finished date. This aggregation can lead to discrepancies if the two 
dashboards are not using the same aggregation logic or if there are differences 
in the time filters applied 
<sup>[[1]](https://github.com/apache/incubator-devlake-website/blob/main/docs/Metrics/CFR.md)</sup>.
   
   Additionally, the SQL queries used for calculating the Change Failure Rate 
differ in their logic for counting incidents:
   
   1. The first query counts incidents using this logic:
      ```sql
      count(
        distinct case
          when i.id is not null then d.deployment_id
          else null
        end
      ) as has_incident
      ```
      This effectively counts the deployment if it is linked to any incident.
   
   2. The second query simplifies it to:
      ```sql
      count(distinct i.id) as has_incident
      ```
      This directly counts the distinct incident IDs, which might yield 
different results depending on how deployments are linked to incidents 
<sup>[[2]](https://github.com/apache/incubator-devlake/blob/main/grafana/dashboards/DORADetails-ChangeFailureRate.json)</sup><sup>[[3]](https://github.com/apache/incubator-devlake/blob/main/grafana/dashboards/DORA.json)</sup>.
   
   These differences in incident counting logic can result in different Change 
Failure Rate values being displayed on the two dashboards.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
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: dev-unsubscr...@devlake.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to