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
1
Merge Requests
1
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
nexedi
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
Show 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
const
maxValueFromSeries
=
_
.
max
(
maxValues
,
val
=>
val
.
maxValue
);
let
timeSeriesNumber
=
1
;
return
queryData
.
result
.
map
((
timeSeries
)
=>
{
return
queryData
.
result
.
map
((
timeSeries
,
timeSeriesNumber
)
=>
{
let
metricTag
=
''
;
let
lineColor
=
'
#1f78d1
'
;
let
areaColor
=
'
#8fbce8
'
;
let
lineColor
=
''
;
let
areaColor
=
''
;
const
timeSeriesScaleX
=
d3
.
time
.
scale
()
.
range
([
0
,
graphWidth
-
70
]);
...
...
@@ -69,28 +67,17 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
.
y0
(
graphHeight
-
graphHeightOffset
)
.
y1
(
d
=>
timeSeriesScaleY
(
d
.
value
));
if
(
queryData
.
series
!=
null
)
{
const
timeSeriesMetricLabel
=
timeSeries
.
metric
[
Object
.
keys
(
timeSeries
.
metric
)[
0
]];
const
seriesCustomizationData
=
_
.
findWhere
(
queryData
.
series
[
0
].
series
,
const
seriesCustomizationData
=
queryData
.
series
!=
null
&&
_
.
findWhere
(
queryData
.
series
[
0
].
series
,
{
value
:
timeSeriesMetricLabel
});
if
(
seriesCustomizationData
!=
null
)
{
metricTag
=
seriesCustomizationData
.
value
||
timeSeriesMetricLabel
;
if
(
seriesCustomizationData
.
color
!=
null
)
{
[
lineColor
,
areaColor
]
=
pickColor
(
seriesCustomizationData
.
color
);
}
else
{
metricTag
=
timeSeriesMetricLabel
||
`series
${
timeSeriesNumber
+
1
}
`
;
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
else
{
metricTag
=
timeSeriesMetricLabel
||
`series
${
timeSeriesNumber
}
`
;
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
if
(
timeSeriesNumber
<=
5
)
{
timeSeriesNumber
=
timeSeriesNumber
+=
1
;
}
else
{
timeSeriesNumber
=
1
;
}
return
{
linePath
:
lineFunction
(
timeSeries
.
values
),
...
...
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