Package org.apache.hadoop.yarn.util.ProcfsBasedProcessTree

Examples of org.apache.hadoop.yarn.util.ProcfsBasedProcessTree.ProcessTreeSmapMemInfo


      procInfos[3] =
          new ProcessStatInfo(new String[] { "400", "proc4", "1", "400", "400",
              "400000", "400", "4000", "800" });

      ProcessTreeSmapMemInfo[] memInfo = new ProcessTreeSmapMemInfo[4];
      memInfo[0] = new ProcessTreeSmapMemInfo("100");
      memInfo[1] = new ProcessTreeSmapMemInfo("200");
      memInfo[2] = new ProcessTreeSmapMemInfo("300");
      memInfo[3] = new ProcessTreeSmapMemInfo("400");
      createMemoryMappingInfo(memInfo);
      writeStatFiles(procfsRootDir, pids, procInfos, memInfo);

      // crank up the process tree class.
      Configuration conf = new Configuration();
View Full Code Here


      procInfos[3] =
          new ProcessStatInfo(new String[] { "400", "proc4", "100", "100",
              "100", "400000", "400" });
      // write smap information invariably for testing
      ProcessTreeSmapMemInfo[] memInfo = new ProcessTreeSmapMemInfo[4];
      memInfo[0] = new ProcessTreeSmapMemInfo("100");
      memInfo[1] = new ProcessTreeSmapMemInfo("200");
      memInfo[2] = new ProcessTreeSmapMemInfo("300");
      memInfo[3] = new ProcessTreeSmapMemInfo("400");
      createMemoryMappingInfo(memInfo);
      writeStatFiles(procfsRootDir, pids, procInfos, memInfo);

      // crank up the process tree class.
      ProcfsBasedProcessTree processTree =
          createProcessTree("100", procfsRootDir.getAbsolutePath());
      setSmapsInProceTree(processTree, smapEnabled);

      // verify cumulative memory
      Assert.assertEquals("Cumulative memory does not match", 700000L,
        processTree.getCumulativeVmem());
      // write one more process as child of 100.
      String[] newPids = { "500" };
      setupPidDirs(procfsRootDir, newPids);

      ProcessStatInfo[] newProcInfos = new ProcessStatInfo[1];
      newProcInfos[0] =
          new ProcessStatInfo(new String[] { "500", "proc5", "100", "100",
              "100", "500000", "500" });
      ProcessTreeSmapMemInfo[] newMemInfos = new ProcessTreeSmapMemInfo[1];
      newMemInfos[0] = new ProcessTreeSmapMemInfo("500");
      createMemoryMappingInfo(newMemInfos);
      writeStatFiles(procfsRootDir, newPids, newProcInfos, newMemInfos);

      // check memory includes the new process.
      processTree.updateProcessTree();
      Assert.assertEquals("Cumulative vmem does not include new process",
        1200000L, processTree.getCumulativeVmem());
      if (!smapEnabled) {
        long cumuRssMem =
            ProcfsBasedProcessTree.PAGE_SIZE > 0
                ? 1200L * ProcfsBasedProcessTree.PAGE_SIZE : 0L;
        Assert.assertEquals("Cumulative rssmem does not include new process",
          cumuRssMem, processTree.getCumulativeRssmem());
      } else {
        Assert.assertEquals("Cumulative rssmem does not include new process",
          100 * KB_TO_BYTES * 4, processTree.getCumulativeRssmem());
      }

      // however processes older than 1 iteration will retain the older value
      Assert.assertEquals(
        "Cumulative vmem shouldn't have included new process", 700000L,
        processTree.getCumulativeVmem(1));
      if (!smapEnabled) {
        long cumuRssMem =
            ProcfsBasedProcessTree.PAGE_SIZE > 0
                ? 700L * ProcfsBasedProcessTree.PAGE_SIZE : 0L;
        Assert.assertEquals(
          "Cumulative rssmem shouldn't have included new process", cumuRssMem,
          processTree.getCumulativeRssmem(1));
      } else {
        Assert.assertEquals(
          "Cumulative rssmem shouldn't have included new process",
          100 * KB_TO_BYTES * 3, processTree.getCumulativeRssmem(1));
      }

      // one more process
      newPids = new String[] { "600" };
      setupPidDirs(procfsRootDir, newPids);

      newProcInfos = new ProcessStatInfo[1];
      newProcInfos[0] =
          new ProcessStatInfo(new String[] { "600", "proc6", "100", "100",
              "100", "600000", "600" });
      newMemInfos = new ProcessTreeSmapMemInfo[1];
      newMemInfos[0] = new ProcessTreeSmapMemInfo("600");
      createMemoryMappingInfo(newMemInfos);
      writeStatFiles(procfsRootDir, newPids, newProcInfos, newMemInfos);

      // refresh process tree
      processTree.updateProcessTree();
View Full Code Here

      procInfos[5] =
          new ProcessStatInfo(new String[] { "600", "proc6", "1", "1", "1",
              "400000", "400", "4000", "800" });

      ProcessTreeSmapMemInfo[] memInfos = new ProcessTreeSmapMemInfo[6];
      memInfos[0] = new ProcessTreeSmapMemInfo("100");
      memInfos[1] = new ProcessTreeSmapMemInfo("200");
      memInfos[2] = new ProcessTreeSmapMemInfo("300");
      memInfos[3] = new ProcessTreeSmapMemInfo("400");
      memInfos[4] = new ProcessTreeSmapMemInfo("500");
      memInfos[5] = new ProcessTreeSmapMemInfo("600");

      String[] cmdLines = new String[numProcesses];
      cmdLines[0] = "proc1 arg1 arg2";
      cmdLines[1] = "proc2 arg3 arg4";
      cmdLines[2] = "proc3 arg5 arg6";
View Full Code Here

      procInfos[3] =
          new ProcessStatInfo(new String[] { "400", "proc4", "1", "400", "400",
              "400000", "400", "4000", "800" });

      ProcessTreeSmapMemInfo[] memInfo = new ProcessTreeSmapMemInfo[4];
      memInfo[0] = new ProcessTreeSmapMemInfo("100");
      memInfo[1] = new ProcessTreeSmapMemInfo("200");
      memInfo[2] = new ProcessTreeSmapMemInfo("300");
      memInfo[3] = new ProcessTreeSmapMemInfo("400");
      createMemoryMappingInfo(memInfo);
      writeStatFiles(procfsRootDir, pids, procInfos, memInfo);

      // crank up the process tree class.
      Configuration conf = new Configuration();
View Full Code Here

      procInfos[3] =
          new ProcessStatInfo(new String[] { "400", "proc4", "100", "100",
              "100", "400000", "400" });
      // write smap information invariably for testing
      ProcessTreeSmapMemInfo[] memInfo = new ProcessTreeSmapMemInfo[4];
      memInfo[0] = new ProcessTreeSmapMemInfo("100");
      memInfo[1] = new ProcessTreeSmapMemInfo("200");
      memInfo[2] = new ProcessTreeSmapMemInfo("300");
      memInfo[3] = new ProcessTreeSmapMemInfo("400");
      createMemoryMappingInfo(memInfo);
      writeStatFiles(procfsRootDir, pids, procInfos, memInfo);

      // crank up the process tree class.
      ProcfsBasedProcessTree processTree =
          createProcessTree("100", procfsRootDir.getAbsolutePath());
      setSmapsInProceTree(processTree, smapEnabled);

      // verify cumulative memory
      Assert.assertEquals("Cumulative memory does not match", 700000L,
        processTree.getCumulativeVmem());
      // write one more process as child of 100.
      String[] newPids = { "500" };
      setupPidDirs(procfsRootDir, newPids);

      ProcessStatInfo[] newProcInfos = new ProcessStatInfo[1];
      newProcInfos[0] =
          new ProcessStatInfo(new String[] { "500", "proc5", "100", "100",
              "100", "500000", "500" });
      ProcessTreeSmapMemInfo[] newMemInfos = new ProcessTreeSmapMemInfo[1];
      newMemInfos[0] = new ProcessTreeSmapMemInfo("500");
      createMemoryMappingInfo(newMemInfos);
      writeStatFiles(procfsRootDir, newPids, newProcInfos, newMemInfos);

      // check memory includes the new process.
      processTree.updateProcessTree();
      Assert.assertEquals("Cumulative vmem does not include new process",
        1200000L, processTree.getCumulativeVmem());
      if (!smapEnabled) {
        long cumuRssMem =
            ProcfsBasedProcessTree.PAGE_SIZE > 0
                ? 1200L * ProcfsBasedProcessTree.PAGE_SIZE : 0L;
        Assert.assertEquals("Cumulative rssmem does not include new process",
          cumuRssMem, processTree.getCumulativeRssmem());
      } else {
        Assert.assertEquals("Cumulative rssmem does not include new process",
          100 * KB_TO_BYTES * 4, processTree.getCumulativeRssmem());
      }

      // however processes older than 1 iteration will retain the older value
      Assert.assertEquals(
        "Cumulative vmem shouldn't have included new process", 700000L,
        processTree.getCumulativeVmem(1));
      if (!smapEnabled) {
        long cumuRssMem =
            ProcfsBasedProcessTree.PAGE_SIZE > 0
                ? 700L * ProcfsBasedProcessTree.PAGE_SIZE : 0L;
        Assert.assertEquals(
          "Cumulative rssmem shouldn't have included new process", cumuRssMem,
          processTree.getCumulativeRssmem(1));
      } else {
        Assert.assertEquals(
          "Cumulative rssmem shouldn't have included new process",
          100 * KB_TO_BYTES * 3, processTree.getCumulativeRssmem(1));
      }

      // one more process
      newPids = new String[] { "600" };
      setupPidDirs(procfsRootDir, newPids);

      newProcInfos = new ProcessStatInfo[1];
      newProcInfos[0] =
          new ProcessStatInfo(new String[] { "600", "proc6", "100", "100",
              "100", "600000", "600" });
      newMemInfos = new ProcessTreeSmapMemInfo[1];
      newMemInfos[0] = new ProcessTreeSmapMemInfo("600");
      createMemoryMappingInfo(newMemInfos);
      writeStatFiles(procfsRootDir, newPids, newProcInfos, newMemInfos);

      // refresh process tree
      processTree.updateProcessTree();
View Full Code Here

      procInfos[5] =
          new ProcessStatInfo(new String[] { "600", "proc6", "1", "1", "1",
              "400000", "400", "4000", "800" });

      ProcessTreeSmapMemInfo[] memInfos = new ProcessTreeSmapMemInfo[6];
      memInfos[0] = new ProcessTreeSmapMemInfo("100");
      memInfos[1] = new ProcessTreeSmapMemInfo("200");
      memInfos[2] = new ProcessTreeSmapMemInfo("300");
      memInfos[3] = new ProcessTreeSmapMemInfo("400");
      memInfos[4] = new ProcessTreeSmapMemInfo("500");
      memInfos[5] = new ProcessTreeSmapMemInfo("600");

      String[] cmdLines = new String[numProcesses];
      cmdLines[0] = "proc1 arg1 arg2";
      cmdLines[1] = "proc2 arg3 arg4";
      cmdLines[2] = "proc3 arg5 arg6";
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.util.ProcfsBasedProcessTree.ProcessTreeSmapMemInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.