Skip to content

Commit

Permalink
Make poll timer for logfile configurable (#2521)
Browse files Browse the repository at this point in the history
Fixes #2513
  • Loading branch information
hzpz authored Jun 2, 2023
1 parent d6cf6d2 commit 17eae87
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spring-boot-admin-docs/src/site/asciidoc/server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ In addition when the reverse proxy terminates the https connection, it may be ne
| Polling duration in ms to fetch new threads data.
| `2500`

| spring.boot.admin.ui.poll-timer.logfile
| Polling duration in ms to fetch new logfile data.
| `1000`

| spring.boot.admin.ui.enable-toasts
| Allows to enable toast notifications.
| `false`
Expand Down
1 change: 1 addition & 0 deletions spring-boot-admin-server-ui/src/main/frontend/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ declare global {
process: number;
memory: number;
threads: number;
logfile: number;
};

type ViewSettings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const DEFAULT_CONFIG = {
process: 2500,
memory: 2500,
threads: 2500,
logfile: 1000,
},
},
user: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ import prettyBytes from 'pretty-bytes';
import { debounceTime, fromEvent } from 'rxjs';

import subscribing from '@/mixins/subscribing';
import sbaConfig from '@/sba-config';
import Instance from '@/services/instance';
import autolink from '@/utils/autolink';
import { animationFrameScheduler, concatAll, concatMap, map, of, tap } from '@/utils/rxjs';
Expand Down Expand Up @@ -162,7 +163,7 @@ export default {
createSubscription() {
this.error = null;
return this.instance
.streamLogfile(1000)
.streamLogfile(sbaConfig.uiSettings.pollTimer.logfile)
.pipe(
tap(
(part) => (this.skippedBytes = this.skippedBytes || part.skipped)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ public static class PollTimer {
*/
private int threads = 2500;

/**
* Time in milliseconds to refresh data in logfile view.
*/
private int logfile = 1000;

}

@lombok.Data
Expand Down

0 comments on commit 17eae87

Please sign in to comment.