Commit 9f8316ac authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Average values should be rounded to 2 decimals

parent 88d454db
......@@ -29,8 +29,8 @@ CREATE OR REPLACE VIEW resource_usage_stats AS
CONCAT(rc.name,'(',rc.resource_class_id,')') resource_class,
u.exit_status,
count(*) workers,
min(mem_megs) AS min_mem_megs, avg(mem_megs) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, avg(swap_megs) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
min(mem_megs) AS min_mem_megs, round(avg(mem_megs),2) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, round(avg(swap_megs),2) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
FROM analysis_base a
JOIN resource_class rc USING(resource_class_id)
LEFT JOIN role r USING(analysis_id)
......
......@@ -29,8 +29,8 @@ CREATE OR REPLACE VIEW resource_usage_stats AS
rc.name || '(' || rc.resource_class_id || ')' resource_class,
u.exit_status,
count(*) workers,
min(mem_megs) AS min_mem_megs, avg(mem_megs) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, avg(swap_megs) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
min(mem_megs) AS min_mem_megs, round(avg(mem_megs),2) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, round(avg(swap_megs),2) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
FROM resource_class rc
JOIN analysis_base a USING(resource_class_id)
LEFT JOIN role r USING(analysis_id)
......
......@@ -74,8 +74,8 @@ CREATE OR REPLACE VIEW resource_usage_stats AS
CONCAT(rc.name,'(',rc.resource_class_id,')') resource_class,
u.exit_status,
count(*) workers,
min(mem_megs) AS min_mem_megs, avg(mem_megs) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, avg(swap_megs) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
min(mem_megs) AS min_mem_megs, round(avg(mem_megs),2) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, round(avg(swap_megs),2) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
FROM resource_class rc
JOIN analysis_base a USING(resource_class_id)
LEFT JOIN role r USING(analysis_id)
......
......@@ -74,8 +74,8 @@ CREATE OR REPLACE VIEW resource_usage_stats AS
rc.name || '(' || rc.resource_class_id || ')' resource_class,
u.exit_status,
count(*) workers,
min(mem_megs) AS min_mem_megs, avg(mem_megs) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, avg(swap_megs) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
min(mem_megs) AS min_mem_megs, round(avg(mem_megs),2) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, round(avg(swap_megs),2) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
FROM resource_class rc
JOIN analysis_base a USING(resource_class_id)
LEFT JOIN role r USING(analysis_id)
......
......@@ -74,8 +74,8 @@ CREATE VIEW IF NOT EXISTS resource_usage_stats AS
rc.name || '(' || rc.resource_class_id || ')' resource_class,
u.exit_status,
count(*) workers,
min(mem_megs) AS min_mem_megs, avg(mem_megs) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, avg(swap_megs) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
min(mem_megs) AS min_mem_megs, round(avg(mem_megs),2) AS avg_mem_megs, max(mem_megs) AS max_mem_megs,
min(swap_megs) AS min_swap_megs, round(avg(swap_megs),2) AS avg_swap_megs, max(swap_megs) AS max_swap_megs
FROM resource_class rc
JOIN analysis_base a USING(resource_class_id)
LEFT JOIN role r USING(analysis_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment