类 BufferingApplicationStartup
java.lang.Object
org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup
- 所有已实现的接口:
ApplicationStartup
ApplicationStartup
implementation that buffers steps
and
records their timestamp as well as their processing time.
Once recording has been started
, steps are buffered up until
the configured capacity
; after that, new
steps are not recorded.
There are several ways to keep the buffer size low:
- 从以下版本开始:
- 2.4.0
- 作者:
- Brian Clozel, Phillip Webb
-
字段概要
从接口继承的字段 org.springframework.core.metrics.ApplicationStartup
DEFAULT
-
构造器概要
构造器构造器说明BufferingApplicationStartup
(int capacity) Create a new bufferedApplicationStartup
with a limited capacity and starts the recording of steps. -
方法概要
修饰符和类型方法说明void
addFilter
(Predicate<StartupStep> filter) Add a predicate filter to the list of existing ones.Return thetimeline
by pulling steps from the buffer.Return thetimeline
as a snapshot of currently buffered steps.void
Start the recording of steps and mark the beginning of theStartupTimeline
.
-
构造器详细资料
-
BufferingApplicationStartup
public BufferingApplicationStartup(int capacity) Create a new bufferedApplicationStartup
with a limited capacity and starts the recording of steps.- 参数:
capacity
- the configured capacity; once reached, new steps are not recorded.
-
-
方法详细资料
-
startRecording
public void startRecording()Start the recording of steps and mark the beginning of theStartupTimeline
. The class constructor already implicitly calls this, but it is possible to reset it as long as steps have not been recorded already.- 抛出:
IllegalStateException
- if called andStartupStep
have been recorded already.
-
addFilter
Add a predicate filter to the list of existing ones.A
step
that doesn't match all filters will not be recorded.- 参数:
filter
- the predicate filter to add.
-
start
- 指定者:
start
在接口中ApplicationStartup
-
getBufferedTimeline
Return thetimeline
as a snapshot of currently buffered steps.This will not remove steps from the buffer, see
drainBufferedTimeline()
for its counterpart.- 返回:
- a snapshot of currently buffered steps.
-
drainBufferedTimeline
Return thetimeline
by pulling steps from the buffer.This removes steps from the buffer, see
getBufferedTimeline()
for its read-only counterpart.- 返回:
- buffered steps drained from the buffer.
-