feat(api): dashboard support for Resources predefined templates
This commit is contained in:
parent
badae1249b
commit
c26b77ca89
6 changed files with 220 additions and 174 deletions
|
|
@ -270,6 +270,11 @@ PREDEFINED = {schemas.TemplatePredefinedKeys.count_sessions: dashboard.get_proce
|
|||
schemas.TemplatePredefinedKeys.pages_dom_buildtime: dashboard.get_pages_dom_build_time,
|
||||
schemas.TemplatePredefinedKeys.pages_response_time: dashboard.get_pages_response_time,
|
||||
schemas.TemplatePredefinedKeys.pages_response_time_distribution: dashboard.get_pages_response_time_distribution,
|
||||
schemas.TemplatePredefinedKeys.missing_resources: dashboard.get_missing_resources_trend,
|
||||
schemas.TemplatePredefinedKeys.slowest_resources: dashboard.get_slowest_resources,
|
||||
schemas.TemplatePredefinedKeys.resources_fetch_time: dashboard.get_resources_loading_time,
|
||||
schemas.TemplatePredefinedKeys.resource_type_vs_response_end: dashboard.resource_type_vs_response_end,
|
||||
schemas.TemplatePredefinedKeys.resources_count_by_type: dashboard.get_resources_count_by_type,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -927,7 +927,7 @@ class TemplatePredefinedKeys(str, Enum):
|
|||
avg_response_time = "avg_response_time"
|
||||
avg_first_paint = "avg_first_paint"
|
||||
avg_dom_content_loaded = "avg_dom_content_loaded"
|
||||
avg_till_first_bit = "avg_till_first_bit"
|
||||
avg_till_first_bit = "avg_till_first_byte"
|
||||
avg_time_to_interactive = "avg_time_to_interactive"
|
||||
count_requests = "count_requests"
|
||||
avg_time_to_render = "avg_time_to_render"
|
||||
|
|
@ -941,19 +941,24 @@ class TemplatePredefinedKeys(str, Enum):
|
|||
calls_errors = "calls_errors"
|
||||
errors_by_type = "errors_per_type"
|
||||
errors_by_origin = "resources_by_party"
|
||||
speed_index_by_location="speed_location"
|
||||
slowest_domains="slowest_domains"
|
||||
sessions_per_browser="sessions_per_browser"
|
||||
time_to_render="time_to_render"
|
||||
impacted_sessions_by_slow_pages="impacted_sessions_by_slow_pages"
|
||||
memory_consumption="memory_consumption"
|
||||
cpu_load="cpu"
|
||||
frame_rate="fps"
|
||||
crashes="crashes"
|
||||
resources_vs_visually_complete="resources_vs_visually_complete"
|
||||
pages_dom_buildtime="pages_dom_buildtime"
|
||||
pages_response_time="pages_response_time"
|
||||
pages_response_time_distribution="pages_response_time_distribution"
|
||||
speed_index_by_location = "speed_location"
|
||||
slowest_domains = "slowest_domains"
|
||||
sessions_per_browser = "sessions_per_browser"
|
||||
time_to_render = "time_to_render"
|
||||
impacted_sessions_by_slow_pages = "impacted_sessions_by_slow_pages"
|
||||
memory_consumption = "memory_consumption"
|
||||
cpu_load = "cpu"
|
||||
frame_rate = "fps"
|
||||
crashes = "crashes"
|
||||
resources_vs_visually_complete = "resources_vs_visually_complete"
|
||||
pages_dom_buildtime = "pages_dom_buildtime"
|
||||
pages_response_time = "pages_response_time"
|
||||
pages_response_time_distribution = "pages_response_time_distribution"
|
||||
missing_resources = "missing_resources"
|
||||
slowest_resources = "slowest_resources"
|
||||
resources_fetch_time = "resources_loading_time"
|
||||
resource_type_vs_response_end = "resource_type_vs_response_end"
|
||||
resources_count_by_type = "resources_count_by_type"
|
||||
|
||||
|
||||
class TemplatePredefinedUnits(str, Enum):
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ ALTER TABLE IF EXISTS metrics
|
|||
ADD COLUMN IF NOT EXISTS is_predefined boolean NOT NULL DEFAULT FALSE,
|
||||
ADD COLUMN IF NOT EXISTS is_template boolean NOT NULL DEFAULT FALSE,
|
||||
ADD COLUMN IF NOT EXISTS predefined_key text NULL DEFAULT NULL,
|
||||
ADD COLUMN IF NOT EXISTS config jsonb NOT NULL DEFAULT '{}'::jsonb,
|
||||
ADD COLUMN IF NOT EXISTS config jsonb NOT NULL DEFAULT '{"col":2,"row":2,"position":0}'::jsonb,
|
||||
ALTER COLUMN project_id DROP NOT NULL,
|
||||
ADD CONSTRAINT null_project_id_for_template_only
|
||||
CHECK ( (metrics.category != 'custom') != (metrics.project_id IS NOT NULL) ),
|
||||
|
|
@ -59,45 +59,54 @@ ALTER TYPE metric_type ADD VALUE IF NOT EXISTS 'predefined';
|
|||
|
||||
|
||||
INSERT INTO metrics (name, category, config, is_predefined, is_template, is_public, predefined_key, metric_type, view_type)
|
||||
VALUES ('sessions count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('avg request load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('avg page load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('avg image load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('avg dom content load start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('avg first contentful pixel', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('avg visited pages count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('avg session duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('avg pages dom build time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('avg pages response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('avg response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('avg first paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('avg dom content loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('avg time till first bit', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_bit', 'predefined', 'overview'),
|
||||
('avg time to interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('requests count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('avg time to render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('avg used js heap size', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('avg cpu', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('sessions affected by js errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('top domains with 4xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('top domains with 5xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('errors per domain', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('fetch calls with errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('errors by type', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('errors by origin', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
('speed index by location', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('slowest domains', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('sessions per browser', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('time to render', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('sessions impacted by slow pages', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('memory consumption', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('cpu load', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('frame rate', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('crashes', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('resources vs visually complete', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('dom build time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('pages response time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('pages response time distribution', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart')
|
||||
VALUES ('Captured sessions', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('Request Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('Page Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('Image Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('DOM Content Load Start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('First Meaningful paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('No. of Visited Pages', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('Session Duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('DOM Build Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('Pages Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('First Paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('DOM Content Loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('Time Till First byte', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_byte', 'predefined', 'overview'),
|
||||
('Time To Interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('Captured requests', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('Time To Render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('Memory Consumption', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('CPU Load', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('Frame rate', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_fps', 'predefined', 'overview'),
|
||||
|
||||
('Sessions Affected by JS Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('Top Domains with 4xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('Top Domains with 5xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('Errors per Domain', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('Fetch Calls with Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('Errors by Type', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('Errors by Origin', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
|
||||
('Speed Index by Location', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('Slowest Domains', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('Sessions per Browser', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('Time To Render', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('Sessions Impacted by Slow Pages', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('Memory Consumption', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('CPU Load', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('Frame Rate', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('Crashes', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('Resources Loaded vs Visually Complete', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('DOM Build Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('Pages Response Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('Pages Response Time Distribution', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart'),
|
||||
|
||||
('Missing Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'missing_resources', 'predefined', 'table'),
|
||||
('Slowest Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_resources', 'predefined', 'table'),
|
||||
('Resources Fetch Time', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_loading_time', 'predefined', 'table'),
|
||||
('Resource Loaded vs Response End', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resource_type_vs_response_end', 'predefined', 'stackedBarLineChart'),
|
||||
('Breakdown of Loaded Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_count_by_type', 'predefined', 'stackedBarChart')
|
||||
ON CONFLICT (predefined_key) DO UPDATE
|
||||
SET name=excluded.name,
|
||||
category=excluded.category,
|
||||
|
|
|
|||
|
|
@ -811,7 +811,7 @@ $$
|
|||
is_predefined boolean NOT NULL DEFAULT FALSE,
|
||||
is_template boolean NOT NULL DEFAULT FALSE,
|
||||
predefined_key text NULL DEFAULT NULL,
|
||||
config jsonb NOT NULL DEFAULT '{}'::jsonb,
|
||||
config jsonb NOT NULL DEFAULT '{"col": 2,"row": 2,"position": 0}'::jsonb,
|
||||
CONSTRAINT null_project_id_for_template_only
|
||||
CHECK ( (metrics.category != 'custom') != (metrics.project_id IS NOT NULL) ),
|
||||
CONSTRAINT unique_key UNIQUE (predefined_key)
|
||||
|
|
@ -1258,45 +1258,54 @@ $$
|
|||
LANGUAGE plpgsql;
|
||||
|
||||
INSERT INTO metrics (name, category, config, is_predefined, is_template, is_public, predefined_key, metric_type, view_type)
|
||||
VALUES ('sessions count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('avg request load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('avg page load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('avg image load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('avg dom content load start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('avg first contentful pixel', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('avg visited pages count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('avg session duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('avg pages dom build time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('avg pages response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('avg response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('avg first paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('avg dom content loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('avg time till first bit', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_bit', 'predefined', 'overview'),
|
||||
('avg time to interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('requests count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('avg time to render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('avg used js heap size', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('avg cpu', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('sessions affected by js errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('top domains with 4xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('top domains with 5xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('errors per domain', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('fetch calls with errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('errors by type', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('errors by origin', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
('speed index by location', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('slowest domains', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('sessions per browser', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('time to render', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('sessions impacted by slow pages', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('memory consumption', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('cpu load', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('frame rate', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('crashes', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('resources vs visually complete', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('dom build time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('pages response time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('pages response time distribution', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart')
|
||||
VALUES ('Captured sessions', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('Request Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('Page Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('Image Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('DOM Content Load Start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('First Meaningful paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('No. of Visited Pages', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('Session Duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('DOM Build Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('Pages Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('First Paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('DOM Content Loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('Time Till First byte', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_byte', 'predefined', 'overview'),
|
||||
('Time To Interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('Captured requests', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('Time To Render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('Memory Consumption', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('CPU Load', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('Frame rate', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_fps', 'predefined', 'overview'),
|
||||
|
||||
('Sessions Affected by JS Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('Top Domains with 4xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('Top Domains with 5xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('Errors per Domain', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('Fetch Calls with Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('Errors by Type', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('Errors by Origin', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
|
||||
('Speed Index by Location', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('Slowest Domains', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('Sessions per Browser', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('Time To Render', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('Sessions Impacted by Slow Pages', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('Memory Consumption', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('CPU Load', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('Frame Rate', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('Crashes', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('Resources Loaded vs Visually Complete', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('DOM Build Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('Pages Response Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('Pages Response Time Distribution', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart'),
|
||||
|
||||
('Missing Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'missing_resources', 'predefined', 'table'),
|
||||
('Slowest Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_resources', 'predefined', 'table'),
|
||||
('Resources Fetch Time', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_loading_time', 'predefined', 'table'),
|
||||
('Resource Loaded vs Response End', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resource_type_vs_response_end', 'predefined', 'stackedBarLineChart'),
|
||||
('Breakdown of Loaded Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_count_by_type', 'predefined', 'stackedBarChart')
|
||||
ON CONFLICT (predefined_key) DO UPDATE
|
||||
SET name=excluded.name,
|
||||
category=excluded.category,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ ALTER TABLE IF EXISTS metrics
|
|||
ADD COLUMN IF NOT EXISTS is_predefined boolean NOT NULL DEFAULT FALSE,
|
||||
ADD COLUMN IF NOT EXISTS is_template boolean NOT NULL DEFAULT FALSE,
|
||||
ADD COLUMN IF NOT EXISTS predefined_key text NULL DEFAULT NULL,
|
||||
ADD COLUMN IF NOT EXISTS config jsonb NOT NULL DEFAULT '{}'::jsonb,
|
||||
ADD COLUMN IF NOT EXISTS config jsonb NOT NULL DEFAULT '{"col":2,"row":2,"position":0}'::jsonb,
|
||||
ALTER COLUMN project_id DROP NOT NULL,
|
||||
ADD CONSTRAINT null_project_id_for_template_only
|
||||
CHECK ( (metrics.category != 'custom') != (metrics.project_id IS NOT NULL) ),
|
||||
|
|
@ -58,45 +58,54 @@ ALTER TYPE metric_view_type ADD VALUE IF NOT EXISTS 'map';
|
|||
ALTER TYPE metric_type ADD VALUE IF NOT EXISTS 'predefined';
|
||||
|
||||
INSERT INTO metrics (name, category, config, is_predefined, is_template, is_public, predefined_key, metric_type, view_type)
|
||||
VALUES ('sessions count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('avg request load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('avg page load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('avg image load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('avg dom content load start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('avg first contentful pixel', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('avg visited pages count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('avg session duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('avg pages dom build time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('avg pages response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('avg response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('avg first paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('avg dom content loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('avg time till first bit', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_bit', 'predefined', 'overview'),
|
||||
('avg time to interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('requests count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('avg time to render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('avg used js heap size', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('avg cpu', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('sessions affected by js errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('top domains with 4xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('top domains with 5xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('errors per domain', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('fetch calls with errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('errors by type', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('errors by origin', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
('speed index by location', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('slowest domains', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('sessions per browser', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('time to render', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('sessions impacted by slow pages', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('memory consumption', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('cpu load', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('frame rate', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('crashes', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('resources vs visually complete', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('dom build time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('pages response time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('pages response time distribution', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart')
|
||||
VALUES ('Captured sessions', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('Request Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('Page Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('Image Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('DOM Content Load Start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('First Meaningful paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('No. of Visited Pages', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('Session Duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('DOM Build Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('Pages Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('First Paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('DOM Content Loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('Time Till First byte', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_byte', 'predefined', 'overview'),
|
||||
('Time To Interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('Captured requests', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('Time To Render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('Memory Consumption', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('CPU Load', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('Frame rate', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_fps', 'predefined', 'overview'),
|
||||
|
||||
('Sessions Affected by JS Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('Top Domains with 4xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('Top Domains with 5xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('Errors per Domain', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('Fetch Calls with Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('Errors by Type', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('Errors by Origin', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
|
||||
('Speed Index by Location', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('Slowest Domains', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('Sessions per Browser', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('Time To Render', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('Sessions Impacted by Slow Pages', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('Memory Consumption', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('CPU Load', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('Frame Rate', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('Crashes', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('Resources Loaded vs Visually Complete', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('DOM Build Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('Pages Response Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('Pages Response Time Distribution', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart'),
|
||||
|
||||
('Missing Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'missing_resources', 'predefined', 'table'),
|
||||
('Slowest Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_resources', 'predefined', 'table'),
|
||||
('Resources Fetch Time', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_loading_time', 'predefined', 'table'),
|
||||
('Resource Loaded vs Response End', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resource_type_vs_response_end', 'predefined', 'stackedBarLineChart'),
|
||||
('Breakdown of Loaded Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_count_by_type', 'predefined', 'stackedBarChart')
|
||||
ON CONFLICT (predefined_key) DO UPDATE
|
||||
SET name=excluded.name,
|
||||
category=excluded.category,
|
||||
|
|
|
|||
|
|
@ -958,7 +958,7 @@ $$
|
|||
is_predefined boolean NOT NULL DEFAULT FALSE,
|
||||
is_template boolean NOT NULL DEFAULT FALSE,
|
||||
predefined_key text NULL DEFAULT NULL,
|
||||
config jsonb NOT NULL DEFAULT '{}'::jsonb,
|
||||
config jsonb NOT NULL DEFAULT '{"col": 2,"row": 2,"position": 0}'::jsonb,
|
||||
CONSTRAINT null_project_id_for_template_only
|
||||
CHECK ( (metrics.category != 'custom') != (metrics.project_id IS NOT NULL) ),
|
||||
CONSTRAINT unique_key UNIQUE (predefined_key)
|
||||
|
|
@ -1049,45 +1049,54 @@ $$
|
|||
LANGUAGE plpgsql;
|
||||
|
||||
INSERT INTO metrics (name, category, config, is_predefined, is_template, is_public, predefined_key, metric_type, view_type)
|
||||
VALUES ('sessions count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('avg request load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('avg page load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('avg image load time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('avg dom content load start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('avg first contentful pixel', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('avg visited pages count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('avg session duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('avg pages dom build time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('avg pages response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('avg response time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('avg first paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('avg dom content loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('avg time till first bit', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_bit', 'predefined', 'overview'),
|
||||
('avg time to interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('requests count', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('avg time to render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('avg used js heap size', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('avg cpu', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('sessions affected by js errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('top domains with 4xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('top domains with 5xx fetch errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('errors per domain', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('fetch calls with errors', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('errors by type', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('errors by origin', 'errors', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
('speed index by location', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('slowest domains', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('sessions per browser', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('time to render', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('sessions impacted by slow pages', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('memory consumption', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('cpu load', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('frame rate', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('crashes', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('resources vs visually complete', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('dom build time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('pages response time', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('pages response time distribution', 'performance', '{"col":1,"row":1,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart')
|
||||
VALUES ('Captured sessions', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_sessions', 'predefined', 'overview'),
|
||||
('Request Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_request_load_time', 'predefined', 'overview'),
|
||||
('Page Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_page_load_time', 'predefined', 'overview'),
|
||||
('Image Load Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_image_load_time', 'predefined', 'overview'),
|
||||
('DOM Content Load Start', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_load_start', 'predefined', 'overview'),
|
||||
('First Meaningful paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_contentful_pixel', 'predefined', 'overview'),
|
||||
('No. of Visited Pages', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_visited_pages', 'predefined', 'overview'),
|
||||
('Session Duration', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_session_duration', 'predefined', 'overview'),
|
||||
('DOM Build Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_dom_buildtime', 'predefined', 'overview'),
|
||||
('Pages Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_pages_response_time', 'predefined', 'overview'),
|
||||
('Response Time', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_response_time', 'predefined', 'overview'),
|
||||
('First Paint', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_first_paint', 'predefined', 'overview'),
|
||||
('DOM Content Loaded', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_dom_content_loaded', 'predefined', 'overview'),
|
||||
('Time Till First byte', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_till_first_byte', 'predefined', 'overview'),
|
||||
('Time To Interactive', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_interactive', 'predefined', 'overview'),
|
||||
('Captured requests', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'count_requests', 'predefined', 'overview'),
|
||||
('Time To Render', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_time_to_render', 'predefined', 'overview'),
|
||||
('Memory Consumption', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_used_js_heap_size', 'predefined', 'overview'),
|
||||
('CPU Load', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_cpu', 'predefined', 'overview'),
|
||||
('Frame rate', 'overview', '{"col":1,"row":1,"position":0}', true, true, true, 'avg_fps', 'predefined', 'overview'),
|
||||
|
||||
('Sessions Affected by JS Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_js_errors', 'predefined', 'barChart'),
|
||||
('Top Domains with 4xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_4xx', 'predefined', 'lineChart'),
|
||||
('Top Domains with 5xx Fetch Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'domains_errors_5xx', 'predefined', 'lineChart'),
|
||||
('Errors per Domain', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_domains', 'predefined', 'table'),
|
||||
('Fetch Calls with Errors', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'calls_errors', 'predefined', 'table'),
|
||||
('Errors by Type', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'errors_per_type', 'predefined', 'barChart'),
|
||||
('Errors by Origin', 'errors', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_by_party', 'predefined', 'stackedBarChart'),
|
||||
|
||||
('Speed Index by Location', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'speed_location', 'predefined', 'map'),
|
||||
('Slowest Domains', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_domains', 'predefined', 'table'),
|
||||
('Sessions per Browser', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'sessions_per_browser', 'predefined', 'table'),
|
||||
('Time To Render', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'time_to_render', 'predefined', 'areaChart'),
|
||||
('Sessions Impacted by Slow Pages', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'impacted_sessions_by_slow_pages', 'predefined', 'areaChart'),
|
||||
('Memory Consumption', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'memory_consumption', 'predefined', 'areaChart'),
|
||||
('CPU Load', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'cpu', 'predefined', 'areaChart'),
|
||||
('Frame Rate', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'fps', 'predefined', 'areaChart'),
|
||||
('Crashes', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'crashes', 'predefined', 'areaChart'),
|
||||
('Resources Loaded vs Visually Complete', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_vs_visually_complete', 'predefined', 'areaChart'),
|
||||
('DOM Build Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_dom_buildtime', 'predefined', 'areaChart'),
|
||||
('Pages Response Time', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time', 'predefined', 'areaChart'),
|
||||
('Pages Response Time Distribution', 'performance', '{"col":2,"row":2,"position":0}', true, true, true, 'pages_response_time_distribution', 'predefined', 'barChart'),
|
||||
|
||||
('Missing Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'missing_resources', 'predefined', 'table'),
|
||||
('Slowest Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'slowest_resources', 'predefined', 'table'),
|
||||
('Resources Fetch Time', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_loading_time', 'predefined', 'table'),
|
||||
('Resource Loaded vs Response End', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resource_type_vs_response_end', 'predefined', 'stackedBarLineChart'),
|
||||
('Breakdown of Loaded Resources', 'resources', '{"col":2,"row":2,"position":0}', true, true, true, 'resources_count_by_type', 'predefined', 'stackedBarChart')
|
||||
ON CONFLICT (predefined_key) DO UPDATE
|
||||
SET name=excluded.name,
|
||||
category=excluded.category,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue