feat(db): include default metrics in init_schema.sql
feat(api): refactored overview
This commit is contained in:
parent
ef4c9a5bf5
commit
92fb75b228
4 changed files with 32 additions and 6 deletions
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker build -f ./Dockerfile --build-arg envarg="default-foss" -t chalice:local .
|
||||
|
|
@ -388,8 +388,10 @@ def get_dashboard_group(projectId: int, data: schemas.MetricPayloadSchema = Body
|
|||
"data": dashboard.get_time_to_render(project_id=projectId, **data.dict())},
|
||||
{"key": schemas.TemplateKeys.avg_used_js_heap_size,
|
||||
"data": dashboard.get_memory_consumption(project_id=projectId, **data.dict())},
|
||||
{"key": schemas.TemplateKeys.avg_cpu, "data": dashboard.get_avg_cpu(project_id=projectId, **data.dict())},
|
||||
{"key": schemas.TemplateKeys.avg_fps, "data": dashboard.get_avg_fps(project_id=projectId, **data.dict())}
|
||||
{"key": schemas.TemplateKeys.avg_cpu,
|
||||
"data": dashboard.get_avg_cpu(project_id=projectId, **data.dict())},
|
||||
{"key": schemas.TemplateKeys.avg_fps,
|
||||
"data": dashboard.get_avg_fps(project_id=projectId, **data.dict())}
|
||||
]
|
||||
results = sorted(results, key=lambda r: r["key"])
|
||||
return {"data": results}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ VALUES ('sessions count', 'overview', '{}', true, true, true, 'count_sessions'),
|
|||
('avg first contentful pixel', 'overview', '{}', true, true, true, 'avg_first_contentful_pixel'),
|
||||
('avg visited pages count', 'overview', '{}', true, true, true, 'avg_visited_pages'),
|
||||
('avg session duration', 'overview', '{}', true, true, true, 'avg_session_duration'),
|
||||
('avg pages dom buildtime', 'overview', '{}', true, true, true, 'avg_pages_dom_buildtime'),
|
||||
('avg pages dom build time', 'overview', '{}', true, true, true, 'avg_pages_dom_buildtime'),
|
||||
('avg pages response time', 'overview', '{}', true, true, true, 'avg_pages_response_time'),
|
||||
('avg response time', 'overview', '{}', true, true, true, 'avg_response_time'),
|
||||
('avg first paint', 'overview', '{}', true, true, true, 'avg_first_paint'),
|
||||
|
|
|
|||
|
|
@ -1025,4 +1025,31 @@ $$
|
|||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
INSERT INTO metrics (name, category, config, is_predefined, is_template, is_public, key)
|
||||
VALUES ('sessions count', 'overview', '{}', true, true, true, 'count_sessions'),
|
||||
('avg request load time', 'overview', '{}', true, true, true, 'avg_request_load_time'),
|
||||
('avg page load time', 'overview', '{}', true, true, true, 'avg_page_load_time'),
|
||||
('avg image load time', 'overview', '{}', true, true, true, 'avg_image_load_time'),
|
||||
('avg dom content load start', 'overview', '{}', true, true, true, 'avg_dom_content_load_start'),
|
||||
('avg first contentful pixel', 'overview', '{}', true, true, true, 'avg_first_contentful_pixel'),
|
||||
('avg visited pages count', 'overview', '{}', true, true, true, 'avg_visited_pages'),
|
||||
('avg session duration', 'overview', '{}', true, true, true, 'avg_session_duration'),
|
||||
('avg pages dom build time', 'overview', '{}', true, true, true, 'avg_pages_dom_buildtime'),
|
||||
('avg pages response time', 'overview', '{}', true, true, true, 'avg_pages_response_time'),
|
||||
('avg response time', 'overview', '{}', true, true, true, 'avg_response_time'),
|
||||
('avg first paint', 'overview', '{}', true, true, true, 'avg_first_paint'),
|
||||
('avg dom content loaded', 'overview', '{}', true, true, true, 'avg_dom_content_loaded'),
|
||||
('avg time till first bit', 'overview', '{}', true, true, true, 'avg_till_first_bit'),
|
||||
('avg time to interactive', 'overview', '{}', true, true, true, 'avg_time_to_interactive'),
|
||||
('requests count', 'overview', '{}', true, true, true, 'count_requests'),
|
||||
('avg time to render', 'overview', '{}', true, true, true, 'avg_time_to_render'),
|
||||
('avg used js heap size', 'overview', '{}', true, true, true, 'avg_used_js_heap_size'),
|
||||
('avg cpu', 'overview', '{}', true, true, true, 'avg_cpu')
|
||||
ON CONFLICT (key) DO UPDATE SET name=excluded.name,
|
||||
category=excluded.category,
|
||||
config=excluded.config,
|
||||
is_predefined=excluded.is_predefined,
|
||||
is_template=excluded.is_template,
|
||||
is_public=excluded.is_public;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Add table
Reference in a new issue