Skip to content

Instantly share code, notes, and snippets.

@erez-rabih
Created December 3, 2024 20:16
Show Gist options
  • Save erez-rabih/8a43af1a452067843929646d3688684d to your computer and use it in GitHub Desktop.
Save erez-rabih/8a43af1a452067843929646d3688684d to your computer and use it in GitHub Desktop.
SELECT time, owners.name, percentile(pods.cpu, p95) FROM owners 
JOIN pod_owners ON owners.id = pod_owners.owner_id
JOIN pods ON pod_owners.pod_name = pods.name
WHERE pods.time BETWEEN NOW() AND NOW() - '7 days'
GROUP BY time, owners.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment