Commit 00b7b57f by Johannes Edmeier

Show cache metrics from spring-boot 1.3 in details

parent 8625b20a
...@@ -54,54 +54,61 @@ module.exports = function ($scope, $interval, application, MetricsHelper) { ...@@ -54,54 +54,61 @@ module.exports = function ($scope, $interval, application, MetricsHelper) {
$scope.gcInfos = {}; $scope.gcInfos = {};
$scope.datasources = {}; $scope.datasources = {};
$scope.caches = {};
function createOrGet(map, key, factory) { function createOrGet(map, key, factory) {
return map[key] || (map[key] = factory()); return map[key] || (map[key] = factory());
} }
MetricsHelper.find(metrics, [/gc\.(.+)\.time/, /gc\.(.+)\.count/, MetricsHelper.find(metrics, [/gc\.(.+)\.time/, /gc\.(.+)\.count/,
/datasource\.(.+)\.active/, /datasource\.(.+)\.usage/ /datasource\.(.+)\.active/, /datasource\.(.+)\.usage/,
/cache\.(.+)\.size/, /cache\.(.+)\.miss\.ratio/, /cache\.(.+)\.hit\.ratio/
], [function (metric, match, value) { ], [function (metric, match, value) {
createOrGet($scope.gcInfos, match[1], function () { createOrGet($scope.gcInfos, match[1], function () {
return { return { time: 0, count: 0 };
time: 0,
count: 0
};
}) })
.time = value; .time = value;
}, },
function (metric, match, value) { function (metric, match, value) {
createOrGet($scope.gcInfos, match[1], function () { createOrGet($scope.gcInfos, match[1], function () {
return { return { time: 0, count: 0 };
time: 0,
count: 0
};
}) })
.count = value; .count = value;
}, },
function (metric, match, value) { function (metric, match, value) {
$scope.hasDatasources = true; $scope.hasDatasources = true;
createOrGet($scope.datasources, match[1], function () { createOrGet($scope.datasources, match[1], function () {
return { return { min: 0, max: 0, active: 0, usage: 0 };
min: 0,
max: 0,
active: 0,
usage: 0
};
}) })
.active = value; .active = value;
}, },
function (metric, match, value) { function (metric, match, value) {
$scope.hasDatasources = true; $scope.hasDatasources = true;
createOrGet($scope.datasources, match[1], function () { createOrGet($scope.datasources, match[1], function () {
return { return { min: 0, max: 0, active: 0, usage: 0 };
min: 0,
max: 0,
active: 0,
usage: 0
};
}) })
.usage = value; .usage = value;
},
function (metric, match, value) {
$scope.hasCaches = true;
createOrGet($scope.caches, match[1], function () {
return { size: 0, hitRatio: 0.0, missRatio: 0.0 };
})
.size = value;
},
function (metric, match, value) {
$scope.hasCaches = true;
createOrGet($scope.caches, match[1], function () {
return { size: 0, hitRatio: 0.0, missRatio: 0.0 };
})
.missRatio = value;
},
function (metric, match, value) {
$scope.hasCaches = true;
createOrGet($scope.caches, match[1], function () {
return { size: 0, hitRatio: 0.0, missRatio: 0.0 };
})
.hitRatio = value;
} }
]); ]);
}) })
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
</tr> </tr>
</table> </table>
</div> </div>
<div class="span6"> <div class="span6">
<table class="table"> <table class="table">
<thead><tr><th colspan="2">JVM <small class="pull-right"><a href="api/applications/{{ application.id }}/metrics">raw JSON</a></small></th></tr></thead> <thead><tr><th colspan="2">JVM <small class="pull-right"><a href="api/applications/{{ application.id }}/metrics">raw JSON</a></small></th></tr></thead>
...@@ -113,7 +112,6 @@ ...@@ -113,7 +112,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="span6" ng-show="metrics['httpsessions.active'] != null"> <div class="span6" ng-show="metrics['httpsessions.active'] != null">
<table class="table"> <table class="table">
<thead><tr><th colspan="2">Servlet Container</th></tr></thead> <thead><tr><th colspan="2">Servlet Container</th></tr></thead>
...@@ -125,7 +123,6 @@ ...@@ -125,7 +123,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="span6" ng-show="hasDatasources"> <div class="span6" ng-show="hasDatasources">
<table class="table"> <table class="table">
<thead><tr><th colspan="2">Datasources</th></tr></thead> <thead><tr><th colspan="2">Datasources</th></tr></thead>
...@@ -143,6 +140,26 @@ ...@@ -143,6 +140,26 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="span6" ng-show="hasCaches">
<table class="table">
<thead><tr><th colspan="2">Caches</th></tr></thead>
<tbody>
<tr ng-repeat = "(name, value) in caches track by name">
<td colspan="2">
<span>{{name | capitalize}} (size: {{ value.size }})</span>
<div class="progress" style="margin-bottom: 0px;">
<div class="bar bar-success" style="width:{{ value.hitRatio * 100 | number:2 }}%;">
{{value.hitRatio * 100 | number}}% hits
</div>
<div class="bar bar-danger" style="width:{{ value.missRatio * 100 | number:2 }}%;">
{{value.missRatio * 100 | number}}% misses
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment