private void produceCpuMetrics(String hboxCmdProcessId) throws IOException {
        String command = "cat /proc/" + hboxCmdProcessId + "/stat";
        try {
            Process process = Runtime.getRuntime().exec(command);
            InputStream is = process.getInputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String line;
            while ((line = br.readLine()) != null) {
                String[] strs = line.split(" ");
                this.containerProcessId = strs[3];
                break;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        LOG.info("containerProcessId is:" + this.containerProcessId);
        ProcessTreeInfo processTreeInfo =
                new ProcessTreeInfo(this.containerId.getContainerId(), null, null, 0, 0, 0, 0);
        ResourceCalculatorProcessTree pt = ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(
                this.containerProcessId, this.processTreeClass, conf);
        processTreeInfo.setPid(this.containerProcessId);
        processTreeInfo.setProcessTree(pt);
        final ResourceCalculatorProcessTree pTree = processTreeInfo.getProcessTree();
        final DecimalFormat df = new DecimalFormat("#.00");
        df.setRoundingMode(RoundingMode.HALF_UP);
        LOG.info("Starting thread to read cpu metrics");
        Thread cpuMetricsThread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    while (true) {
                        pTree.updateProcessTree();
                        Long time = (new Date()).getTime();
                        double currentPmemUsage =
                                Double.parseDouble(df.format(pTree.getRssMemorySize() / 1024.0 / 1024.0 / 1024.0));
                        int cpuUsagePercentPerCore = (int) pTree.getCpuUsagePercent();
                        if (cpuUsagePercentPerCore < 0) {
                            cpuUsagePercentPerCore = 0;
                        }
                        if (currentPmemUsage < 0.0) {
                            currentPmemUsage = 0.0;
                        }
                        List memPoint = new ArrayList();
                        List utilPoint = new ArrayList();
                        memPoint.add(time);
                        memPoint.add(currentPmemUsage);
                        utilPoint.add(time);
                        utilPoint.add(cpuUsagePercentPerCore);
                        cpuMetrics.put("CPUMEM", memPoint);
                        cpuMetrics.put("CPUUTIL", utilPoint);
                        Utilities.sleep(1000);
                    }
                } catch (Exception e) {
                    LOG.warn("Exception in thread read cpu metrics");
                    e.printStackTrace();
                }
            }
        });
        cpuMetricsThread.start();
    }
Return the number of cpu vcores assigned

@return
core/src/main/java/net/qihoo/hbox/container/ContainerReporter.java