Commit a1c1ca12 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '65412-add-support-for-line-charts' into 'master'

Create component to display area and line charts in monitor dashboards

Closes #65412

See merge request gitlab-org/gitlab-ce!31639
parents 0a4d4c0a f2619e21
...@@ -12,6 +12,9 @@ import { graphDataValidatorForValues } from '../../utils'; ...@@ -12,6 +12,9 @@ import { graphDataValidatorForValues } from '../../utils';
let debouncedResize; let debouncedResize;
// TODO: Remove this component in favor of the more general time_series.vue
// Please port all changes here to time_series.vue as well.
export default { export default {
components: { components: {
GlAreaChart, GlAreaChart,
......
...@@ -15,7 +15,7 @@ import Icon from '~/vue_shared/components/icon.vue'; ...@@ -15,7 +15,7 @@ import Icon from '~/vue_shared/components/icon.vue';
import { getParameterValues, mergeUrlParams } from '~/lib/utils/url_utility'; import { getParameterValues, mergeUrlParams } from '~/lib/utils/url_utility';
import invalidUrl from '~/lib/utils/invalid_url'; import invalidUrl from '~/lib/utils/invalid_url';
import PanelType from 'ee_else_ce/monitoring/components/panel_type.vue'; import PanelType from 'ee_else_ce/monitoring/components/panel_type.vue';
import MonitorAreaChart from './charts/area.vue'; import MonitorTimeSeriesChart from './charts/time_series.vue';
import MonitorSingleStatChart from './charts/single_stat.vue'; import MonitorSingleStatChart from './charts/single_stat.vue';
import GraphGroup from './graph_group.vue'; import GraphGroup from './graph_group.vue';
import EmptyState from './empty_state.vue'; import EmptyState from './empty_state.vue';
...@@ -26,7 +26,7 @@ let sidebarMutationObserver; ...@@ -26,7 +26,7 @@ let sidebarMutationObserver;
export default { export default {
components: { components: {
MonitorAreaChart, MonitorTimeSeriesChart,
MonitorSingleStatChart, MonitorSingleStatChart,
PanelType, PanelType,
GraphGroup, GraphGroup,
...@@ -465,7 +465,7 @@ export default { ...@@ -465,7 +465,7 @@ export default {
/> />
</template> </template>
<template v-else> <template v-else>
<monitor-area-chart <monitor-time-series-chart
v-for="(graphData, graphIndex) in chartsWithData(groupData.metrics)" v-for="(graphData, graphIndex) in chartsWithData(groupData.metrics)"
:key="graphIndex" :key="graphIndex"
:graph-data="graphData" :graph-data="graphData"
...@@ -473,7 +473,7 @@ export default { ...@@ -473,7 +473,7 @@ export default {
:thresholds="getGraphAlertValues(graphData.queries)" :thresholds="getGraphAlertValues(graphData.queries)"
:container-width="elWidth" :container-width="elWidth"
:project-path="projectPath" :project-path="projectPath"
group-id="monitor-area-chart" group-id="monitor-time-series-chart"
> >
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<alert-widget <alert-widget
...@@ -515,7 +515,7 @@ export default { ...@@ -515,7 +515,7 @@ export default {
</gl-dropdown-item> </gl-dropdown-item>
</gl-dropdown> </gl-dropdown>
</div> </div>
</monitor-area-chart> </monitor-time-series-chart>
</template> </template>
</graph-group> </graph-group>
</div> </div>
......
...@@ -8,6 +8,10 @@ export const graphTypes = { ...@@ -8,6 +8,10 @@ export const graphTypes = {
deploymentData: 'scatter', deploymentData: 'scatter',
}; };
export const symbolSizes = {
default: 14,
};
export const lineTypes = { export const lineTypes = {
default: 'solid', default: 'solid',
}; };
...@@ -21,6 +25,11 @@ export const timeWindows = { ...@@ -21,6 +25,11 @@ export const timeWindows = {
oneWeek: __('1 week'), oneWeek: __('1 week'),
}; };
export const dateFormats = {
timeOfDay: 'h:MM TT',
default: 'dd mmm yyyy, h:MMTT',
};
export const secondsIn = { export const secondsIn = {
thirtyMinutes: 60 * 30, thirtyMinutes: 60 * 30,
threeHours: 60 * 60 * 3, threeHours: 60 * 60 * 3,
......
---
title: Create component to display area and line charts in monitor dashboards
merge_request: 31639
author:
type: added
...@@ -166,7 +166,7 @@ panel_groups: ...@@ -166,7 +166,7 @@ panel_groups:
label: Total (cores) label: Total (cores)
unit: "cores" unit: "cores"
- title: "Memory Usage (Pod average)" - title: "Memory Usage (Pod average)"
type: "area-chart" type: "line-chart"
y_label: "Memory Used per Pod (MB)" y_label: "Memory Used per Pod (MB)"
weight: 2 weight: 2
metrics: metrics:
...@@ -175,7 +175,7 @@ panel_groups: ...@@ -175,7 +175,7 @@ panel_groups:
label: Pod average (MB) label: Pod average (MB)
unit: MB unit: MB
- title: "Canary: Memory Usage (Pod Average)" - title: "Canary: Memory Usage (Pod Average)"
type: "area-chart" type: "line-chart"
y_label: "Memory Used per Pod (MB)" y_label: "Memory Used per Pod (MB)"
weight: 2 weight: 2
metrics: metrics:
...@@ -185,7 +185,7 @@ panel_groups: ...@@ -185,7 +185,7 @@ panel_groups:
unit: MB unit: MB
track: canary track: canary
- title: "Core Usage (Pod Average)" - title: "Core Usage (Pod Average)"
type: "area-chart" type: "line-chart"
y_label: "Cores per Pod" y_label: "Cores per Pod"
weight: 1 weight: 1
metrics: metrics:
...@@ -194,7 +194,7 @@ panel_groups: ...@@ -194,7 +194,7 @@ panel_groups:
label: Pod average (cores) label: Pod average (cores)
unit: "cores" unit: "cores"
- title: "Canary: Core Usage (Pod Average)" - title: "Canary: Core Usage (Pod Average)"
type: "area-chart" type: "line-chart"
y_label: "Cores per Pod" y_label: "Cores per Pod"
weight: 1 weight: 1
metrics: metrics:
......
# frozen_string_literal: true
class ImportCommonMetricsLineCharts < ActiveRecord::Migration[5.2]
DOWNTIME = false
def up
::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end
def down
# no-op
end
end
This diff is collapsed.
export const mockApiEndpoint = `${gl.TEST_HOST}/monitoring/mock`; export const mockApiEndpoint = `${gl.TEST_HOST}/monitoring/mock`;
export const mockProjectPath = '/frontend-fixtures/environments-project';
export const metricsGroupsAPIResponse = { export const metricsGroupsAPIResponse = {
success: true, success: true,
data: [ data: [
...@@ -902,7 +904,7 @@ export const metricsDashboardResponse = { ...@@ -902,7 +904,7 @@ export const metricsDashboardResponse = {
}, },
{ {
title: 'Memory Usage (Pod average)', title: 'Memory Usage (Pod average)',
type: 'area-chart', type: 'line-chart',
y_label: 'Memory Used per Pod', y_label: 'Memory Used per Pod',
weight: 2, weight: 2,
metrics: [ metrics: [
......
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