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
69c450c0
Commit
69c450c0
authored
Apr 14, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eslint fixes
parent
59616dc7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
22 deletions
+44
-22
app/assets/javascripts/monitoring/deployments.js
app/assets/javascripts/monitoring/deployments.js
+41
-21
app/assets/javascripts/monitoring/prometheus_graph.js
app/assets/javascripts/monitoring/prometheus_graph.js
+3
-1
No files found.
app/assets/javascripts/monitoring/deployments.js
View file @
69c450c0
...
...
@@ -57,16 +57,20 @@ export default class Deployments {
createLine
(
chart
)
{
chart
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
'
deploy-info
'
)
.
attr
({
class
:
'
deploy-info
'
,
})
.
selectAll
(
'
.deploy-info
'
)
.
data
(
this
.
data
)
.
enter
()
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
d
=>
`deploy-info-
${
d
.
id
}
`
)
.
attr
(
'
transform
'
,
d
=>
`translate(
${
Math
.
floor
(
this
.
x
(
d
.
time
))
+
1
}
, 0)`
)
.
attr
({
class
:
d
=>
`deploy-info-
${
d
.
id
}
`
,
transform
:
d
=>
`translate(
${
Math
.
floor
(
this
.
x
(
d
.
time
))
+
1
}
, 0)`
,
})
.
append
(
'
line
'
)
.
attr
(
'
class
'
,
'
deployment-line
'
)
.
attr
({
class
:
'
deployment-line
'
,
x1
:
0
,
x2
:
0
,
y1
:
0
,
...
...
@@ -78,31 +82,47 @@ export default class Deployments {
this
.
data
.
forEach
((
d
)
=>
{
const
group
=
chart
.
select
(
`.deploy-info-
${
d
.
id
}
`
)
.
append
(
'
svg
'
)
.
attr
(
'
x
'
,
3
)
.
attr
(
'
y
'
,
0
)
.
attr
(
'
height
'
,
38
);
.
attr
({
x
:
3
,
y
:
0
,
height
:
41
,
});
const
rect
=
group
.
append
(
'
rect
'
)
.
attr
(
'
class
'
,
'
rect-text-metric deploy-info-rect rect-metric
'
)
.
attr
(
'
x
'
,
1
)
.
attr
(
'
y
'
,
1
)
.
attr
(
'
rx
'
,
2
)
.
attr
(
'
height
'
,
35
);
const
text
=
group
.
append
(
'
text
'
)
.
attr
(
'
x
'
,
5
)
.
attr
(
'
y
'
,
'
50%
'
)
.
attr
(
'
style
'
,
'
dominant-baseline: middle;
'
)
.
text
((
d
)
=>
{
.
attr
({
class
:
'
rect-text-metric deploy-info-rect rect-metric
'
,
x
:
1
,
y
:
1
,
rx
:
2
,
height
:
group
.
attr
(
'
height
'
)
-
2
,
});
const
textGroup
=
group
.
append
(
'
g
'
)
.
attr
({
transform
:
'
translate(5, 2)
'
,
});
textGroup
.
append
(
'
text
'
)
.
attr
({
style
:
'
dominant-baseline: text-before-edge;
'
,
})
.
text
(()
=>
{
const
isTag
=
d
.
tag
;
const
refText
=
isTag
?
d
.
ref
:
d
.
sha
.
slice
(
0
,
6
);
return
`
${
refText
}
-
${
this
.
timeFormat
(
d
.
time
)}
`
;
return
refText
;
});
group
.
attr
(
'
width
'
,
Math
.
floor
(
text
.
node
().
getBoundingClientRect
().
width
)
+
14
);
textGroup
.
append
(
'
text
'
)
.
attr
({
style
:
'
dominant-baseline: text-before-edge; font-weight: 600;
'
,
y
:
18
,
})
.
text
(()
=>
this
.
timeFormat
(
d
.
time
));
group
.
attr
(
'
width
'
,
Math
.
floor
(
textGroup
.
node
().
getBoundingClientRect
().
width
)
+
14
);
rect
.
attr
(
'
width
'
,
Math
.
floor
(
text
.
node
().
getBoundingClientRect
().
width
)
+
10
);
rect
.
attr
(
'
width
'
,
Math
.
floor
(
text
Group
.
node
().
getBoundingClientRect
().
width
)
+
10
);
});
}
}
app/assets/javascripts/monitoring/prometheus_graph.js
View file @
69c450c0
...
...
@@ -210,7 +210,9 @@ class PrometheusGraph {
const
d0
=
valuesToPlot
[
timeValueIndex
-
1
];
const
d1
=
valuesToPlot
[
timeValueIndex
];
const
currentData
=
timeValueFromOverlay
-
d0
.
time
>
d1
.
time
-
timeValueFromOverlay
?
d1
:
d0
;
const
maxValueMetric
=
Math
.
floor
(
y
(
d3
.
max
(
valuesToPlot
.
map
(
metricValue
=>
metricValue
.
value
))));
const
maxValueMetric
=
Math
.
floor
(
y
(
d3
.
max
(
valuesToPlot
.
map
(
metricValue
=>
metricValue
.
value
))),
);
const
currentTimeCoordinate
=
Math
.
floor
(
x
(
currentData
.
time
));
const
graphSpecifics
=
this
.
graphSpecificProperties
[
key
];
// Remove the current selectors
...
...
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