Skip to content

Commit fc6e5b9

Browse files
authored
convert infra report to daily values (#135)
1 parent 73ee198 commit fc6e5b9

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

kokudaily/sql/key_metrics/cust_cloud_costs_data.sql

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ select
88
SUM(oci_cost) AS "oci_cost"
99
from __cust_cloud_cost_report
1010
GROUP BY DATE_TRUNC('month', date)
11+
ORDER BY DATE_TRUNC('month', date)
1112
;

kokudaily/sql/key_metrics/cust_openshift_costs_data.sql

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ select
1212
SUM(sup_cost_model_volume_cost) AS "sup_cost_model_volume_cost"
1313
from __cust_openshift_cost_report
1414
GROUP BY DATE_TRUNC('month', date)
15+
ORDER BY DATE_TRUNC('month', date)
1516
;
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
select * from __cust_openshift_infra_report;
1+
SELECT
2+
to_char(DATE_TRUNC('month', date), 'YYYY-MM') AS month,
3+
SUM(cluster_count) AS total_cluster_count,
4+
SUM(node_count) AS total_node_count,
5+
SUM(infra_node_count) AS total_infra_node_count,
6+
SUM(control_plane_node_count) AS total_control_plane_node_count,
7+
SUM(worker_node_count) AS total_worker_node_count,
8+
SUM(infra_node_cpu_cores) AS total_infra_node_cpu_cores,
9+
SUM(control_plane_node_cpu_cores) AS total_control_plane_node_cpu_cores,
10+
SUM(worker_node_cpu_cores) AS total_worker_node_cpu_cores,
11+
SUM(infra_node_mem_gb) AS total_infra_node_mem_gb,
12+
SUM(control_plane_node_mem_gb) AS total_control_plane_node_mem_gb,
13+
SUM(worker_node_mem_gb) AS total_worker_node_mem_gb,
14+
SUM(pvc_count) AS total_pvc_count,
15+
SUM(cluster_capacity_cores) AS total_cluster_capacity_cores,
16+
SUM(cluster_capacity_core_hours) AS total_cluster_capacity_core_hours,
17+
SUM(cluster_capacity_memory_gb) AS total_cluster_capacity_memory_gb,
18+
SUM(cluster_capacity_memory_gb_hours) AS total_cluster_capacity_memory_gb_hours,
19+
SUM(volume_request_gb) AS total_volume_request_gb,
20+
SUM(volume_request_gb_mo) AS total_volume_request_gb_mo,
21+
SUM(pvc_capacity_gb) AS total_pvc_capacity_gb,
22+
SUM(pvc_capacity_gb_mo) AS total_pvc_capacity_gb_mo
23+
FROM __cust_openshift_infra_report
24+
GROUP BY DATE_TRUNC('month', date)
25+
ORDER BY DATE_TRUNC('month', date)
26+
;

0 commit comments

Comments
 (0)