Package org.libvirt

Examples of org.libvirt.DomainBlockStats


            List<VmDiskStatsEntry> stats = new ArrayList<VmDiskStatsEntry>();

            List<DiskDef> disks = getDisks(conn, vmName);

            for (DiskDef disk : disks) {
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                String path = disk.getDiskPath(); // for example, path = /mnt/pool_uuid/disk_path/
                String diskPath = null;
                if (path != null) {
                    String[] token = path.split("/");
                    if (token.length > 3) {
View Full Code Here


            long io_rd = 0;
            long io_wr = 0;
            long bytes_rd = 0;
            long bytes_wr = 0;
            for (DiskDef disk : disks) {
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                io_rd += blockStats.rd_req;
                io_wr += blockStats.wr_req;
                bytes_rd += blockStats.rd_bytes;
                bytes_wr += blockStats.wr_bytes;
            }
View Full Code Here

        return this.resourceContext.getParentResourceComponent().getConnection();
    }

    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {

        DomainBlockStats stats = getConnection().getDomainBlockStats(
            this.resourceContext.getParentResourceComponent().getDomainName(), this.resourceContext.getResourceKey());

        for (MeasurementScheduleRequest request : metrics) {
            Field f = stats.getClass().getField(request.getName());
            report.addData(new MeasurementDataNumeric(request, (double) f.getLong(stats)));
        }
    }
View Full Code Here

            List<DiskDef> disks = getDisks(conn, vmName);

            for (DiskDef disk : disks) {
                if (disk.getDeviceType() != deviceType.DISK)
                    break;
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                String path = disk.getDiskPath(); // for example, path = /mnt/pool_uuid/disk_path/
                String diskPath = null;
                if (path != null) {
                    String[] token = path.split("/");
                    if (token.length > 3) {
View Full Code Here

            long io_rd = 0;
            long io_wr = 0;
            long bytes_rd = 0;
            long bytes_wr = 0;
            for (DiskDef disk : disks) {
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                io_rd += blockStats.rd_req;
                io_wr += blockStats.wr_req;
                bytes_rd += blockStats.rd_bytes;
                bytes_wr += blockStats.wr_bytes;
            }
View Full Code Here

            List<DiskDef> disks = getDisks(conn, vmName);

            for (DiskDef disk : disks) {
                if (disk.getDeviceType() != deviceType.DISK)
                    break;
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                String path = disk.getDiskPath(); // for example, path = /mnt/pool_uuid/disk_path/
                String diskPath = null;
                if (path != null) {
                    String[] token = path.split("/");
                    if (token.length > 3) {
View Full Code Here

            long io_rd = 0;
            long io_wr = 0;
            long bytes_rd = 0;
            long bytes_wr = 0;
            for (DiskDef disk : disks) {
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                io_rd += blockStats.rd_req;
                io_wr += blockStats.wr_req;
                bytes_rd += blockStats.rd_bytes;
                bytes_wr += blockStats.wr_bytes;
            }
View Full Code Here

            List<DiskDef> disks = getDisks(conn, vmName);

            for (DiskDef disk : disks) {
                if (disk.getDeviceType() != deviceType.DISK)
                    break;
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                String path = disk.getDiskPath(); // for example, path = /mnt/pool_uuid/disk_path/
                String diskPath = null;
                if (path != null) {
                    String[] token = path.split("/");
                    if (token.length > 3) {
View Full Code Here

            long io_rd = 0;
            long io_wr = 0;
            long bytes_rd = 0;
            long bytes_wr = 0;
            for (DiskDef disk : disks) {
                DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
                io_rd += blockStats.rd_req;
                io_wr += blockStats.wr_req;
                bytes_rd += blockStats.rd_bytes;
                bytes_wr += blockStats.wr_bytes;
            }
View Full Code Here

            int rdBytes = 0;
            int wrBytes = 1024;

            @Override
            public DomainBlockStats answer(InvocationOnMock invocation) throws Throwable {
                DomainBlockStats domainBlockStats = new DomainBlockStats();

                domainBlockStats.rd_bytes = (rdBytes += increment);
                domainBlockStats.wr_bytes = (wrBytes += increment);
                return domainBlockStats;
            }
View Full Code Here

TOP

Related Classes of org.libvirt.DomainBlockStats

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.