Spring-MVCの散歩道 > 応用の森(総合テクニック編) > WebSocketを使った、リアルタイムCPU使用率推移グラフ
|
package jp.dip.arimodoki.model.data; import org.springframework.context.annotation.Scope; /** * 毎秒単位のCPU使用率を格納するBean * 後でJSONにシリアライズするためのBean */ @Scope("prototype") public class CpuUsed implements CpuUsedIf { private String time = "0"; //秒数 private double used = 0; //使用率 /** デフォルトコンストラクタ */ public CpuUsed() {} /** コンストラクタ */ public CpuUsed(String time, int used) { this.time = time; this.used = used; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public double getUsed() { return used; } public void setUsed(double used) { this.used = used; } } |