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
d745876e
Commit
d745876e
authored
Mar 29, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code corrections with a helper and a variable
parent
b4795830
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
app/assets/javascripts/monitoring/prometheus_graph.js
app/assets/javascripts/monitoring/prometheus_graph.js
+9
-9
app/views/projects/environments/metrics.html.haml
app/views/projects/environments/metrics.html.haml
+1
-2
No files found.
app/assets/javascripts/monitoring/prometheus_graph.js
View file @
d745876e
...
@@ -50,19 +50,19 @@ class PrometheusGraph {
...
@@ -50,19 +50,19 @@ class PrometheusGraph {
}
}
plotValues
(
key
)
{
plotValues
(
key
)
{
const
graphSpecifics
=
this
.
graphSpecificProperties
[
key
];
const
x
=
d3
.
time
.
scale
()
const
x
=
d3
.
time
.
scale
()
.
range
([
0
,
this
.
width
]);
.
range
([
0
,
this
.
width
]);
const
y
=
d3
.
scale
.
linear
()
const
y
=
d3
.
scale
.
linear
()
.
range
([
this
.
height
,
0
]);
.
range
([
this
.
height
,
0
]);
this
.
graphSpecificProperties
[
key
]
.
xScale
=
x
;
graphSpecifics
.
xScale
=
x
;
this
.
graphSpecificProperties
[
key
]
.
yScale
=
y
;
graphSpecifics
.
yScale
=
y
;
const
prometheusGraphContainer
=
`
${
prometheusGraphsContainer
}
[graph-type=
${
key
}
]`
;
const
prometheusGraphContainer
=
`
${
prometheusGraphsContainer
}
[graph-type=
${
key
}
]`
;
const
graphSpecifics
=
this
.
graphSpecificProperties
[
key
];
const
chart
=
d3
.
select
(
prometheusGraphContainer
)
const
chart
=
d3
.
select
(
prometheusGraphContainer
)
.
attr
(
'
width
'
,
this
.
width
+
this
.
margin
.
left
+
this
.
margin
.
right
)
.
attr
(
'
width
'
,
this
.
width
+
this
.
margin
.
left
+
this
.
margin
.
right
)
.
attr
(
'
height
'
,
this
.
height
+
this
.
margin
.
bottom
+
this
.
margin
.
top
)
.
attr
(
'
height
'
,
this
.
height
+
this
.
margin
.
bottom
+
this
.
margin
.
top
)
...
@@ -142,9 +142,9 @@ class PrometheusGraph {
...
@@ -142,9 +142,9 @@ class PrometheusGraph {
.
attr
(
'
stroke-width
'
,
'
1
'
)
.
attr
(
'
stroke-width
'
,
'
1
'
)
.
attr
({
.
attr
({
x1
:
10
,
x1
:
10
,
y1
:
this
.
originalHeight
-
80
,
y1
:
this
.
originalHeight
-
this
.
margin
.
top
,
x2
:
(
this
.
originalWidth
-
this
.
margin
.
right
)
+
10
,
x2
:
(
this
.
originalWidth
-
this
.
margin
.
right
)
+
10
,
y2
:
this
.
originalHeight
-
80
,
y2
:
this
.
originalHeight
-
this
.
margin
.
top
,
});
});
axisLabelContainer
.
append
(
'
line
'
)
axisLabelContainer
.
append
(
'
line
'
)
...
@@ -155,7 +155,7 @@ class PrometheusGraph {
...
@@ -155,7 +155,7 @@ class PrometheusGraph {
x1
:
10
,
x1
:
10
,
y1
:
0
,
y1
:
0
,
x2
:
10
,
x2
:
10
,
y2
:
this
.
originalHeight
-
80
,
y2
:
this
.
originalHeight
-
this
.
margin
.
top
,
});
});
axisLabelContainer
.
append
(
'
rect
'
)
axisLabelContainer
.
append
(
'
rect
'
)
.
attr
(
'
class
'
,
'
rect-axis-text
'
)
.
attr
(
'
class
'
,
'
rect-axis-text
'
)
...
@@ -167,7 +167,7 @@ class PrometheusGraph {
...
@@ -167,7 +167,7 @@ class PrometheusGraph {
axisLabelContainer
.
append
(
'
text
'
)
axisLabelContainer
.
append
(
'
text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
.
attr
(
'
text-anchor
'
,
'
middle
'
)
.
attr
(
'
text-anchor
'
,
'
middle
'
)
.
attr
(
'
transform
'
,
`translate(15,
${(
this
.
originalHeight
-
80
)
/
2
}
) rotate(-90)`
)
.
attr
(
'
transform
'
,
`translate(15,
${(
this
.
originalHeight
-
this
.
margin
.
top
)
/
2
}
) rotate(-90)`
)
.
text
(
graphSpecifics
.
graph_legend_title
);
.
text
(
graphSpecifics
.
graph_legend_title
);
axisLabelContainer
.
append
(
'
rect
'
)
axisLabelContainer
.
append
(
'
rect
'
)
...
@@ -180,7 +180,7 @@ class PrometheusGraph {
...
@@ -180,7 +180,7 @@ class PrometheusGraph {
axisLabelContainer
.
append
(
'
text
'
)
axisLabelContainer
.
append
(
'
text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
.
attr
(
'
x
'
,
(
this
.
originalWidth
/
2
)
-
this
.
margin
.
right
)
.
attr
(
'
x
'
,
(
this
.
originalWidth
/
2
)
-
this
.
margin
.
right
)
.
attr
(
'
y
'
,
this
.
originalHeight
-
80
)
.
attr
(
'
y
'
,
this
.
originalHeight
-
this
.
margin
.
top
)
.
attr
(
'
dy
'
,
'
.35em
'
)
.
attr
(
'
dy
'
,
'
.35em
'
)
.
text
(
'
Time
'
);
.
text
(
'
Time
'
);
...
...
app/views/projects/environments/metrics.html.haml
View file @
d745876e
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
.col-sm-6
.col-sm-6
%h3
.page-title
%h3
.page-title
Environment:
Environment:
=
link_to
environment_path
(
@environment
)
do
=
link_to
@environment
.
name
,
environment_path
(
@environment
)
=
@environment
.
name
.col-sm-6
.col-sm-6
.nav-controls
.nav-controls
...
...
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