package com.gcsc.connection.statistics.dto;

import java.util.List;

/**
 * API 엔드포인트별 통계 응답 DTO
 */
public record ApiStatsResponse(
    List<ApiCallRank> topApis,
    List<ApiErrorRank> topErrorApis,
    List<ApiMethodDistribution> methodDistribution,
    List<HttpStatusDistribution> statusCodeDistribution
) {

    public record ApiCallRank(
        String serviceName,
        String apiName,
        String requestUrl,
        String requestMethod,
        long callCount,
        double avgResponseTime,
        double successRate
    ) {}

    public record ApiErrorRank(
        String serviceName,
        String apiName,
        String requestUrl,
        long errorCount,
        long totalCount,
        double errorRate
    ) {}

    public record ApiMethodDistribution(
        String method,
        long count
    ) {}

    public record HttpStatusDistribution(
        int statusCode,
        long count
    ) {}
}
