public int deleteTopics() {
        ListTopicsResult result = admin.listTopics();
        try {
            List<String> toDelete = result.names().get().stream()
                    .filter(name -> name.startsWith(COMMON_TOPIC_PREFIX))
                    .collect(Collectors.toList());
            admin.deleteTopics(toDelete).all().get();
            return toDelete.size();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        } catch (ExecutionException ignored) {
        }
        return 0;
    }
Delete all historical performance test topics.
tools/src/main/java/org/apache/kafka/tools/automq/perf/TopicService.java