Yaniv Dary has uploaded a new change for review. Change subject: history: added users tables views ......................................................................
history: added users tables views Change-Id: I53af9329bb8d59a767aea797af0656f5d62e0024 Signed-off-by: Yaniv Dary <yd...@redhat.com> --- M data-warehouse/historydbscripts_postgres/create_views_3_2.sql M data-warehouse/historydbscripts_postgres/upgrade/03_02_0010_add_vm_users_usage_tables.sql 2 files changed, 48 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/34/9334/1 diff --git a/data-warehouse/historydbscripts_postgres/create_views_3_2.sql b/data-warehouse/historydbscripts_postgres/create_views_3_2.sql index 0134911..114743e 100644 --- a/data-warehouse/historydbscripts_postgres/create_views_3_2.sql +++ b/data-warehouse/historydbscripts_postgres/create_views_3_2.sql @@ -557,6 +557,52 @@ LEFT OUTER JOIN vm_disks_usage_daily_history as b ON (a.history_datetime = b.history_datetime AND a.vm_id = b.vm_id); +CREATE OR REPLACE VIEW v3_2_statistics_vms_users_usage_hourly + AS +SELECT history_id, + history_datetime, + user_name, + vm_id, + session_time_in_minutes, + cpu_usage_percent, + max_cpu_usage, + memory_usage_percent, + max_memory_usage, + user_cpu_usage_percent, + max_user_cpu_usage_percent, + system_cpu_usage_percent, + max_system_cpu_usage_percent, + vm_last_up_time, + vm_last_boot_time, + vm_ip, + currently_running_on_host, + vm_configuration_version, + current_host_configuration_version +FROM statistics_vms_users_usage_hourly; + +CREATE OR REPLACE VIEW v3_2_statistics_vms_users_usage_daily + AS +SELECT history_id, + history_datetime, + user_name, + vm_id, + session_time_in_minutes, + cpu_usage_percent, + max_cpu_usage, + memory_usage_percent, + max_memory_usage, + user_cpu_usage_percent, + max_user_cpu_usage_percent, + system_cpu_usage_percent, + max_system_cpu_usage_percent, + vm_last_up_time, + vm_last_boot_time, + vm_ip, + currently_running_on_host, + vm_configuration_version, + current_host_configuration_version +FROM statistics_vms_users_usage_daily; + CREATE OR REPLACE VIEW v3_2_configuration_history_vms_interfaces AS SELECT diff --git a/data-warehouse/historydbscripts_postgres/upgrade/03_02_0010_add_vm_users_usage_tables.sql b/data-warehouse/historydbscripts_postgres/upgrade/03_02_0010_add_vm_users_usage_tables.sql index fb126c2..6a69046 100644 --- a/data-warehouse/historydbscripts_postgres/upgrade/03_02_0010_add_vm_users_usage_tables.sql +++ b/data-warehouse/historydbscripts_postgres/upgrade/03_02_0010_add_vm_users_usage_tables.sql @@ -5,7 +5,7 @@ history_datetime TIMESTAMP WITH TIME ZONE NOT NULL, user_name VARCHAR(255), vm_id UUID NOT NULL, - session_time_in_status DECIMAL(7,2) NOT NULL DEFAULT 1, + session_time_in_minutes DECIMAL(7,2) NOT NULL DEFAULT 1, cpu_usage_percent SMALLINT DEFAULT 0, max_cpu_usage SMALLINT, memory_usage_percent SMALLINT DEFAULT 0, @@ -33,7 +33,7 @@ history_datetime TIMESTAMP WITH TIME ZONE NOT NULL, user_name VARCHAR(255), vm_id UUID NOT NULL, - session_time_in_status DECIMAL(7,2) NOT NULL DEFAULT 1, + session_time_in_minutes DECIMAL(7,2) NOT NULL DEFAULT 1, cpu_usage_percent SMALLINT DEFAULT 0, max_cpu_usage SMALLINT, memory_usage_percent SMALLINT DEFAULT 0, -- To view, visit http://gerrit.ovirt.org/9334 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53af9329bb8d59a767aea797af0656f5d62e0024 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-dwh Gerrit-Branch: master Gerrit-Owner: Yaniv Dary <yd...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches