Commit 7cfce4a0 by Johannes Edmeier

Fix broken cache charts after micrometer change

parent f75efd3c
......@@ -27,7 +27,7 @@
<url>https://github.com/codecentric/spring-boot-admin/</url>
<properties>
<revision>2.0.0-SNAPSHOT</revision>
<spring-boot.version>2.0.0.BUILD-SNAPSHOT</spring-boot.version>
<spring-boot.version>2.0.0.RC2</spring-boot.version>
<spring-cloud.version>Finchley.BUILD-SNAPSHOT</spring-cloud.version>
<hazelcast-tests.version>3.9.2</hazelcast-tests.version>
<java.version>1.8</java.version>
......
......@@ -35,8 +35,8 @@
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading has-bullet has-bullet-warning">Total</p>
<p v-text="current.total"/>
<p class="heading has-bullet has-bullet-warning">Misses</p>
<p v-text="current.miss"/>
</div>
</div>
<div class="level-item has-text-centered">
......@@ -45,6 +45,12 @@
<p v-text="ratio"/>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Size</p>
<p v-text="current.size"/>
</div>
</div>
</div>
<cache-chart v-if="chartData.length > 0" :data="chartData"/>
</div>
......@@ -93,14 +99,17 @@
},
methods: {
async fetchMetrics() {
const responseHit = this.instance.fetchMetric('cache.requests', {name: this.cacheName, result: 'hit'});
const responseMiss = this.instance.fetchMetric('cache.requests', {name: this.cacheName, result: 'miss'});
const responseHit = this.instance.fetchMetric('cache.gets', {name: this.cacheName, result: 'hit'});
const responseMiss = this.instance.fetchMetric('cache.gets', {name: this.cacheName, result: 'miss'});
const responsSize = this.instance.fetchMetric('cache.size', {name: this.cacheName});
const hit = (await responseHit).data.measurements[0].value;
const miss = (await responseMiss).data.measurements[0].value;
const size = (await responsSize).data.measurements[0].value;
return {
hit,
miss,
total: hit + miss
total: hit + miss,
size
};
},
createSubscription() {
......@@ -110,6 +119,7 @@
.concatMap(vm.fetchMetrics)
.subscribe({
next: data => {
vm.hasLoaded = true;
vm.current = data;
vm.chartData.push({...data, timestamp: moment.now().valueOf()});
},
......
......@@ -43,7 +43,7 @@
methods: {
async fetchcaches() {
if (this.instance) {
const response = await this.instance.fetchMetric('cache.requests');
const response = await this.instance.fetchMetric('cache.gets');
return _.uniq(response.data.availableTags.filter(tag => tag.tag === 'name')[0].values);
}
},
......
......@@ -101,7 +101,7 @@
}),
computed: {
hasCaches() {
return this.metrics.indexOf('cache.requests') >= 0;
return this.metrics.indexOf('cache.gets') >= 0;
},
hasDatasources() {
return this.metrics.indexOf('data.source.active.connections') >= 0;
......
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