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
057e84d6
Commit
057e84d6
authored
Sep 01, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed some components
parent
0357726d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
43 deletions
+24
-43
app/assets/javascripts/monitoring/components/graph.vue
app/assets/javascripts/monitoring/components/graph.vue
+4
-4
app/assets/javascripts/monitoring/components/graph_path.vue
app/assets/javascripts/monitoring/components/graph_path.vue
+0
-0
app/assets/javascripts/monitoring/utils/multiple_time_series.js
...sets/javascripts/monitoring/utils/multiple_time_series.js
+5
-26
changelogs/unreleased/additional-time-series-charts.yml
changelogs/unreleased/additional-time-series-charts.yml
+1
-1
spec/javascripts/monitoring/graph_path_spec.js
spec/javascripts/monitoring/graph_path_spec.js
+7
-6
spec/javascripts/monitoring/utils/multiple_time_series_spec.js
...javascripts/monitoring/utils/multiple_time_series_spec.js
+7
-6
No files found.
app/assets/javascripts/monitoring/components/graph.vue
View file @
057e84d6
...
...
@@ -3,7 +3,7 @@
import
GraphLegend
from
'
./graph/legend.vue
'
;
import
GraphFlag
from
'
./graph/flag.vue
'
;
import
GraphDeployment
from
'
./graph/deployment.vue
'
;
import
monitoringPaths
from
'
./monitoring_paths
.vue
'
;
import
GraphPath
from
'
./graph_path
.vue
'
;
import
MonitoringMixin
from
'
../mixins/monitoring_mixins
'
;
import
eventHub
from
'
../event_hub
'
;
import
measurements
from
'
../utils/measurements
'
;
...
...
@@ -63,7 +63,7 @@
GraphLegend
,
GraphFlag
,
GraphDeployment
,
monitoringPaths
,
GraphPath
,
},
computed
:
{
...
...
@@ -238,7 +238,7 @@
class=
"graph-data"
:viewBox=
"innerViewBox"
ref=
"graphData"
>
<
monitoring-paths
<
graph-path
v-for=
"(path, index) in timeSeries"
:key=
"index"
:generated-line-path=
"path.linePath"
...
...
@@ -246,7 +246,7 @@
:line-color=
"path.lineColor"
:area-color=
"path.areaColor"
/>
<
monitoring
-deployment
<
graph
-deployment
:show-deploy-info=
"showDeployInfo"
:deployment-data=
"reducedDeploymentData"
:graph-height=
"graphHeight"
...
...
app/assets/javascripts/monitoring/components/
monitoring_paths
.vue
→
app/assets/javascripts/monitoring/components/
graph_path
.vue
View file @
057e84d6
File moved
app/assets/javascripts/monitoring/utils/multiple_time_series.js
View file @
057e84d6
...
...
@@ -15,6 +15,9 @@ export default function createTimeSeries(seriesData, graphWidth, graphHeight, gr
let
timeSeriesNumber
=
1
;
let
lineColor
=
'
#1f78d1
'
;
let
areaColor
=
'
#8fbce8
'
;
const
lineColors
=
[
'
#1f78d1
'
,
'
#fc9403
'
,
'
#db3b21
'
,
'
#1aaa55
'
,
'
#6666c4
'
];
const
areaColors
=
[
'
#8fbce8
'
,
'
#feca81
'
,
'
#ed9d90
'
,
'
#8dd5aa
'
,
'
#d1d1f0
'
];
return
seriesData
.
map
((
timeSeries
)
=>
{
const
timeSeriesScaleX
=
d3
.
time
.
scale
()
.
range
([
0
,
graphWidth
-
70
]);
...
...
@@ -35,32 +38,8 @@ export default function createTimeSeries(seriesData, graphWidth, graphHeight, gr
.
y1
(
d
=>
timeSeriesScaleY
(
d
.
value
))
.
interpolate
(
'
linear
'
);
switch
(
timeSeriesNumber
)
{
case
1
:
lineColor
=
'
#1f78d1
'
;
areaColor
=
'
#8fbce8
'
;
break
;
case
2
:
lineColor
=
'
#fc9403
'
;
areaColor
=
'
#feca81
'
;
break
;
case
3
:
lineColor
=
'
#db3b21
'
;
areaColor
=
'
#ed9d90
'
;
break
;
case
4
:
lineColor
=
'
#1aaa55
'
;
areaColor
=
'
#8dd5aa
'
;
break
;
case
5
:
lineColor
=
'
#6666c4
'
;
areaColor
=
'
#d1d1f0
'
;
break
;
default
:
lineColor
=
'
#1f78d1
'
;
areaColor
=
'
#8fbce8
'
;
break
;
}
lineColor
=
lineColors
[
timeSeriesNumber
-
1
];
areaColor
=
areaColors
[
timeSeriesNumber
-
1
];
if
(
timeSeriesNumber
<=
5
)
{
timeSeriesNumber
=
timeSeriesNumber
+=
1
;
...
...
changelogs/unreleased/additional-time-series-charts.yml
View file @
057e84d6
---
title
:
Added support
the multiple time series for prometheus monitoring
title
:
Added support
for multiple time series
merge_request
:
!36893
author
:
type
:
changed
spec/javascripts/monitoring/
monitoring_paths
_spec.js
→
spec/javascripts/monitoring/
graph_path
_spec.js
View file @
057e84d6
import
Vue
from
'
vue
'
;
import
MonitoringPaths
from
'
~/monitoring/components/monitoring_paths
.vue
'
;
import
GraphPath
from
'
~/monitoring/components/graph_path
.vue
'
;
import
createTimeSeries
from
'
~/monitoring/utils/multiple_time_series
'
;
import
{
singleRowMetricsMultipleSeries
,
convertDatesMultipleSeries
}
from
'
./mock_data
'
;
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
MonitoringPaths
);
const
Component
=
Vue
.
extend
(
GraphPath
);
return
new
Component
({
propsData
,
...
...
@@ -14,12 +14,13 @@ const createComponent = (propsData) => {
const
convertedMetrics
=
convertDatesMultipleSeries
(
singleRowMetricsMultipleSeries
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
].
result
,
428
,
272
,
120
);
const
firstTimeSeries
=
timeSeries
[
0
];
describe
(
'
Monitoring Paths
'
,
()
=>
{
it
(
'
renders two paths to represent a line and the area underneath it
'
,
()
=>
{
const
component
=
createComponent
({
generatedLinePath
:
timeSeries
[
0
]
.
linePath
,
generatedAreaPath
:
timeSeries
[
0
]
.
areaPath
,
generatedLinePath
:
firstTimeSeries
.
linePath
,
generatedAreaPath
:
firstTimeSeries
.
areaPath
,
lineColor
:
'
#ccc
'
,
areaColor
:
'
#fff
'
,
});
...
...
@@ -27,8 +28,8 @@ describe('Monitoring Paths', () => {
const
metricLine
=
component
.
$el
.
querySelector
(
'
.metric-line
'
);
expect
(
metricArea
.
getAttribute
(
'
fill
'
)).
toBe
(
'
#fff
'
);
expect
(
metricArea
.
getAttribute
(
'
d
'
)).
toBe
(
timeSeries
[
0
]
.
areaPath
);
expect
(
metricArea
.
getAttribute
(
'
d
'
)).
toBe
(
firstTimeSeries
.
areaPath
);
expect
(
metricLine
.
getAttribute
(
'
stroke
'
)).
toBe
(
'
#ccc
'
);
expect
(
metricLine
.
getAttribute
(
'
d
'
)).
toBe
(
timeSeries
[
0
]
.
linePath
);
expect
(
metricLine
.
getAttribute
(
'
d
'
)).
toBe
(
firstTimeSeries
.
linePath
);
});
});
spec/javascripts/monitoring/utils/multiple_time_series_spec.js
View file @
057e84d6
...
...
@@ -3,15 +3,16 @@ import { convertDatesMultipleSeries, singleRowMetricsMultipleSeries } from '../m
const
convertedMetrics
=
convertDatesMultipleSeries
(
singleRowMetricsMultipleSeries
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
[
0
].
result
,
428
,
272
,
120
);
const
firstTimeSeries
=
timeSeries
[
0
];
describe
(
'
Multiple time series
'
,
()
=>
{
it
(
'
createTimeSeries returned array contains an object for each element
'
,
()
=>
{
expect
(
typeof
timeSeries
[
0
]
.
linePath
).
toEqual
(
'
string
'
);
expect
(
typeof
timeSeries
[
0
]
.
areaPath
).
toEqual
(
'
string
'
);
expect
(
typeof
timeSeries
[
0
]
.
timeSeriesScaleX
).
toEqual
(
'
function
'
);
expect
(
typeof
timeSeries
[
0
]
.
areaColor
).
toEqual
(
'
string
'
);
expect
(
typeof
timeSeries
[
0
]
.
lineColor
).
toEqual
(
'
string
'
);
expect
(
timeSeries
[
0
]
.
values
instanceof
Array
).
toEqual
(
true
);
expect
(
typeof
firstTimeSeries
.
linePath
).
toEqual
(
'
string
'
);
expect
(
typeof
firstTimeSeries
.
areaPath
).
toEqual
(
'
string
'
);
expect
(
typeof
firstTimeSeries
.
timeSeriesScaleX
).
toEqual
(
'
function
'
);
expect
(
typeof
firstTimeSeries
.
areaColor
).
toEqual
(
'
string
'
);
expect
(
typeof
firstTimeSeries
.
lineColor
).
toEqual
(
'
string
'
);
expect
(
firstTimeSeries
.
values
instanceof
Array
).
toEqual
(
true
);
});
it
(
'
createTimeSeries returns an array
'
,
()
=>
{
...
...
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