12 lines
573 B
Java
12 lines
573 B
Java
package com.iomatex.console;
|
|
public class CpuSampleTest {
|
|
public static void main(String[] args){
|
|
CpuSample a=new CpuSample("cpu 100 0 100 800 0 0 0 0 50 0");
|
|
CpuSample b=new CpuSample("cpu 150 0 100 850 0 0 0 0 75 0");
|
|
if(b.usage(a)!=50.0 || a.usage(null)!=null || a.usage(b)!=null || a.usage(a)!=null)throw new AssertionError();
|
|
CpuSample c=new CpuSample("cpu 150 0 100 900 50 0 0 0");
|
|
if(c.usage(b)!=0.0)throw new AssertionError("iowait included as idle");
|
|
System.out.println("PASS: aggregate CPU delta, guest exclusion, reset, first sample, iowait");
|
|
}
|
|
}
|