Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
7808d798
Commit
7808d798
authored
Oct 03, 2014
by
joshiste
Committed by
Johannes Stelzer
Nov 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support für RichGagues in metrics-view
parent
78243e15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
10 deletions
+59
-10
controllers.js
...src/main/webapp/public/scripts/controllers/controllers.js
+55
-6
metrics.html
...er/src/main/webapp/public/views/apps/details/metrics.html
+4
-4
No files found.
spring-boot-admin-server/src/main/webapp/public/scripts/controllers/controllers.js
View file @
7808d798
...
@@ -82,23 +82,72 @@ angular.module('springBootAdmin')
...
@@ -82,23 +82,72 @@ angular.module('springBootAdmin')
//*** Extract data for Counter-Chart and Gauge-Chart
//*** Extract data for Counter-Chart and Gauge-Chart
$scope
.
counterData
=
[
{
key
:
"value"
,
values
:
[]
}
];
$scope
.
counterData
=
[
{
key
:
"value"
,
values
:
[]
}
];
$scope
.
gaugeData
=
[
{
key
:
"value"
,
values
:
[]
}
];
$scope
.
gaugeData
=
[
{
key
:
"value"
,
values
:
[]
},
{
key
:
"average"
,
values
:
[]
},
{
key
:
"min"
,
values
:
[]
},
{
key
:
"max"
,
values
:
[]
},
{
key
:
"count"
,
values
:
[]
}
];
for
(
var
metric
in
application
.
metrics
)
{
for
(
var
metric
in
application
.
metrics
)
{
var
matchCounter
=
/counter
\.(
.+
)
/
.
exec
(
metric
);
var
matchCounter
=
/counter
\.(
.+
)
/
.
exec
(
metric
);
if
(
matchCounter
!==
null
)
{
if
(
matchCounter
!==
null
)
{
$scope
.
counterData
[
0
].
values
.
push
([
matchCounter
[
1
],
application
.
metrics
[
metric
]
]);
$scope
.
counterData
[
0
].
values
.
push
([
matchCounter
[
1
],
application
.
metrics
[
metric
]
]);
continue
;
}
}
var
matchGauge
=
/gauge
\.(
.+
)
/
.
exec
(
metric
);
var
matchGaugeValue
=
/gauge
\.(
.+
)\.
val/
.
exec
(
metric
);
if
(
matchGauge
!==
null
)
{
if
(
matchGaugeValue
!==
null
)
{
$scope
.
gaugeData
[
0
].
values
.
push
([
matchGauge
[
1
],
application
.
metrics
[
metric
]
]);
$scope
.
gaugeData
[
0
].
values
.
push
([
matchGaugeValue
[
1
],
application
.
metrics
[
metric
]
]);
continue
;
}
var
matchGaugeAvg
=
/gauge
\.(
.+
)\.
avg/
.
exec
(
metric
);
if
(
matchGaugeAvg
!==
null
)
{
$scope
.
gaugeData
[
1
].
values
.
push
([
matchGaugeAvg
[
1
],
application
.
metrics
[
metric
]
]);
continue
;
}
var
matchGaugeMin
=
/gauge
\.(
.+
)\.
min/
.
exec
(
metric
);
if
(
matchGaugeMin
!==
null
)
{
$scope
.
gaugeData
[
2
].
values
.
push
([
matchGaugeMin
[
1
],
application
.
metrics
[
metric
]
]);
continue
;
}
var
matchGaugeMax
=
/gauge
\.(
.+
)\.
max/
.
exec
(
metric
);
if
(
matchGaugeMax
!==
null
)
{
$scope
.
gaugeData
[
3
].
values
.
push
([
matchGaugeMax
[
1
],
application
.
metrics
[
metric
]
]);
continue
;
}
var
matchGaugeCount
=
/gauge
\.(
.+
)\.
count/
.
exec
(
metric
);
if
(
matchGaugeCount
!==
null
)
{
$scope
.
gaugeData
[
4
].
values
.
push
([
matchGaugeCount
[
1
],
application
.
metrics
[
metric
]
]);
continue
;
}
var
matchGaugeAlpha
=
/gauge
\.(
.+
)\.
alpha/
.
exec
(
metric
);
if
(
matchGaugeAlpha
!==
null
)
{
continue
;
}
var
matchGaugeValue
=
/gauge
\.(
.+
)
/
.
exec
(
metric
);
if
(
matchGaugeValue
!==
null
)
{
$scope
.
gaugeData
[
0
].
values
.
push
([
matchGaugeValue
[
1
],
application
.
metrics
[
metric
]
]);
}
}
//in case no richGauges are present remove empty groups
var
i
=
$scope
.
gaugeData
.
length
;
while
(
--
i
)
{
if
(
$scope
.
gaugeData
[
i
].
values
.
length
===
0
)
{
$scope
.
gaugeData
.
splice
(
i
,
1
);
}
}
}
}
});
});
});
});
var
colorArray
=
[
'#6db33f'
,
'#a5b2b9'
,
'#34302d
'
];
var
colorArray
=
[
'#6db33f'
,
'#a5b2b9'
,
'#34302d'
,
'#fec600'
,
'#4e681e
'
];
$scope
.
colorFunction
=
function
()
{
$scope
.
colorFunction
=
function
()
{
return
function
(
d
,
i
)
{
return
function
(
d
,
i
)
{
return
colorArray
[
i
%
colorArray
.
length
];
return
colorArray
[
i
%
colorArray
.
length
];
...
@@ -119,7 +168,7 @@ angular.module('springBootAdmin')
...
@@ -119,7 +168,7 @@ angular.module('springBootAdmin')
$scope
.
toolTipContentFunction
=
function
(){
$scope
.
toolTipContentFunction
=
function
(){
return
function
(
key
,
x
,
y
,
e
,
graph
)
{
return
function
(
key
,
x
,
y
,
e
,
graph
)
{
return
e
.
point
[
0
]
+
': '
+
e
.
point
[
1
]
;
return
'<b>'
+
key
+
'</b> '
+
e
.
point
[
0
]
+
': '
+
e
.
point
[
1
]
;
}
}
}
}
...
...
spring-boot-admin-server/src/main/webapp/public/views/apps/details/metrics.html
View file @
7808d798
...
@@ -68,13 +68,14 @@
...
@@ -68,13 +68,14 @@
<tr>
<tr>
<td>
<td>
<h1
style=
"text-align: center;"
>
Gauge
</h1>
<h1
style=
"text-align: center;"
>
Gauge
</h1>
<div
class=
"center-block"
style=
"width: 800px; height: {{ 75 + gaugeData[0].values.length *
15
}}px; position:relative;"
>
<div
class=
"center-block"
style=
"width: 800px; height: {{ 75 + gaugeData[0].values.length *
(10 + gaugeData.length *5)
}}px; position:relative;"
>
<nvd3-multi-bar-horizontal-chart
id=
"gaugesChart"
nodata=
"not available"
<nvd3-multi-bar-horizontal-chart
id=
"gaugesChart"
nodata=
"not available"
data=
"gaugeData"
data=
"gaugeData"
color=
"colorFunction()"
color=
"colorFunction()"
tooltips=
"true"
tooltipContent=
"toolTipContentFunction()"
tooltips=
"true"
tooltipContent=
"toolTipContentFunction()"
showYAxis=
"true"
yAxisTickFormat=
"intFormatFunction()"
showYAxis=
"true"
yAxisTickFormat=
"intFormatFunction()"
showXAxis=
"true"
xAxisTickFormat=
"abbreviateFunction(30, 1, 3)"
showXAxis=
"true"
xAxisTickFormat=
"abbreviateFunction(30, 1, 3)"
showLegend=
"{{ gaugeData.length > 1 ? 'true' : 'false' }} "
legendColor=
"colorFunction()"
margin=
"{ top: 25, left: 250, right: 25, bottom: 50}"
>
margin=
"{ top: 25, left: 250, right: 25, bottom: 50}"
>
</nvd3-multi-bar-horizontal-chart>
</nvd3-multi-bar-horizontal-chart>
</div>
</div>
...
@@ -113,4 +114,4 @@
...
@@ -113,4 +114,4 @@
<td>
{{ application.metrics['classes.unloaded']}}
</td>
<td>
{{ application.metrics['classes.unloaded']}}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
\ No newline at end of file
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