Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Commit

Permalink
feat(schema/caag): add pod count caag
Browse files Browse the repository at this point in the history
  • Loading branch information
zls committed Feb 10, 2020
1 parent 70865db commit f3b5efe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions schema/cagg/deployment/pod_count.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE VIEW agg_pod_count
WITH (
timescaledb.continuous,
timescaledb.refresh_interval = '60m',
timescaledb.refresh_lag = '60m')
AS SELECT
lid,
time_bucket('60 minutes', time) AS "bucket",
MIN(value) AS min_pods,
AVG(value) AS avg_pods,
MAX(value) AS max_pods
FROM metric_samples
WHERE
name = 'kube_deployment_status_replicas_available'
GROUP BY lid, bucket;

0 comments on commit f3b5efe

Please sign in to comment.