print last run cpu
This commit is contained in:
		
							parent
							
								
									8e48b40ec2
								
							
						
					
					
						commit
						9df495d6b5
					
				@ -1,6 +1,7 @@
 | 
				
			|||||||
package net.hyperic.sigar.test;
 | 
					package net.hyperic.sigar.test;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import net.hyperic.sigar.Sigar;
 | 
					import net.hyperic.sigar.Sigar;
 | 
				
			||||||
 | 
					import net.hyperic.sigar.SigarException;
 | 
				
			||||||
import net.hyperic.sigar.SigarNotImplementedException;
 | 
					import net.hyperic.sigar.SigarNotImplementedException;
 | 
				
			||||||
import net.hyperic.sigar.Cpu;
 | 
					import net.hyperic.sigar.Cpu;
 | 
				
			||||||
import net.hyperic.sigar.CpuPerc;
 | 
					import net.hyperic.sigar.CpuPerc;
 | 
				
			||||||
@ -26,6 +27,14 @@ public class TestCpu extends SigarTestCase {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        traceln("Total.." + cpu.getTotal());
 | 
					        traceln("Total.." + cpu.getTotal());
 | 
				
			||||||
        assertTrue(cpu.getTotal() > 0);
 | 
					        assertTrue(cpu.getTotal() > 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            long current =
 | 
				
			||||||
 | 
					                getSigar().getProcState("$$").getProcessor();
 | 
				
			||||||
 | 
					            traceln("last run cpu=" + current);
 | 
				
			||||||
 | 
					        } catch (SigarException e) {
 | 
				
			||||||
 | 
					            e.printStackTrace();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void testCreate() throws Exception {
 | 
					    public void testCreate() throws Exception {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user