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
cd458950
Commit
cd458950
authored
Nov 06, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly set the domain of a result set when it is different on other tracks
parent
0816b280
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
app/assets/javascripts/monitoring/components/graph/legend.vue
...assets/javascripts/monitoring/components/graph/legend.vue
+1
-1
app/assets/javascripts/monitoring/utils/multiple_time_series.js
...sets/javascripts/monitoring/utils/multiple_time_series.js
+10
-10
No files found.
app/assets/javascripts/monitoring/components/graph/legend.vue
View file @
cd458950
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
},
},
formatMetricUsage
(
series
)
{
formatMetricUsage
(
series
)
{
const
value
=
series
.
values
[
this
.
currentDataIndex
].
value
;
const
value
=
series
.
values
[
this
.
currentDataIndex
]
&&
series
.
values
[
this
.
currentDataIndex
]
.
value
;
if
(
isNaN
(
value
))
{
if
(
isNaN
(
value
))
{
return
'
-
'
;
return
'
-
'
;
}
}
...
...
app/assets/javascripts/monitoring/utils/multiple_time_series.js
View file @
cd458950
...
@@ -13,7 +13,7 @@ const defaultColorOrder = ['blue', 'orange', 'red', 'green', 'purple'];
...
@@ -13,7 +13,7 @@ const defaultColorOrder = ['blue', 'orange', 'red', 'green', 'purple'];
const
defaultStyleOrder
=
[
'
solid
'
,
'
dashed
'
,
'
dotted
'
];
const
defaultStyleOrder
=
[
'
solid
'
,
'
dashed
'
,
'
dotted
'
];
function
queryTimeSeries
(
query
,
graphWidth
,
graphHeight
,
graphHeightOffset
,
maxValue
,
lineStyle
)
{
function
queryTimeSeries
(
query
,
graphWidth
,
graphHeight
,
graphHeightOffset
,
xDom
,
yDom
,
lineStyle
)
{
let
usedColors
=
[];
let
usedColors
=
[];
function
pickColor
(
name
)
{
function
pickColor
(
name
)
{
...
@@ -44,9 +44,9 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
...
@@ -44,9 +44,9 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
const
timeSeriesScaleY
=
d3
.
scale
.
linear
()
const
timeSeriesScaleY
=
d3
.
scale
.
linear
()
.
range
([
graphHeight
-
graphHeightOffset
,
0
]);
.
range
([
graphHeight
-
graphHeightOffset
,
0
]);
timeSeriesScaleX
.
domain
(
d3
.
extent
(
timeSeries
.
values
,
d
=>
d
.
time
)
);
timeSeriesScaleX
.
domain
(
xDom
);
timeSeriesScaleX
.
ticks
(
d3
.
time
.
minute
,
60
);
timeSeriesScaleX
.
ticks
(
d3
.
time
.
minute
,
60
);
timeSeriesScaleY
.
domain
(
[
0
,
maxValue
]
);
timeSeriesScaleY
.
domain
(
yDom
);
const
defined
=
d
=>
!
isNaN
(
d
.
value
)
&&
d
.
value
!=
null
;
const
defined
=
d
=>
!
isNaN
(
d
.
value
)
&&
d
.
value
!=
null
;
...
@@ -93,17 +93,17 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
...
@@ -93,17 +93,17 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
}
}
export
default
function
createTimeSeries
(
queries
,
graphWidth
,
graphHeight
,
graphHeightOffset
)
{
export
default
function
createTimeSeries
(
queries
,
graphWidth
,
graphHeight
,
graphHeightOffset
)
{
const
maxValue
=
const
allValues
=
queries
.
reduce
((
allQueryResults
,
query
)
=>
allQueryResults
.
concat
(
d3
.
max
(
queries
.
map
(
query
=>
(
query
.
result
.
reduce
((
allResults
,
result
)
=>
allResults
.
concat
(
result
.
values
),
[]),
d3
.
max
(
query
.
result
.
map
(
resultSet
=>
(
),
[]);
d3
.
max
(
resultSet
.
values
.
map
(
d
=>
d
.
value
))
)))
const
xDom
=
d3
.
extent
(
allValues
,
d
=>
d
.
time
);
)))
;
const
yDom
=
[
0
,
d3
.
max
(
allValues
.
map
(
d
=>
d
.
value
))]
;
return
queries
.
reduce
((
series
,
query
,
index
)
=>
{
return
queries
.
reduce
((
series
,
query
,
index
)
=>
{
const
lineStyle
=
defaultStyleOrder
[
index
%
defaultStyleOrder
.
length
];
const
lineStyle
=
defaultStyleOrder
[
index
%
defaultStyleOrder
.
length
];
return
series
.
concat
(
return
series
.
concat
(
queryTimeSeries
(
query
,
graphWidth
,
graphHeight
,
graphHeightOffset
,
maxValue
,
lineStyle
),
queryTimeSeries
(
query
,
graphWidth
,
graphHeight
,
graphHeightOffset
,
xDom
,
yDom
,
lineStyle
),
);
);
},
[]);
},
[]);
}
}
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