package com.tsiwebserver.VO;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ServerStatusVO {
	@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
	private LocalDateTime clctDt;
	private String hostName;
	private double useCpuRate;
	private double useMemRate;
	private double useDiskRate;
	
	public void init() {
		SimpleDateFormat fmtDate = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
		this.clctDt = LocalDateTime.parse(fmtDate.format(new Date()));
		this.useCpuRate = 0;
		this.useMemRate = 0;
		this.useDiskRate = 0;
	}
}
