From 9df495d6b53a5d153d8bbdf921b85f0280535a94 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 22 Mar 2006 17:30:53 +0000 Subject: [PATCH] print last run cpu --- bindings/java/src/net/hyperic/sigar/test/TestCpu.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/test/TestCpu.java b/bindings/java/src/net/hyperic/sigar/test/TestCpu.java index 58de6427..7c61c06a 100644 --- a/bindings/java/src/net/hyperic/sigar/test/TestCpu.java +++ b/bindings/java/src/net/hyperic/sigar/test/TestCpu.java @@ -1,6 +1,7 @@ package net.hyperic.sigar.test; import net.hyperic.sigar.Sigar; +import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarNotImplementedException; import net.hyperic.sigar.Cpu; import net.hyperic.sigar.CpuPerc; @@ -26,6 +27,14 @@ public class TestCpu extends SigarTestCase { traceln("Total.." + cpu.getTotal()); 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 {