From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001
From: Martial Simon <msimon_fr@hotmail.com>
Date: Mon, 15 Sep 2025 01:08:27 +0200
Subject: add: graphs et rushs

---
 graphs/sql/maas/req05_select.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 graphs/sql/maas/req05_select.sql

(limited to 'graphs/sql/maas/req05_select.sql')

diff --git a/graphs/sql/maas/req05_select.sql b/graphs/sql/maas/req05_select.sql
new file mode 100644
index 0000000..2a8e816
--- /dev/null
+++ b/graphs/sql/maas/req05_select.sql
@@ -0,0 +1,12 @@
+SELECT
+    name AS zone_name,
+    COUNT(DISTINCT data_center_id) AS data_center_count,
+    COUNT(DISTINCT sh.id) AS total_servers,
+    SUM(core_count) AS total_cores,
+    SUM(ram) AS total_ram,
+    SUM(storage) AS total_storage
+FROM memorin.server_hierarchy AS sh
+INNER JOIN memorin.geographic_zones AS z
+ON z.id = zone_id
+GROUP BY name
+ORDER BY data_center_count DESC, total_servers DESC, zone_name
-- 
cgit v1.2.3

