@Override Swap loadSnapshot(Sigar sigar) throws SigarException { return sigar.getSwap(); }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
@Override public void emit(ServiceEmitter emitter) { Swap swap = null; try { swap = sigar.getSwap(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } if (swap != null) { long currPageIn = swap.getPageIn(); long currPageOut = swap.getPageOut(); final Map<String, Long> stats = ImmutableMap.of( "sys/swap/pageIn", (currPageIn - prevPageIn), "sys/swap/pageOut", (currPageOut - prevPageOut), "sys/swap/max", swap.getTotal(), "sys/swap/free", swap.getFree() ); final ServiceMetricEvent.Builder builder = builder(); MonitorUtils.addDimensionsToBuilder(builder, dimensions); for (Map.Entry<String, Long> entry : stats.entrySet()) { emitter.emit(builder.build(entry.getKey(), entry.getValue())); } this.prevPageIn = currPageIn; this.prevPageOut = currPageOut; } } }
swap = sigar.getSwap(); swapMap.putAll(swap.toMap()); } catch(SigarException se){
public void output(String[] args) throws SigarException { Mem mem = this.sigar.getMem(); Swap swap = this.sigar.getSwap(); Object[] header = new Object[] { "total", "used", "free" }; Object[] memRow = new Object[] { format(mem.getTotal()), format(mem.getUsed()), format(mem.getFree()) }; Object[] actualRow = new Object[] { format(mem.getActualUsed()), format(mem.getActualFree()) }; Object[] swapRow = new Object[] { format(swap.getTotal()), format(swap.getUsed()), format(swap.getFree()) }; printf("%18s %10s %10s", header); printf("Mem: %10ld %10ld %10ld", memRow); //e.g. linux if ((mem.getUsed() != mem.getActualUsed()) || (mem.getFree() != mem.getActualFree())) { printf("-/+ buffers/cache: " + "%10ld %10d", actualRow); } printf("Swap: %10ld %10ld %10ld", swapRow); printf("RAM: %10ls", new Object[] { mem.getRam() + "MB" }); }
org.hyperic.sigar.Swap sigSwap = sigar.getSwap(); long total = sigSwap.getTotal(); long free = sigSwap.getFree();
@Override Swap loadSnapshot(Sigar sigar) throws SigarException { return sigar.getSwap(); }
public Swap getSwap() throws SigarException {return _sigar.getSwap();}
@Override protected Swap loadValue() { try { return sigar.getSwap(); } catch (SigarException e) { throw new RuntimeException("Failed to get swap info from sigar", e); } } }
public SwapSpace swap() { try { return SwapSpace.fromSigarBean(sigar.getSwap()); } catch (SigarException e) { return SwapSpace.undef(); } }
public Monitor.Mem getMem() throws SigarException { return new Monitor.Mem(sigar.getMem(), sigar.getSwap()); }
public Object doMonitor(Map<String, Object> params) throws Exception { return SigarFactory.getSigar().getSwap().toMap(); }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
private SwapStats() { try { Swap swap = sigar.getSwap(); this.prevPageIn = swap.getPageIn(); this.prevPageOut = swap.getPageOut(); } catch (SigarException e) { log.error(e, "Failed to get Swap"); } }
public long getVal() throws StatUnreachableException { try { long curr = sigar.getSwap().getPageOut(); long rtn = curr - last; last = curr; if (isFirst) { isFirst = false; throw new StatUnreachableException("don't return first value"); } return rtn; } catch (SigarException e) { throw new StatUnreachableException(e.getMessage(), e); } } });
public long getVal() throws StatUnreachableException { try { long curr = sigar.getSwap().getPageIn(); long rtn = curr - last; last = curr; if (isFirst) { isFirst = false; throw new StatUnreachableException("don't return first value"); } return rtn; } catch (SigarException e) { throw new StatUnreachableException(e.getMessage(), e); } } });