Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
75b8f64a
Commit
75b8f64a
authored
Sep 05, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs for the additional color support
parent
45900c30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
7 deletions
+22
-7
config/prometheus/additional_metrics.yml
config/prometheus/additional_metrics.yml
+17
-0
spec/javascripts/monitoring/graph/legend_spec.js
spec/javascripts/monitoring/graph/legend_spec.js
+3
-5
spec/javascripts/monitoring/graph_path_spec.js
spec/javascripts/monitoring/graph_path_spec.js
+1
-1
spec/javascripts/monitoring/utils/multiple_time_series_spec.js
...javascripts/monitoring/utils/multiple_time_series_spec.js
+1
-1
No files found.
config/prometheus/additional_metrics.yml
View file @
75b8f64a
...
...
@@ -131,3 +131,20 @@
-
query_range
:
'
sum(rate(container_cpu_usage_seconds_total{container_name!="POD",%{environment_filter}}[2m]))
/
count(container_cpu_usage_seconds_total{container_name!="POD",%{environment_filter}})
*
100'
label
:
Average
unit
:
"
%"
-
title
:
"
CPU
usage
by
CPU"
required_metrics
:
-
container_cpu_usage_seconds_total
weight
:
1
queries
:
-
query_range
:
'
avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m]))
by
(cpu)
*
100'
unit
:
Average (%)
label
:
cpu
series
:
-
value
:
cpu00
color
:
red
-
value
:
cpu01
color
:
blue
-
value
:
cpu02
color
:
purple
-
value
:
cpu03
color
:
orange
spec/javascripts/monitoring/graph/legend_spec.js
View file @
75b8f64a
...
...
@@ -28,7 +28,7 @@ const defaultValuesComponent = {
currentDataIndex
:
0
,
};
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
]
.
result
,
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
],
defaultValuesComponent
.
graphWidth
,
defaultValuesComponent
.
graphHeight
,
defaultValuesComponent
.
graphHeightOffset
);
...
...
@@ -38,7 +38,7 @@ function getTextFromNode(component, selector) {
return
component
.
$el
.
querySelector
(
selector
).
firstChild
.
nodeValue
.
trim
();
}
describe
(
'
GraphLegend
'
,
()
=>
{
f
describe
(
'
GraphLegend
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
it
(
'
textTransform
'
,
()
=>
{
const
component
=
createComponent
(
defaultValuesComponent
);
...
...
@@ -93,9 +93,7 @@ describe('GraphLegend', () => {
const
component
=
createComponent
(
defaultValuesComponent
);
const
titles
=
component
.
$el
.
querySelectorAll
(
'
.legend-metric-title
'
);
expect
(
getTextFromNode
(
component
,
'
.legend-metric-title
'
).
indexOf
(
component
.
legendTitle
)).
not
.
toEqual
(
-
1
);
expect
(
titles
[
0
].
textContent
.
indexOf
(
'
Title
'
)).
not
.
toEqual
(
-
1
);
expect
(
titles
[
1
].
textContent
.
indexOf
(
'
Series
'
)).
not
.
toEqual
(
-
1
);
expect
(
titles
[
1
].
textContent
.
indexOf
(
'
series
'
)).
not
.
toEqual
(
-
1
);
expect
(
getTextFromNode
(
component
,
'
.y-label-text
'
)).
toEqual
(
component
.
yAxisLabel
);
});
...
...
spec/javascripts/monitoring/graph_path_spec.js
View file @
75b8f64a
...
...
@@ -13,7 +13,7 @@ const createComponent = (propsData) => {
const
convertedMetrics
=
convertDatesMultipleSeries
(
singleRowMetricsMultipleSeries
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
]
.
result
,
428
,
272
,
120
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
],
428
,
272
,
120
);
const
firstTimeSeries
=
timeSeries
[
0
];
describe
(
'
Monitoring Paths
'
,
()
=>
{
...
...
spec/javascripts/monitoring/utils/multiple_time_series_spec.js
View file @
75b8f64a
...
...
@@ -2,7 +2,7 @@ import createTimeSeries from '~/monitoring/utils/multiple_time_series';
import
{
convertDatesMultipleSeries
,
singleRowMetricsMultipleSeries
}
from
'
../mock_data
'
;
const
convertedMetrics
=
convertDatesMultipleSeries
(
singleRowMetricsMultipleSeries
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
]
.
result
,
428
,
272
,
120
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
],
428
,
272
,
120
);
const
firstTimeSeries
=
timeSeries
[
0
];
describe
(
'
Multiple time series
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment