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
Léo-Paul Géneau
gitlab-ce
Commits
851ada82
Commit
851ada82
authored
Sep 07, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressed code quality observations
parent
a2d10937
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
app/assets/javascripts/monitoring/utils/multiple_time_series.js
...sets/javascripts/monitoring/utils/multiple_time_series.js
+12
-25
No files found.
app/assets/javascripts/monitoring/utils/multiple_time_series.js
View file @
851ada82
...
@@ -41,12 +41,10 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
...
@@ -41,12 +41,10 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
const
maxValueFromSeries
=
_
.
max
(
maxValues
,
val
=>
val
.
maxValue
);
const
maxValueFromSeries
=
_
.
max
(
maxValues
,
val
=>
val
.
maxValue
);
let
timeSeriesNumber
=
1
;
return
queryData
.
result
.
map
((
timeSeries
,
timeSeriesNumber
)
=>
{
return
queryData
.
result
.
map
((
timeSeries
)
=>
{
let
metricTag
=
''
;
let
metricTag
=
''
;
let
lineColor
=
'
#1f78d1
'
;
let
lineColor
=
''
;
let
areaColor
=
'
#8fbce8
'
;
let
areaColor
=
''
;
const
timeSeriesScaleX
=
d3
.
time
.
scale
()
const
timeSeriesScaleX
=
d3
.
time
.
scale
()
.
range
([
0
,
graphWidth
-
70
]);
.
range
([
0
,
graphWidth
-
70
]);
...
@@ -69,27 +67,16 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
...
@@ -69,27 +67,16 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
.
y0
(
graphHeight
-
graphHeightOffset
)
.
y0
(
graphHeight
-
graphHeightOffset
)
.
y1
(
d
=>
timeSeriesScaleY
(
d
.
value
));
.
y1
(
d
=>
timeSeriesScaleY
(
d
.
value
));
if
(
queryData
.
series
!=
null
)
{
const
timeSeriesMetricLabel
=
timeSeries
.
metric
[
Object
.
keys
(
timeSeries
.
metric
)[
0
]];
const
timeSeriesMetricLabel
=
timeSeries
.
metric
[
Object
.
keys
(
timeSeries
.
metric
)[
0
]];
const
seriesCustomizationData
=
queryData
.
series
!=
null
&&
const
seriesCustomizationData
=
_
.
findWhere
(
queryData
.
series
[
0
].
series
,
_
.
findWhere
(
queryData
.
series
[
0
].
series
,
{
value
:
timeSeriesMetricLabel
});
{
value
:
timeSeriesMetricLabel
});
if
(
seriesCustomizationData
!=
null
)
{
if
(
seriesCustomizationData
!=
null
)
{
metricTag
=
seriesCustomizationData
.
value
||
timeSeriesMetricLabel
;
metricTag
=
seriesCustomizationData
.
value
||
timeSeriesMetricLabel
;
if
(
seriesCustomizationData
.
color
!=
null
)
{
[
lineColor
,
areaColor
]
=
pickColor
(
seriesCustomizationData
.
color
);
[
lineColor
,
areaColor
]
=
pickColor
(
seriesCustomizationData
.
color
);
}
else
{
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
else
{
metricTag
=
timeSeriesMetricLabel
||
`series
${
timeSeriesNumber
}
`
;
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
if
(
timeSeriesNumber
<=
5
)
{
timeSeriesNumber
=
timeSeriesNumber
+=
1
;
}
else
{
}
else
{
timeSeriesNumber
=
1
;
metricTag
=
timeSeriesMetricLabel
||
`series
${
timeSeriesNumber
+
1
}
`
;
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
return
{
return
{
...
...
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