Examples of interfaceStats()


Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

    }

    public DomainInterfaceStats getDomainInterfaceStats(String domainName, String path) throws LibvirtException {
        Domain domain = getDomain(domainName);
        try {
            return domain.interfaceStats(path);
        } finally {
            domain.free();
        }
    }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif.getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }

            if (oldStats != null) {
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

        nodeInfo.sockets = 2;
        nodeInfo.threads = 2;
        nodeInfo.model = "Foo processor";
        Mockito.when(connect.nodeInfo()).thenReturn(nodeInfo);
        // this is testing the interface stats, returns an increasing number of sent and received bytes
        Mockito.when(domain.interfaceStats(Matchers.anyString())).thenAnswer(new Answer<DomainInterfaceStats>() {
            // increment with less than a KB, so this should be less than 1 KB
            final static int increment = 1000;
            int rxBytes = 1000;
            int txBytes = 1000;
View Full Code Here

Examples of org.libvirt.Domain.interfaceStats()

            List<InterfaceDef> vifs = getInterfaces(conn, vmName);
            long rx = 0;
            long tx = 0;
            for (InterfaceDef vif : vifs) {
                DomainInterfaceStats ifStats = dm.interfaceStats(vif
                        .getDevName());
                rx += ifStats.rx_bytes;
                tx += ifStats.tx_bytes;
            }
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.