Exemplo n.º 1
0
  public void output(String[] args) throws SigarException {
    // sigar/os info
    Version.printInfo(this.out);
    println("");

    // uptime
    new Uptime(this.shell).output(args);
    println("");

    // cpu info
    CpuInfo cpuinfo = new CpuInfo(this.shell);
    cpuinfo.displayTimes = false;
    cpuinfo.output(args);
    println("");

    // memory info
    new Free(this.shell).output(args);
    println("");

    println("File Systems........." + Arrays.asList(this.sigar.getFileSystemList()));
    println("");

    println("Network Interfaces..." + Arrays.asList(this.sigar.getNetInterfaceList()));
    println("");

    // system resource limits
    println("System resource limits:");
    new Ulimit(this.shell).output(args);
  }
Exemplo n.º 2
0
  @Test
  public void cpuinfo() {
    CpuInfo cpuInfo = new CpuInfo(defaultFile);
    assertEquals(24, cpuInfo.processors().size());

    CpuInfo.Processor one = cpuInfo.processors().get(0);
    assertEquals(1, one.physicalID());
    assertEquals(6, one.cores());
    assertEquals(12, one.siblings());
    assertTrue(one.hasAES());
    assertTrue(one.hasFPU());

    // its the same cpu, just a different silbling
    assertEquals(one, cpuInfo.processors().get(1));

    CpuInfo.Processor two = cpuInfo.processors().get(6);
    assertEquals(0, two.physicalID());
    assertEquals(6, two.cores());
    assertEquals(12, two.siblings());

    // different cpu
    assertNotEquals(one, two);
  }