From ec1f5edd5c4bf375a35dd8220c608c6f687afbbf Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 9 Sep 2022 14:40:41 -0400 Subject: [PATCH] on-prem analytics queries --- analytics/tts_results.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/analytics/tts_results.sql b/analytics/tts_results.sql index 9948c93b94..7684820a6f 100644 --- a/analytics/tts_results.sql +++ b/analytics/tts_results.sql @@ -16,3 +16,18 @@ select count(*) as use_count from tts_results where created_at > ( CURDATE() - INTERVAL 7 DAY ) +-- On-prem worker mix +select count(*) as use_count +from tts_results +where created_at > ( CURDATE() - INTERVAL 1 MINUTE ) +and is_generated_on_prem IS TRUE + +-- Calculate a percentage of on-prem worker capacity +select count(*) as on_prem_count +from ( + select is_generated_on_prem + from tts_results + order by id desc limit 1000 +) as sample +where sample.is_generated_on_prem IS TRUE; +