Examples of CpuTimer


Examples of com.facebook.presto.util.CpuTimer

                session,
                new DataSize(256, MEGABYTE),
                new DataSize(1, MEGABYTE),
                false);

        CpuTimer cpuTimer = new CpuTimer();
        execute(taskContext);
        CpuDuration executionTime = cpuTimer.elapsedTime();

        TaskStats taskStats = taskContext.getTaskStats();
        long inputRows = taskStats.getRawInputPositions();
        long inputBytes = taskStats.getRawInputDataSize().toBytes();
        long outputRows = taskStats.getOutputPositions();
View Full Code Here

Examples of org.hyperic.sigar.CpuTimer

    public void output(String[] args) throws SigarException {
        boolean isInteractive = this.shell.isInteractive();
        //turn off paging.
        this.shell.setInteractive(false);
        CpuTimer cpu = new CpuTimer(this.sigar);

        int num;
       
        if (Character.isDigit(args[0].charAt(0))) {
            num = Integer.parseInt(args[0]);
            String[] xargs = new String[args.length-1];
            System.arraycopy(args, 1, xargs, 0, xargs.length);
            args = xargs;
        }
        else {
            num = 1;
        }

        cpu.start();

        try {
            for (int i=0; i<num; i++) {
                this.shell.handleCommand("time " + args[0], args);
            }
        } finally {
            this.shell.setInteractive(isInteractive);
        }

        cpu.stop();
        cpu.list(this.out);
    }
View Full Code Here

Examples of org.hyperic.sigar.CpuTimer

        assertGtEqZeroTrace("Sys", cpu.getSys());

        assertGtEqZeroTrace("Total", cpu.getTotal());

        CpuTimer timer = new CpuTimer(sigar);
        timer.start();

        for (int i=0; i<1000000; i++) {
            System.getProperty("java.home");
        }

        String sleepTime =
            System.getProperty("sigar.testThreadCpu.sleep");
        if (sleepTime != null) {
            Thread.sleep(Integer.parseInt(sleepTime) * 1000);
        }
        timer.stop();

        traceln("\nUsage...\n");

        assertGtEqZeroTrace("User", timer.getCpuUser());

        assertGtEqZeroTrace("Sys", timer.getCpuSys());

        assertGtEqZeroTrace("Total", timer.getCpuTotal());

        assertGtEqZeroTrace("Real Time", timer.getTotalTime());

        traceln("Cpu Percent=" + CpuPerc.format(timer.getCpuUsage()));
    }
View Full Code Here

Examples of org.hyperic.sigar.CpuTimer

        assertGtEqZeroTrace("Sys", cpu.getSys());

        assertGtEqZeroTrace("Total", cpu.getTotal());

        CpuTimer timer = new CpuTimer(sigar);
        timer.start();

        for (int i=0; i<1000000; i++) {
            System.getProperty("java.home");
        }

        String sleepTime =
            System.getProperty("sigar.testThreadCpu.sleep");
        if (sleepTime != null) {
            Thread.sleep(Integer.parseInt(sleepTime) * 1000);
        }
        timer.stop();

        traceln("\nUsage...\n");

        assertGtEqZeroTrace("User", timer.getCpuUser());

        assertGtEqZeroTrace("Sys", timer.getCpuSys());

        assertGtEqZeroTrace("Total", timer.getCpuTotal());

        assertGtEqZeroTrace("Real Time", timer.getTotalTime());

        traceln("Cpu Percent=" + CpuPerc.format(timer.getCpuUsage()));
    }
View Full Code Here

Examples of org.hyperic.sigar.CpuTimer

    public void output(String[] args) throws SigarException {
        boolean isInteractive = this.shell.isInteractive();
        //turn off paging.
        this.shell.setInteractive(false);
        CpuTimer cpu = new CpuTimer(this.sigar);

        int num;
       
        if (Character.isDigit(args[0].charAt(0))) {
            num = Integer.parseInt(args[0]);
            String[] xargs = new String[args.length-1];
            System.arraycopy(args, 1, xargs, 0, xargs.length);
            args = xargs;
        }
        else {
            num = 1;
        }

        cpu.start();

        try {
            for (int i=0; i<num; i++) {
                this.shell.handleCommand("time " + args[0], args);
            }
        } finally {
            this.shell.setInteractive(isInteractive);
        }

        cpu.stop();
        cpu.list(this.out);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.