diff --git a/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_activity_report_aggregation.sql b/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_activity_report_aggregation.sql index ca1d59787..0c304b9de 100644 --- a/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_activity_report_aggregation.sql +++ b/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_activity_report_aggregation.sql @@ -58,7 +58,8 @@ SELECT SUM(IF(metricName = 'srs-cont-transfer-query', count, 0)) AS srs_cont_transfer_query, SUM(IF(metricName = 'srs-cont-transfer-reject', count, 0)) AS srs_cont_transfer_reject, SUM(IF(metricName = 'srs-cont-transfer-request', count, 0)) AS srs_cont_transfer_request, - SUM(IF(metricName = 'srs-cont-update', count, 0)) AS srs_cont_update + SUM(IF(metricName = 'srs-cont-update', count, 0)) AS srs_cont_update, + SUM(IF(metricName = 'rdap-queries', count, 0)) AS rdap_queries -- Cross join a list of all TLDs against TLD-specific metrics and then -- filter so that only metrics with that TLD or a NULL TLD are counted -- towards a given TLD. diff --git a/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_transaction_counts.sql b/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_transaction_counts.sql index 006398a77..763958f7b 100644 --- a/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_transaction_counts.sql +++ b/core/src/main/resources/google/registry/reporting/icann/sql/cloud_sql_transaction_counts.sql @@ -56,7 +56,7 @@ FROM ( -- should have negligible impact as the edge cage happens very rarely, more specifically -- when a cancellation happens during grace period by a registrar other than the the -- owning one. All the numbers here should be positive to pass ICANN validation. - MAX(report_amount, 0) AS amount, + GREATEST(report_amount, 0) AS amount, reporting_time AS reportingTime FROM EXTERNAL_QUERY("projects/%PROJECT_ID%/locations/us/connections/%PROJECT_ID%-sql", ''' SELECT history_type, history_other_registrar_id, history_registrar_id, domain_repo_id, history_revision_id FROM "DomainHistory";''') AS dh diff --git a/core/src/main/resources/google/registry/reporting/icann/sql/whois_counts.sql b/core/src/main/resources/google/registry/reporting/icann/sql/whois_counts.sql index d118d1c33..07fa4d107 100644 --- a/core/src/main/resources/google/registry/reporting/icann/sql/whois_counts.sql +++ b/core/src/main/resources/google/registry/reporting/icann/sql/whois_counts.sql @@ -23,6 +23,7 @@ SELECT CASE WHEN requestPath = '/_dr/whois' THEN 'whois-43-queries' WHEN SUBSTR(requestPath, 0, 7) = '/whois/' THEN 'web-whois-queries' + WHEN SUBSTR(requestPath, 0, 6) = '/rdap/' THEN 'rdap-queries' END AS metricName, COUNT(requestPath) AS count FROM diff --git a/core/src/test/resources/google/registry/reporting/icann/activity_report_aggregation_test_cloud_sql.sql b/core/src/test/resources/google/registry/reporting/icann/activity_report_aggregation_test_cloud_sql.sql index f1340963c..d933d6746 100644 --- a/core/src/test/resources/google/registry/reporting/icann/activity_report_aggregation_test_cloud_sql.sql +++ b/core/src/test/resources/google/registry/reporting/icann/activity_report_aggregation_test_cloud_sql.sql @@ -58,7 +58,8 @@ SELECT SUM(IF(metricName = 'srs-cont-transfer-query', count, 0)) AS srs_cont_transfer_query, SUM(IF(metricName = 'srs-cont-transfer-reject', count, 0)) AS srs_cont_transfer_reject, SUM(IF(metricName = 'srs-cont-transfer-request', count, 0)) AS srs_cont_transfer_request, - SUM(IF(metricName = 'srs-cont-update', count, 0)) AS srs_cont_update + SUM(IF(metricName = 'srs-cont-update', count, 0)) AS srs_cont_update, + SUM(IF(metricName = 'rdap-queries', count, 0)) AS rdap_queries -- Cross join a list of all TLDs against TLD-specific metrics and then -- filter so that only metrics with that TLD or a NULL TLD are counted -- towards a given TLD. diff --git a/core/src/test/resources/google/registry/reporting/icann/transaction_counts_test_cloud_sql.sql b/core/src/test/resources/google/registry/reporting/icann/transaction_counts_test_cloud_sql.sql index cf0db80e4..2e52d80d3 100644 --- a/core/src/test/resources/google/registry/reporting/icann/transaction_counts_test_cloud_sql.sql +++ b/core/src/test/resources/google/registry/reporting/icann/transaction_counts_test_cloud_sql.sql @@ -56,7 +56,7 @@ FROM ( -- should have negligible impact as the edge cage happens very rarely, more specifically -- when a cancellation happens during grace period by a registrar other than the the -- owning one. All the numbers here should be positive to pass ICANN validation. - MAX(report_amount, 0) AS amount, + GREATEST(report_amount, 0) AS amount, reporting_time AS reportingTime FROM EXTERNAL_QUERY("projects/domain-registry-alpha/locations/us/connections/domain-registry-alpha-sql", ''' SELECT history_type, history_other_registrar_id, history_registrar_id, domain_repo_id, history_revision_id FROM "DomainHistory";''') AS dh diff --git a/core/src/test/resources/google/registry/reporting/icann/whois_counts_test_cloud_sql.sql b/core/src/test/resources/google/registry/reporting/icann/whois_counts_test_cloud_sql.sql index d79df769f..0c5a8a584 100644 --- a/core/src/test/resources/google/registry/reporting/icann/whois_counts_test_cloud_sql.sql +++ b/core/src/test/resources/google/registry/reporting/icann/whois_counts_test_cloud_sql.sql @@ -23,6 +23,7 @@ SELECT CASE WHEN requestPath = '/_dr/whois' THEN 'whois-43-queries' WHEN SUBSTR(requestPath, 0, 7) = '/whois/' THEN 'web-whois-queries' + WHEN SUBSTR(requestPath, 0, 6) = '/rdap/' THEN 'rdap-queries' END AS metricName, COUNT(requestPath) AS count FROM