hu.mta.sztaki.lpds.cloud.simulator.energy.specialized
Class PhysicalMachineEnergyMeter

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.Timed
      extended by hu.mta.sztaki.lpds.cloud.simulator.energy.EnergyMeter
          extended by hu.mta.sztaki.lpds.cloud.simulator.energy.AggregatedEnergyMeter
              extended by hu.mta.sztaki.lpds.cloud.simulator.energy.specialized.PhysicalMachineEnergyMeter
All Implemented Interfaces:
VMManager.CapacityChangeEvent<ResourceConstraints>, Comparable<Timed>
Direct Known Subclasses:
SimpleVMEnergyMeter

public class PhysicalMachineEnergyMeter
extends AggregatedEnergyMeter
implements VMManager.CapacityChangeEvent<ResourceConstraints>

Allows to energy meter all resource spreaders (e.g. CPU, Network) associated with a single PhysicalMachine.

Author:
"Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2014"

Field Summary
private  PhysicalMachine observed
          The physical machine that is under monitoring
 
Fields inherited from class hu.mta.sztaki.lpds.cloud.simulator.energy.AggregatedEnergyMeter
supervised
 
Fields inherited from class hu.mta.sztaki.lpds.cloud.simulator.energy.EnergyMeter
lastMetered
 
Constructor Summary
PhysicalMachineEnergyMeter(PhysicalMachine pm)
          instantiates a physical machine meter based on the meter aggregator concept of DISSECT-CF
 
Method Summary
 void capacityChanged(ResourceConstraints newCapacity, List<ResourceConstraints> affectedCapacity)
          readjusts the meter (and thus evaluate actual consumption values) if the capacity of the metered physical machine changes
 PhysicalMachine getObserved()
          allows determining which PM is under observation
 boolean startMeter(long interval, boolean dropPriorReading)
          ensures the newly started metering will consider capacity changes in the PM (e.g.
 void stopMeter()
          terminates the metering session for the aggregation and ensures that we no longer consider capacity changes for the PM as they don't need to be reflected in the metering results anymore
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.energy.AggregatedEnergyMeter
getTotalConsumption, tick
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.energy.EnergyMeter
getMeteringStarted, getMeteringStopped, increaseTotalConsumption, readjustMeter
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.Timed
calcTimeJump, compareTo, fire, getFireCount, getFrequency, getNextEvent, getNextFire, isSubscribed, jumpTime, nextEventDistance, resetTimed, setBackPreference, simulateUntil, simulateUntilLastEvent, skipEventsTill, subscribe, toString, unsubscribe, updateFrequency
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

observed

private final PhysicalMachine observed
The physical machine that is under monitoring

Constructor Detail

PhysicalMachineEnergyMeter

public PhysicalMachineEnergyMeter(PhysicalMachine pm)
instantiates a physical machine meter based on the meter aggregator concept of DISSECT-CF

Parameters:
pm - the physical machine to be metered
Method Detail

startMeter

public boolean startMeter(long interval,
                          boolean dropPriorReading)
ensures the newly started metering will consider capacity changes in the PM (e.g. DVFS like behavior)

Overrides:
startMeter in class AggregatedEnergyMeter
Parameters:
interval - The meter refresh frequency.
dropPriorReading -
    False: the totalConsumption values will accumulate from a previous metering session True: the totalconsumption values will start from 0 after the completion of this function.
Returns:
  • False: if a metering session is already underway
  • True: if the metering session was successfully initiated

stopMeter

public void stopMeter()
terminates the metering session for the aggregation and ensures that we no longer consider capacity changes for the PM as they don't need to be reflected in the metering results anymore

Overrides:
stopMeter in class AggregatedEnergyMeter

capacityChanged

public void capacityChanged(ResourceConstraints newCapacity,
                            List<ResourceConstraints> affectedCapacity)
readjusts the meter (and thus evaluate actual consumption values) if the capacity of the metered physical machine changes

Specified by:
capacityChanged in interface VMManager.CapacityChangeEvent<ResourceConstraints>
Parameters:
newCapacity - the size of the new capacity in terms of physical resources
affectedCapacity - the list of those objects (representing the computing capacity of the particular VMManager) that were added/removed during the change

getObserved

public PhysicalMachine getObserved()
allows determining which PM is under observation

Returns:
the metered pm


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.