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.config; 017 018import lombok.Getter; 019 020/** 021 * Enumeration of benchmark types supported by the CUI benchmarking infrastructure. 022 * <p> 023 * Each type has different characteristics and requirements for badge generation, 024 * metrics collection, and reporting. 025 */ 026@Getter 027public enum BenchmarkType { 028 /** 029 * Micro benchmarks that test individual components or methods in isolation. 030 * <p> 031 * Characteristics: 032 * <ul> 033 * <li>Fast execution (seconds to minutes)</li> 034 * <li>High precision measurements</li> 035 * <li>Minimal external dependencies</li> 036 * <li>Focus on throughput and latency</li> 037 * </ul> 038 */ 039 MICRO("micro", "Performance Score", "Micro Performance"), 040 041 /** 042 * Integration benchmarks that test complete workflows or external services. 043 * <p> 044 * Characteristics: 045 * <ul> 046 * <li>Longer execution time (minutes to hours)</li> 047 * <li>Network and I/O overhead</li> 048 * <li>External service dependencies</li> 049 * <li>Focus on end-to-end performance</li> 050 * </ul> 051 */ 052 INTEGRATION("integration", "Integration Performance", "Integration Performance"); 053 054 private final String identifier; 055 private final String badgeLabel; 056 private final String displayName; 057 058 BenchmarkType(String identifier, String badgeLabel, String displayName) { 059 this.identifier = identifier; 060 this.badgeLabel = badgeLabel; 061 this.displayName = displayName; 062 } 063 064 /** 065 * Gets the badge file name for performance badges. 066 * 067 * @return the performance badge file name 068 */ 069 public String getPerformanceBadgeFileName() { 070 return this == MICRO ? "performance-badge.json" : "integration-performance-badge.json"; 071 } 072 073 /** 074 * Gets the badge file name for trend badges. 075 * 076 * @return the trend badge file name 077 */ 078 public String getTrendBadgeFileName() { 079 return this == MICRO ? "trend-badge.json" : "integration-trend-badge.json"; 080 } 081}