-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qa-engine: implement
fetch_adoption_metrics_per_connector_version
(#…
- Loading branch information
1 parent
74b5dbf
commit 3f15459
Showing
5 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tools/ci_connector_ops/ci_connector_ops/qa_engine/connector_adoption.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
WITH official_connector_syncs AS ( | ||
SELECT * FROM airbyte_warehouse.connector_sync WHERE is_officially_published and (job_status = "failed" or job_status = "succeeded") | ||
), | ||
adoption_per_version AS ( | ||
SELECT | ||
connector_definition_id, | ||
docker_repository, | ||
connector_version, | ||
COUNT(distinct(user_id)) as number_of_users, | ||
COUNT(distinct(connection_id)) as number_of_connections | ||
FROM | ||
official_connector_syncs | ||
GROUP BY connector_definition_id, docker_repository, connector_version | ||
), | ||
job_status_per_version AS ( | ||
SELECT | ||
connector_definition_id, | ||
docker_repository, | ||
connector_version, | ||
job_status, | ||
COUNT(1) as sync_count | ||
FROM official_connector_syncs | ||
GROUP BY connector_definition_id, docker_repository, connector_version, job_status | ||
), | ||
success_failure_by_connector_version AS ( | ||
SELECT | ||
connector_definition_id, | ||
docker_repository, | ||
connector_version, | ||
ifnull(failed, 0) as failed_syncs_count, | ||
ifnull(succeeded, 0) as succeeded_syncs_count, | ||
ifnull(succeeded, 0) + ifnull(failed, 0) as total_syncs_count, | ||
SAFE_DIVIDE(ifnull(succeeded, 0), ifnull(succeeded, 0) + ifnull(failed, 0)) as sync_success_rate | ||
FROM job_status_per_version | ||
PIVOT | ||
( | ||
max(sync_count) | ||
FOR job_status in ('failed', 'succeeded') | ||
) | ||
) | ||
SELECT | ||
* | ||
FROM | ||
adoption_per_version | ||
LEFT JOIN success_failure_by_connector_version | ||
USING (connector_definition_id, docker_repository, connector_version); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters