Brooklyn

brooklyn.enricher
[Java] Class TimeFractionDeltaEnricher

java.lang.Object
  brooklyn.policy.basic.AbstractEntityAdjunct
      brooklyn.enricher.basic.AbstractEnricher
          brooklyn.enricher.basic.AbstractTypeTransformingEnricher
              brooklyn.enricher.TimeFractionDeltaEnricher

public class TimeFractionDeltaEnricher
extends AbstractTypeTransformingEnricher

Converts an absolute measure of time into a fraction of time, based on the delta between consecutive values and the elapsed time between those values. For example, if the values are for ProcessCpuTime (i.e. microseconds of CPU time for the given process), then this would convert it into a fraction (i.e. 100th of the percentage): (newVal-prevVal)/(newTimestamp/prevTimestamp). It also configured with the time units for the values.


Field Summary
protected long lastTimestamp

protected java.lang.Number lastValue

 
Fields inherited from class AbstractTypeTransformingEnricher
target
 
Fields inherited from class AbstractEnricher
leftoverProperties
 
Fields inherited from class AbstractEntityAdjunct
_subscriptionTracker, entity, id, name
 
Constructor Summary
TimeFractionDeltaEnricher(Entity producer, Sensor source, Sensor target, java.util.concurrent.TimeUnit origUnits)

TimeFractionDeltaEnricher(Entity producer, Sensor source, Sensor target, long nanosPerOrigUnit)

 
Method Summary
void onEvent(SensorEvent event)

void onEvent(SensorEvent event, long eventTimestamp)

 
Methods inherited from class AbstractTypeTransformingEnricher
setEntity
 
Methods inherited from class AbstractEnricher
configure
 
Methods inherited from class AbstractEntityAdjunct
check, destroy, getAllSubscriptions, getId, getManagementContext, getName, getSubscriptionTracker, isDestroyed, isRunning, setEntity, setId, setName, subscribe, subscribeToChildren, subscribeToMembers, unsubscribe, unsubscribe
 

Field Detail

lastTimestamp

protected long lastTimestamp


lastValue

protected java.lang.Number lastValue


 
Constructor Detail

TimeFractionDeltaEnricher

public TimeFractionDeltaEnricher(Entity producer, Sensor source, Sensor target, java.util.concurrent.TimeUnit origUnits)


TimeFractionDeltaEnricher

public TimeFractionDeltaEnricher(Entity producer, Sensor source, Sensor target, long nanosPerOrigUnit)


 
Method Detail

onEvent

@Override
public void onEvent(SensorEvent event)


onEvent

public void onEvent(SensorEvent event, long eventTimestamp)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.