package com.hertz.modules.monitor.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MonitorDto {
    private CpuInfo cpu;
    private MemInfo mem;
    private JvmInfo jvm;
    private SysInfo sys;
    private List<DiskInfo> disks;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class CpuInfo {
        private int cpuNum;
        private double total;
        private double sys;
        private double used;
        private double wait;
        private double free;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class MemInfo {
        private double total;
        private double used;
        private double free;
        private double usage;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class JvmInfo {
        private double total;
        private double max;
        private double free;
        private String version;
        private String home;
        private double usage;
        private String startTime;
        private String runTime;
        private String inputArgs;
        private String name;
        private long gcCount;
        private long gcTime;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SysInfo {
        private String computerName;
        private String computerIp;
        private String userDir;
        private String osName;
        private String osArch;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DiskInfo {
        private String dirName;
        private String sysTypeName;
        private String typeName;
        private String total;
        private String free;
        private String used;
        private double usage;
    }
}
