<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CPU usage and idle time metrics from system tables in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/116314#M45286</link>
    <description>&lt;P&gt;I need to get my compute metric, not from the UI...the system tables has not much informations, node_timeline has per minute record metric so it's difficult to calculate each compute CPU usage per day. Any way we can get the CPU usage,CPU idle time,Memory Usage for each clusters per day? I need a sql query for getting this details&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2025 11:13:24 GMT</pubDate>
    <dc:creator>santhiya</dc:creator>
    <dc:date>2025-04-23T11:13:24Z</dc:date>
    <item>
      <title>CPU usage and idle time metrics from system tables</title>
      <link>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/116314#M45286</link>
      <description>&lt;P&gt;I need to get my compute metric, not from the UI...the system tables has not much informations, node_timeline has per minute record metric so it's difficult to calculate each compute CPU usage per day. Any way we can get the CPU usage,CPU idle time,Memory Usage for each clusters per day? I need a sql query for getting this details&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 11:13:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/116314#M45286</guid>
      <dc:creator>santhiya</dc:creator>
      <dc:date>2025-04-23T11:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: CPU usage and idle time metrics from system tables</title>
      <link>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/116333#M45288</link>
      <description>&lt;DIV class="paragraph"&gt;To calculate CPU usage, CPU idle time, and memory usage per cluster per day, you can use the &lt;CODE&gt;system.compute.node_timeline&lt;/CODE&gt; system table. However, since the data in this table is recorded at per-minute granularity, it’s necessary to aggregate the data to a daily level.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;Below is a SQL query that you can use to calculate daily averages for CPU usage, CPU idle time, and memory utilization for each cluster:&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-sql"&gt;WITH per_cluster_daily AS (
  SELECT
    cluster_id,
    DATE_TRUNC('DAY', start_time) AS day,
    AVG(cpu_user_percent + cpu_system_percent) AS avg_cpu_usage_percent, -- Average CPU usage as the sum of user and system CPU
    AVG(cpu_idle_percent) AS avg_cpu_idle_percent,                      -- Average CPU idle time percentage
    AVG(mem_used_percent) AS avg_memory_usage_percent                   -- Average memory usage percentage
  FROM
    system.compute.node_timeline
  WHERE
    start_time &amp;gt;= CURRENT_DATE - INTERVAL 30 DAYS -- Limit data to the last 30 days (optional)
  GROUP BY
    cluster_id,
    DATE_TRUNC('DAY', start_time)
)
SELECT
  cluster_id,
  day,
  avg_cpu_usage_percent,
  avg_cpu_idle_percent,
  avg_memory_usage_percent
FROM
  per_cluster_daily
ORDER BY
  cluster_id,
  day;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;Note: - This query uses columns like &lt;CODE&gt;cpu_user_percent&lt;/CODE&gt;, &lt;CODE&gt;cpu_system_percent&lt;/CODE&gt;, &lt;CODE&gt;cpu_idle_percent&lt;/CODE&gt;, and &lt;CODE&gt;mem_used_percent&lt;/CODE&gt; directly from the &lt;CODE&gt;system.compute.node_timeline&lt;/CODE&gt; table, as these metrics are captured at per-minute granularity.&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Apr 2025 13:39:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/116333#M45288</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-04-23T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: CPU usage and idle time metrics from system tables</title>
      <link>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/131050#M48972</link>
      <description>&lt;P&gt;I wanna list all the users who has access to the specific cluster and its usage like start and end time of cluster, total cost and so on do you write a query on it&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 17:13:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cpu-usage-and-idle-time-metrics-from-system-tables/m-p/131050#M48972</guid>
      <dc:creator>mas10</dc:creator>
      <dc:date>2025-09-05T17:13:28Z</dc:date>
    </item>
  </channel>
</rss>

