package com.test.common.core.domain.model;

/**
 * @author liangdaliang
 * @Description：接口错误统计
 * @date 2025-04-17 19:08
 */
public class InterfaceErrorStat {
    private String interfaceName;
    private Long totalSamples;
    private Long errorCount;
    private Double errorRate;

    public InterfaceErrorStat(String interfaceName, long totalSamples, long errorCount) {
        this.interfaceName = interfaceName;
        this.totalSamples = totalSamples;
        this.errorCount = errorCount;
    }

    public String getInterfaceName() {
        return interfaceName;
    }

    public Long getTotalSamples() {
        return totalSamples;
    }

    public Long getErrorCount() {
        return errorCount;
    }

    public Double getErrorRate() {
        errorRate = (totalSamples == 0 ? 0 : (double) errorCount / totalSamples * 100);
        return errorRate;
    }
}
