package io.wdd.rpc.status.beans;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder(toBuilder = true)
public class CPUStatus {


    @JsonProperty("NumCores")
    private Integer numCores;
    @JsonProperty("CPUInfo")
    private List<CPUInfoDTO> cPUInfo;
    @JsonProperty("CPUPercent")
    private Double cPUPercent;
    @JsonProperty("CPULoads")
    private CPULoadsDTO cPULoads;
    @JsonProperty("SystemLoads")
    private SystemLoadsDTO systemLoads;

    @NoArgsConstructor
    @Data
    public static class CPULoadsDTO {
        @JsonProperty("load1")
        private Integer load1;
        @JsonProperty("load5")
        private Integer load5;
        @JsonProperty("load15")
        private Integer load15;
    }

    @NoArgsConstructor
    @Data
    public static class SystemLoadsDTO {
        @JsonProperty("load1")
        private Integer load1;
        @JsonProperty("load5")
        private Integer load5;
        @JsonProperty("load15")
        private Integer load15;
    }

    @NoArgsConstructor
    @Data
    public static class CPUInfoDTO {
        @JsonProperty("cpu")
        private Integer cpu;
        @JsonProperty("vendorId")
        private String vendorId;
        @JsonProperty("family")
        private String family;
        @JsonProperty("model")
        private String model;
        @JsonProperty("stepping")
        private Integer stepping;
        @JsonProperty("physicalId")
        private String physicalId;
        @JsonProperty("coreId")
        private String coreId;
        @JsonProperty("cores")
        private Integer cores;
        @JsonProperty("modelName")
        private String modelName;
        @JsonProperty("mhz")
        private Integer mhz;
        @JsonProperty("cacheSize")
        private Integer cacheSize;
        @JsonProperty("flags")
        private List<?> flags;
        @JsonProperty("microcode")
        private String microcode;
    }
}
