Skip to content

Commit

Permalink
[system test] [perf] Add to TO scalability tests also printing the ta…
Browse files Browse the repository at this point in the history
…ble (#11157)

Signed-off-by: see-quick <[email protected]>
  • Loading branch information
see-quick authored Feb 20, 2025
1 parent 0d903f7 commit 2018b84
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public interface PerformanceConstants {
String TOPIC_OPERATOR_OUT_SUCCESSFUL_KAFKA_TOPICS_CREATED = "OUT: Successful KafkaTopics Created";
String TOPIC_OPERATOR_OUT_SUCCESSFUL_KAFKA_TOPICS_CREATED_AND_MODIFIED_AND_DELETED = "OUT: Successful KafkaTopics Created and Modified and Deleted (ms)";
String TOPIC_OPERATOR_OUT_UPDATE_TIME = "OUT: Update Time (ms)";
String TOPIC_OPERATOR_OUT_RECONCILIATION_INTERVAL = "OUT: Reconciliation interval (ms)";

// --------------------------------------------------------------------------------
// ------------------------------ USER OPERATOR -----------------------------------
Expand Down Expand Up @@ -163,6 +164,7 @@ public interface PerformanceConstants {
String TOPIC_OPERATOR_BOBS_STREAMING_USE_CASE = "bobStreamingUseCase";
String TOPIC_OPERATOR_ALICE_BULK_USE_CASE = "aliceBulkUseCase";
String USER_OPERATOR_ALICE_BULK_USE_CASE = "aliceBulkUseCase";
String GENERAL_SCALABILITY_USE_CASE = "scalabilityUseCase";
String GENERAL_CAPACITY_USE_CASE = "capacityUseCase";
String TOPIC_OPERATOR_FIXED_SIZE_OF_EVENTS_USE_CASE = "fixedSizeOfEventsUseCase";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
import io.strimzi.api.kafka.model.topic.KafkaTopic;
import io.strimzi.operator.common.Annotations;
import io.strimzi.systemtest.AbstractST;
import io.strimzi.systemtest.Environment;
import io.strimzi.systemtest.TestConstants;
import io.strimzi.systemtest.annotations.IsolatedTest;
import io.strimzi.systemtest.performance.report.TopicOperatorPerformanceReporter;
import io.strimzi.systemtest.performance.report.parser.TopicOperatorMetricsParser;
import io.strimzi.systemtest.performance.utils.TopicOperatorPerformanceUtils;
import io.strimzi.systemtest.resources.ResourceManager;
import io.strimzi.systemtest.storage.TestStorage;
Expand All @@ -19,9 +22,13 @@
import io.strimzi.systemtest.utils.kafkaUtils.KafkaTopicUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;

import java.io.IOException;
import java.time.LocalDateTime;
import java.time.temporal.TemporalAccessor;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -33,6 +40,11 @@
@Tag(SCALABILITY)
public class TopicOperatorScalabilityPerformance extends AbstractST {

protected static final TemporalAccessor ACTUAL_TIME = LocalDateTime.now();
protected static final String REPORT_DIRECTORY = "topic-operator";

protected TopicOperatorPerformanceReporter topicOperatorPerformanceReporter = new TopicOperatorPerformanceReporter();

private static final Logger LOGGER = LogManager.getLogger(TopicOperatorScalabilityPerformance.class);

private TestStorage suiteTestStorage;
Expand Down Expand Up @@ -67,7 +79,13 @@ void testScalability() {
performanceAttributes.put(PerformanceConstants.TOPIC_OPERATOR_IN_MAX_BATCH_LINGER_MS, maxBatchLingerMs);
performanceAttributes.put(PerformanceConstants.TOPIC_OPERATOR_IN_PROCESS_TYPE, "TOPIC-CONCURRENT");

performanceAttributes.put(PerformanceConstants.TOPIC_OPERATOR_OUT_SUCCESSFUL_KAFKA_TOPICS_CREATED_AND_MODIFIED_AND_DELETED, reconciliationTimeMs);
performanceAttributes.put(PerformanceConstants.TOPIC_OPERATOR_OUT_RECONCILIATION_INTERVAL, reconciliationTimeMs);

try {
this.topicOperatorPerformanceReporter.logPerformanceData(this.suiteTestStorage, performanceAttributes, REPORT_DIRECTORY + "/" + PerformanceConstants.GENERAL_SCALABILITY_USE_CASE, ACTUAL_TIME, Environment.PERFORMANCE_DIR);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
});
}
Expand Down Expand Up @@ -136,4 +154,11 @@ void setUp() {
.build()
);
}

@AfterAll
void tearDown() {
TopicOperatorPerformanceUtils.stopExecutor();
// show tables with metrics
TopicOperatorMetricsParser.main(new String[]{PerformanceConstants.TOPIC_OPERATOR_PARSER});
}
}

0 comments on commit 2018b84

Please sign in to comment.