Skip to content

Commit acfa5b7

Browse files
Tobias Soloschenkojoshiste
authored andcommitted
Limit http traces kept in memory
In order to prevent an out-of-memory the http traces kept in memory will be limited. fixex #1040
1 parent c404069 commit acfa5b7

File tree

1 file changed

+9
-1
lines changed
  • spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace

1 file changed

+9
-1
lines changed

spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/index.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
</div>
2828
</div>
2929
<template v-if="traces">
30+
<div class="field-body">
31+
<div class="field">
32+
<p class="control is-expanded">
33+
<input class="input" type="number" placeholder="trace limit" v-model="limit">
34+
</p>
35+
</div>
36+
</div>
3037
<div class="field-body">
3138
<div class="field has-addons">
3239
<p class="control is-expanded">
@@ -155,6 +162,7 @@
155162
error: null,
156163
traces: null,
157164
filter: null,
165+
limit: 1000,
158166
excludeActuator: true,
159167
showSuccess: true,
160168
showClientErrors: true,
@@ -186,7 +194,7 @@
186194
methods: {
187195
async fetchHttptrace() {
188196
const response = await this.instance.fetchHttptrace();
189-
const traces = response.data.traces.map(trace => new Trace(trace)).filter(
197+
const traces = response.data.traces.slice(0, this.limit).map(trace => new Trace(trace)).filter(
190198
trace => trace.timestamp.isAfter(this.lastTimestamp)
191199
);
192200
traces.sort((a, b) => -1 * a.compareTo(b));

0 commit comments

Comments
 (0)