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
Hide 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 {
...
@@ -57,16 +57,20 @@ export default class Deployments {
createLine
(
chart
)
{
createLine
(
chart
)
{
chart
.
append
(
'
g
'
)
chart
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
'
deploy-info
'
)
.
attr
({
class
:
'
deploy-info
'
,
})
.
selectAll
(
'
.deploy-info
'
)
.
selectAll
(
'
.deploy-info
'
)
.
data
(
this
.
data
)
.
data
(
this
.
data
)
.
enter
()
.
enter
()
.
append
(
'
g
'
)
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
d
=>
`deploy-info-
${
d
.
id
}
`
)
.
attr
({
.
attr
(
'
transform
'
,
d
=>
`translate(
${
Math
.
floor
(
this
.
x
(
d
.
time
))
+
1
}
, 0)`
)
class
:
d
=>
`deploy-info-
${
d
.
id
}
`
,
transform
:
d
=>
`translate(
${
Math
.
floor
(
this
.
x
(
d
.
time
))
+
1
}
, 0)`
,
})
.
append
(
'
line
'
)
.
append
(
'
line
'
)
.
attr
(
'
class
'
,
'
deployment-line
'
)
.
attr
({
.
attr
({
class
:
'
deployment-line
'
,
x1
:
0
,
x1
:
0
,
x2
:
0
,
x2
:
0
,
y1
:
0
,
y1
:
0
,
...
@@ -78,31 +82,47 @@ export default class Deployments {
...
@@ -78,31 +82,47 @@ export default class Deployments {
this
.
data
.
forEach
((
d
)
=>
{
this
.
data
.
forEach
((
d
)
=>
{
const
group
=
chart
.
select
(
`.deploy-info-
${
d
.
id
}
`
)
const
group
=
chart
.
select
(
`.deploy-info-
${
d
.
id
}
`
)
.
append
(
'
svg
'
)
.
append
(
'
svg
'
)
.
attr
(
'
x
'
,
3
)
.
attr
({
.
attr
(
'
y
'
,
0
)
x
:
3
,
.
attr
(
'
height
'
,
38
);
y
:
0
,
height
:
41
,
});
const
rect
=
group
.
append
(
'
rect
'
)
const
rect
=
group
.
append
(
'
rect
'
)
.
attr
(
'
class
'
,
'
rect-text-metric deploy-info-rect rect-metric
'
)
.
attr
({
.
attr
(
'
x
'
,
1
)
class
:
'
rect-text-metric deploy-info-rect rect-metric
'
,
.
attr
(
'
y
'
,
1
)
x
:
1
,
.
attr
(
'
rx
'
,
2
)
y
:
1
,
.
attr
(
'
height
'
,
35
);
rx
:
2
,
height
:
group
.
attr
(
'
height
'
)
-
2
,
const
text
=
group
.
append
(
'
text
'
)
});
.
attr
(
'
x
'
,
5
)
.
attr
(
'
y
'
,
'
50%
'
)
const
textGroup
=
group
.
append
(
'
g
'
)
.
attr
(
'
style
'
,
'
dominant-baseline: middle;
'
)
.
attr
({
.
text
((
d
)
=>
{
transform
:
'
translate(5, 2)
'
,
});
textGroup
.
append
(
'
text
'
)
.
attr
({
style
:
'
dominant-baseline: text-before-edge;
'
,
})
.
text
(()
=>
{
const
isTag
=
d
.
tag
;
const
isTag
=
d
.
tag
;
const
refText
=
isTag
?
d
.
ref
:
d
.
sha
.
slice
(
0
,
6
);
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 {
...
@@ -210,7 +210,9 @@ class PrometheusGraph {
const
d0
=
valuesToPlot
[
timeValueIndex
-
1
];
const
d0
=
valuesToPlot
[
timeValueIndex
-
1
];
const
d1
=
valuesToPlot
[
timeValueIndex
];
const
d1
=
valuesToPlot
[
timeValueIndex
];
const
currentData
=
timeValueFromOverlay
-
d0
.
time
>
d1
.
time
-
timeValueFromOverlay
?
d1
:
d0
;
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
currentTimeCoordinate
=
Math
.
floor
(
x
(
currentData
.
time
));
const
graphSpecifics
=
this
.
graphSpecificProperties
[
key
];
const
graphSpecifics
=
this
.
graphSpecificProperties
[
key
];
// Remove the current selectors
// 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