package com.inspect.job.task;

import com.alibaba.fastjson.JSONObject;
import com.inspect.base.core.utils.SystemInfo;
import com.inspect.job.client.MontQueryClient;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

@Component("SystemResourceInfoPushTask")
public class SystemResourceInfoPushTask {
    @Resource
    MontQueryClient montQueryClient;

    public void pushSystemMsgTask() {
        JSONObject systemInfo = SystemInfo.getSystemInfo();
        JSONObject result = new JSONObject();
        result.put("event", "serverResourceInfo");
        result.put("data", systemInfo);
        this.montQueryClient.sendMessage(result.toJSONString());
    }
}
