Home / Class/ StartupTimeline Class — spring-boot Architecture

StartupTimeline Class — spring-boot Architecture

Architecture documentation for the StartupTimeline class in StartupTimeline.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/metrics/buffering/StartupTimeline.java lines 34–115

public class StartupTimeline {

	private final Instant startTime;

	private final List<TimelineEvent> events;

	StartupTimeline(Instant startTime, List<TimelineEvent> events) {
		this.startTime = startTime;
		this.events = Collections.unmodifiableList(events);
	}

	/**
	 * Return the start time of this timeline.
	 * @return the start time
	 */
	public Instant getStartTime() {
		return this.startTime;
	}

	/**
	 * Return the recorded events.
	 * @return the events
	 */
	public List<TimelineEvent> getEvents() {
		return this.events;
	}

	/**
	 * Event on the current {@link StartupTimeline}. Each event has a start/end time, a
	 * precise duration and the complete {@link StartupStep} information associated with
	 * it.
	 */
	public static class TimelineEvent {

		private final BufferedStartupStep step;

		private final Instant endTime;

		private final Duration duration;

		TimelineEvent(BufferedStartupStep step, Instant endTime) {
			this.step = step;
			this.endTime = endTime;
			this.duration = Duration.between(step.getStartTime(), endTime);
		}

		/**
		 * Return the start time of this event.
		 * @return the start time
		 */
		public Instant getStartTime() {
			return this.step.getStartTime();
		}

		/**
		 * Return the end time of this event.
		 * @return the end time
		 */
		public Instant getEndTime() {
			return this.endTime;
		}

		/**
		 * Return the duration of this event, i.e. the processing time of the associated
		 * {@link StartupStep} with nanoseconds precision.
		 * @return the event duration
		 */
		public Duration getDuration() {
			return this.duration;
		}

		/**
		 * Return the {@link StartupStep} information for this event.
		 * @return the step information.
		 */
		public StartupStep getStartupStep() {
			return this.step;
		}

	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free