|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.Timed
hu.mta.sztaki.lpds.cloud.simulator.energy.MonitorConsumption
public class MonitorConsumption
This class is an initial framework to collect periodical reports on consumptions. In its current state it is too rigid and needs more customization. However, if extended further it would allow a single consumption monitor to be added to a particular resourcespreader, eliminating the need for multiple queries on the getTotalProcessed function. NOTE: this class is outdated and might perform badly.
Nested Class Summary | |
---|---|
private static class |
MonitorConsumption.SpreadingRecord
the collected totalprocessed data with timestamps to allow seeing the temporal behavior of totalprocessed |
Field Summary | |
---|---|
private long |
aSecond
the amount of ticks it takes for a single second to pass in the simulated time |
private double |
subDayProcessing
the total processing accomplished in the last day |
private PriorityQueue<MonitorConsumption.SpreadingRecord> |
subDayRecords
all spreading records collected during the past day |
private double |
subHourProcessing
the total processing accomplished in the last hour |
private PriorityQueue<MonitorConsumption.SpreadingRecord> |
subHourRecords
all spreading records that were collected during the past hour |
private double |
subSecondProcessing
the amount of processing done in the last second |
(package private) ResourceSpreader |
toMonitor
what resource spreader to collect the totalprocessed values from |
private double |
totalProcessed
the totalprocessed value of the spreader during the last collection |
Constructor Summary | |
---|---|
MonitorConsumption(ResourceSpreader toMonitor,
long aSecond)
Initiates a monitoring session for the resource consumptions of a particular resource spreader |
Method Summary | |
---|---|
void |
cancelMonitoring()
allows the monitoring to be terminated at any arbitrary point of time. |
double |
getSubDayProcessing()
the amount of processing done in a the past day (this is a rolling day always assumed to start a day before this function was called) |
double |
getSubHourProcessing()
the amount of processing done in a the past hour (this is a rolling hour always assumed to start a hour before this function was called) |
double |
getSubSecondProcessing()
the amount of processing done in a the past second (this is a rolling second always assumed to start a second before this function was called) |
void |
tick(long fires)
Data collector function that updates all processing data records and throws out the too old records as well. |
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 |
---|
final ResourceSpreader toMonitor
private PriorityQueue<MonitorConsumption.SpreadingRecord> subHourRecords
private PriorityQueue<MonitorConsumption.SpreadingRecord> subDayRecords
private double subHourProcessing
private double subDayProcessing
private double totalProcessed
private double subSecondProcessing
private final long aSecond
Constructor Detail |
---|
public MonitorConsumption(ResourceSpreader toMonitor, long aSecond)
toMonitor
- the resource spreader to be monitoredaSecond
- the amount of ticks it takes to get to one second in the
current configuration of the simulation, if this should be
below 1 then the monitor consumption class should not be usedMethod Detail |
---|
public double getSubDayProcessing()
public double getSubHourProcessing()
public double getSubSecondProcessing()
public void tick(long fires)
tick
in class Timed
fires
- The particular time instance when the function was called. The
time instance is passed so the tick functions will not need to
call getFireCount() if they need to operate on the actual
time.public void cancelMonitoring()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |