Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudSim - Cpu Utilization

Tags:

cloudsim

Can anyone explain the real difference between these two methods

vm.getTotalUtilizationOfCpu(CloudSim.clock());

and

cloudlet.getUtilizationOfCpu(CloudSim.clock());

Thanks in advance

like image 832
Nemah Awad Avatar asked Dec 04 '25 18:12

Nemah Awad


1 Answers

Here's the difference.

1) vm.getTotalUtilizationOfCpu(CloudSim.clock());

getTotalUtilizationOfCpu is the method of class vm. You can call it by instance of vm class

If you look at the implementation of this method in source code.

public abstract double getTotalUtilizationOfCpu(double time);

    /**
     * Gets the current requested mips.
     * 
     * @return the current mips
     */

It returns the cpu utilization in form of mips

2) cloudlet.getUtilizationOfCpu(CloudSim.clock());

getTotalUtilizationOfCpu is the method of class cloudlet. You can call it by instance of cloudlet class

if you look at the implementation of this method in source code.

/**
     * Gets the utilization percentage of cpu.
     *
     * @param time the time
     * @return the utilization of cpu
     */
    public double getUtilizationOfCpu(final double time) {
        return getUtilizationModelCpu().getUtilization(time);
    }

It returns the cpu utilization in form of percentage (between 0 to 1)

like image 185
Chanda Korat Avatar answered Dec 10 '25 15:12

Chanda Korat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!