001/*
002 * Copyright © 2025 CUI-OpenSource-Software (info@cuioss.de)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package de.cuioss.benchmarking.common.jfr;
017
018import jdk.jfr.*;
019
020/**
021 * JFR event to mark benchmark phases (warmup, measurement, etc).
022 * Helps in separating analysis of different benchmark phases.
023 */
024@Name("de.cuioss.benchmark.BenchmarkPhase")
025@Label("Benchmark Phase")
026@Description("Marks the beginning and end of benchmark phases")
027@Category({"Benchmark", "Lifecycle"})
028@StackTrace(false)
029public class BenchmarkPhaseEvent extends Event {
030
031    @Label("Benchmark Name")
032    @Description("Name of the benchmark")
033    public String benchmarkName;
034
035    @Label("Phase")
036    @Description("Benchmark phase (warmup, measurement, etc)")
037    public String phase;
038
039    @Label("Iteration")
040    @Description("Iteration number within the phase")
041    public int iteration;
042
043    @Label("Total Iterations")
044    @Description("Total number of iterations in this phase")
045    public int totalIterations;
046
047    @Label("Fork")
048    @Description("Fork number")
049    public int fork;
050
051    @Label("Thread Count")
052    @Description("Number of threads used in this phase")
053    public int threadCount;
054}