package com.wgcloud.entity;
|
|
import com.wgcloud.util.DateUtil;
|
import org.apache.commons.lang3.StringUtils;
|
|
import java.util.Date;
|
|
/**
|
* @version v3.3
|
* @ClassName:AppState.java
|
* @author: http://www.wgstart.com
|
* @date: 2021年1月16日
|
* @Description: app状态监控
|
* @Copyright: 2019-2021 wgcloud. All rights reserved.
|
*/
|
public class AppState extends BaseEntity {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
|
|
/**
|
* 应用信息ID
|
*/
|
private String appInfoId;
|
|
|
/**
|
* %CPU
|
*/
|
private Double cpuPer;
|
|
/**
|
* %MEM
|
*/
|
private Double memPer;
|
|
/**
|
* 进程使用的线程数
|
*/
|
private String threadsNum;
|
|
/**
|
* 此值用于回显,数据库无此字段,渲染进程趋势图表使用,此字段是为了统一mysql和pgsql字段类型,所以threadsNum使用了varchar
|
*/
|
private Integer threadsNumInt;
|
|
/**
|
* 添加时间
|
* MM-dd hh:mm:ss
|
*/
|
private String dateStr;
|
|
/**
|
* 创建时间
|
*/
|
private Date createTime;
|
|
|
public Double getCpuPer() {
|
return cpuPer;
|
}
|
|
public void setCpuPer(Double cpuPer) {
|
this.cpuPer = cpuPer;
|
}
|
|
|
public String getAppInfoId() {
|
return appInfoId;
|
}
|
|
public void setAppInfoId(String appInfoId) {
|
this.appInfoId = appInfoId;
|
}
|
|
public Double getMemPer() {
|
return memPer;
|
}
|
|
public void setMemPer(Double memPer) {
|
this.memPer = memPer;
|
}
|
|
public Date getCreateTime() {
|
return createTime;
|
}
|
|
public void setCreateTime(Date createTime) {
|
this.createTime = createTime;
|
}
|
|
public String getDateStr() {
|
String s = DateUtil.getDateTimeString(this.getCreateTime());
|
if (!StringUtils.isEmpty(s) && s.length() > 16) {
|
return s.substring(5);
|
}
|
return dateStr;
|
}
|
|
public void setDateStr(String dateStr) {
|
this.dateStr = dateStr;
|
}
|
|
public String getThreadsNum() {
|
return threadsNum;
|
}
|
|
public void setThreadsNum(String threadsNum) {
|
this.threadsNum = threadsNum;
|
}
|
|
public Integer getThreadsNumInt() {
|
if (!StringUtils.isEmpty(threadsNum)) {
|
try {
|
threadsNumInt = Integer.valueOf(threadsNum);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
} else {
|
threadsNumInt = 0;
|
}
|
return threadsNumInt;
|
}
|
|
public void setThreadsNumInt(Integer threadsNumInt) {
|
this.threadsNumInt = threadsNumInt;
|
}
|
}
|