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
Boxiang Sun
gitlab-ce
Commits
aa5d5162
Commit
aa5d5162
authored
Jan 23, 2019
by
Adriel Santiago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add deployment data
Adds scatter type series to metrics graph for deployments
parent
4d6f447f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
app/assets/javascripts/monitoring/components/charts/area.vue
app/assets/javascripts/monitoring/components/charts/area.vue
+42
-0
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+1
-0
No files found.
app/assets/javascripts/monitoring/components/charts/area.vue
View file @
aa5d5162
...
...
@@ -33,6 +33,11 @@ export default {
type
:
Number
,
required
:
true
,
},
deploymentData
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
alertData
:
{
type
:
Object
,
required
:
false
,
...
...
@@ -79,6 +84,43 @@ export default {
legend
:
{
formatter
:
this
.
xAxisLabel
,
},
series
:
this
.
scatterSeries
,
};
},
earliestDatapoint
()
{
return
Object
.
values
(
this
.
chartData
).
reduce
((
acc
,
data
)
=>
{
const
[[
timestamp
]]
=
data
.
sort
(([
a
],
[
b
])
=>
{
if
(
a
<
b
)
{
return
-
1
;
}
return
a
>
b
?
1
:
0
;
});
return
timestamp
<
acc
||
acc
===
null
?
timestamp
:
acc
;
},
null
);
},
recentDeployments
()
{
return
this
.
deploymentData
.
reduce
((
acc
,
deployment
)
=>
{
if
(
deployment
.
created_at
>=
this
.
earliestDatapoint
)
{
acc
.
push
({
id
:
deployment
.
id
,
createdAt
:
deployment
.
created_at
,
sha
:
deployment
.
sha
,
commitUrl
:
`
${
this
.
projectPath
}
/commit/
${
deployment
.
sha
}
`
,
tag
:
deployment
.
tag
,
tagUrl
:
deployment
.
tag
?
`
${
this
.
tagsPath
}
/
${
deployment
.
ref
.
name
}
`
:
null
,
ref
:
deployment
.
ref
.
name
,
showDeploymentFlag
:
false
,
});
}
return
acc
;
},
[]);
},
scatterSeries
()
{
return
{
type
:
'
scatter
'
,
data
:
this
.
recentDeployments
.
map
(
deployment
=>
[
deployment
.
createdAt
,
0
]),
};
},
xAxisLabel
()
{
...
...
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
aa5d5162
...
...
@@ -190,6 +190,7 @@ export default {
v-for=
"(graphData, graphIndex) in groupData.metrics"
:key=
"graphIndex"
:graph-data=
"graphData"
:deployment-data=
"store.deploymentData"
:alert-data=
"getGraphAlerts(graphData.id)"
:container-width=
"elWidth"
group-id=
"monitor-area-chart"
...
...
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