BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fdd1d59f
Commit
fdd1d59f
authored
Jul 28, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added legends for each of the time series
parent
faf5363e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
18 deletions
+36
-18
flag.vue
app/assets/javascripts/monitoring/components/graph/flag.vue
+0
-13
legend.vue
...assets/javascripts/monitoring/components/graph/legend.vue
+36
-5
No files found.
app/assets/javascripts/monitoring/components/graph/flag.vue
View file @
fdd1d59f
...
...
@@ -7,10 +7,6 @@
type
:
Number
,
required
:
true
,
},
currentYCoordinate
:
{
type
:
Number
,
required
:
true
,
},
currentFlagPosition
:
{
type
:
Number
,
required
:
true
,
...
...
@@ -60,15 +56,6 @@
:y2=
"calculatedHeight"
transform=
"translate(-5, 20)"
>
</line>
<circle
class=
"circle-metric"
:fill=
"circleColorRgb"
stroke=
"#000"
:cx=
"currentXCoordinate"
:cy=
"currentYCoordinate"
r=
"5"
transform=
"translate(-5, 20)"
>
</circle>
<svg
class=
"rect-text-metric"
:x=
"currentFlagPosition"
...
...
app/assets/javascripts/monitoring/components/graph/legend.vue
View file @
fdd1d59f
<
script
>
import
{
formatRelevantDigits
}
from
'../../lib/utils/number_utils'
;
export
default
{
props
:
{
graphWidth
:
{
...
...
@@ -29,10 +31,18 @@
type
:
String
,
required
:
true
,
},
metricUsage
:
{
timeSeries
:
{
type
:
Array
,
required
:
true
,
},
unitOfDisplay
:
{
type
:
String
,
required
:
true
,
},
currentDataIndex
:
{
type
:
Number
,
required
:
true
,
},
},
data
()
{
return
{
...
...
@@ -63,6 +73,16 @@
yPosition
()
{
return
((
this
.
graphHeight
-
this
.
margin
.
top
)
+
this
.
measurements
.
axisLabelLineOffset
)
||
0
;
},
},
methods
:
{
translateLegendGroup
(
index
)
{
return
`translate(
${
120
*
index
}
, 0)`
;
},
formatMetricUsage
(
series
)
{
return
`
${
formatRelevantDigits
(
series
.
values
[
this
.
currentDataIndex
].
value
)}
${
this
.
unitOfDisplay
}
`
;
},
},
mounted
()
{
this
.
$nextTick
(()
=>
{
...
...
@@ -121,6 +141,10 @@
dy=
".35em"
>
Time
</text>
<g
class=
"legend-group"
v-for=
"(series, index) in timeSeries"
:key=
"index"
:transform=
"translateLegendGroup(index)"
>
<rect
:fill=
"areaColorRgb"
:width=
"measurements.legends.width"
...
...
@@ -130,15 +154,22 @@
</rect>
<text
class=
"text-metric-title"
x=
"50
"
:y=
"graphHeight - 25
"
>
x=
"45
"
:y=
"graphHeight - 30
"
>
{{
legendTitle
}}
</text>
<text
class=
"text-metric-title"
x=
"45"
:y=
"graphHeight - 20"
>
Series
{{
index
+
1
}}
</text>
<text
class=
"text-metric-usage"
x=
"50
"
x=
"45
"
:y=
"graphHeight - 10"
>
{{
metricUsage
}}
{{
formatMetricUsage
(
series
)
}}
</text>
</g>
</g>
</
template
>
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