Definition for v_monitor.cpu_usage
Hi,
We extract a number of dc performance tables to a monitoring Vertica database, each of our clusters has its own schema and use Grafana as a dashboard.
In the past we have copied some of the v_monitor views to select from our history tables, but I can't remember where the DDL for the original definitions are stored.
Particularly looking at the query used by v_monitor.CPU_USAGE, does anyone have a copy or remember where they are kept?
We just copy the original view and point it our history schema.
Regards
Tim
Best Answer
-
SruthiA Administrator
@Tim_1 Please run the below query so that you can get the view definition for cpu_usage.
select * from vs_system_views where view_name ilike 'cpu_usage';
view_schema | view_name | view_description | query_string
-------------+-----------+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
v_monitor | cpu_usage | CPU usage history | create view "v_monitor"."cpu_usage" as SELECT
node_name,
round(start_time, 'MI') as start_time,
round(end_time, 'MI') as end_time,
round(100 -
((idle_microseconds_end_value - idle_microseconds_start_value)::float /
(user_microseconds_end_value + nice_microseconds_end_value + system_microseconds_end_value
+ idle_microseconds_end_value + io_wait_microseconds_end_value + irq_microseconds_end_value
+ soft_irq_microseconds_end_value + steal_microseconds_end_value + guest_microseconds_end_value
- user_microseconds_start_value - nice_microseconds_start_value - system_microseconds_start_value
- idle_microseconds_start_value - io_wait_microseconds_start_value - irq_microseconds_start_value
- soft_irq_microseconds_start_value - steal_microseconds_start_value - guest_microseconds_start_value)
) * 100, 2.0) average_cpu_usage_percent
FROM v_internal.dc_cpu_aggregate_by_minute
;(1 row)
0
Answers
Perfect