TASK #165 · Hard · DynatraceCPU Sample with Daily Server Baselines
Your brief
To let a Dynatrace operator quickly spot a CPU sample that deviates
from its server's normal load that day, we want to show every
individual sample alongside the daily aggregates of the same server.
Write a query that returns every row from server_metrics with the columns metric_id, server_id, sample_time, cpu_pct, plus three extra columns: day_avg_cpu (rounded to two decimals), day_max_cpu, day_min_cpu — aggregates over the same server_id and the same calendar day.
Sort by server_id, then by sample_time.
Write a query that returns every row from server_metrics with the columns metric_id, server_id, sample_time, cpu_pct, plus three extra columns: day_avg_cpu (rounded to two decimals), day_max_cpu, day_min_cpu — aggregates over the same server_id and the same calendar day.
Sort by server_id, then by sample_time.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
applicationsapplication_id, namelogslog_id, application_id, response_time_ms, recorded_atserver_metricsmetric_id, server_id, sample_time, cpu_pct, mem_pct, disk_gb, net_mb