edu.cmu.cs.able.gauges.Siena.Demo
Class BandwidthGaugeImpl
java.lang.Object
|
+--edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
|
+--edu.cmu.cs.able.gauges.Siena.Demo.BandwidthGaugeImpl
- All Implemented Interfaces:
- edu.cmu.cs.able.probebus.IProbeConsumer, java.lang.Runnable
- public class BandwidthGaugeImpl
- extends edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
- implements edu.cmu.cs.able.probebus.IProbeConsumer
Implementation of the BandwidthGauge, conforming to gauge type:
ServerLoadGauge = [
type = edu.cmu.cs.able.gauges.Siena.Demo.BandwidthGauge
setup = [where : String]
config = []
values = [bandwidth : float]
Fields inherited from class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl |
doReporting, gaugeBus, gaugeID, gaugeType, mappings, reportingFrequency, reportingThread, setupParams |
Constructor Summary |
BandwidthGaugeImpl(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gid,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setup,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings,
edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus gaugeBus,
edu.cmu.cs.able.probebus.IProbeBus probeBus)
Creates new BandwidthGauge |
Method Summary |
boolean |
configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
This method is used to configure the gauge. |
boolean |
consistentlyCreated()
|
void |
onProbeEvent(edu.cmu.cs.able.probebus.IProbeEvent event)
|
boolean |
queryAllValues(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValueVector values)
Returns the current date. |
boolean |
queryState(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
Returns the state of the gauge. |
java.lang.String |
queryValue(java.lang.String valueName)
The method called to query the value of the gauge. |
void |
reportNewValue()
|
Methods inherited from class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl |
run, startReportingThread, stopReportingThread |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
where
protected java.lang.String where
- Where (the component or connector) the gauge is attached. (maps to the probe shell name)
ALPHA
public static final double ALPHA
bwProbe
public KXProbeHelper bwProbe
BandwidthGaugeImpl
public BandwidthGaugeImpl(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gid,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setup,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings,
edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus gaugeBus,
edu.cmu.cs.able.probebus.IProbeBus probeBus)
- Creates new BandwidthGauge
- Parameters:
gaugeID
- The ID of the new gauge.creatorID
- The ID of the gauge manager that created the gauge.setupParams
- The parameters that the gauge uses to set itself up. The
valid setup parameters for this gauge are:
where : Stringmappings
- The property that the latency
value is associated with.
configure
public boolean configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
- This method is used to configure the gauge.
- Overrides:
configure
in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
- Parameters:
configParams
- The parameters used to configure the gauge. For the
BandwidthGauge, there are no valid configuration parameters for this gauge.- Returns:
- Whether the gauge was successfully configured. Will always return false.
consistentlyCreated
public boolean consistentlyCreated()
- Overrides:
consistentlyCreated
in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
queryAllValues
public boolean queryAllValues(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValueVector values)
- Returns the current date.
- Overrides:
queryAllValues
in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
- Parameters:
values
- The vector into which to place the date.- Returns:
- Whether the gauge could report it's current value.
queryState
public boolean queryState(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
- Returns the state of the gauge.
- Overrides:
queryState
in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
- Parameters:
setupParams
- The vector into which the setup parameters are copied. Will be
empty for this gauge.configParams
- The configuration parameters for this gauge. Will be empty.mappings
- The property that each gauge value is associated with.
Will have an element for bandwidth
.- Returns:
- Whether the state of the gauge could be queried.
queryValue
public java.lang.String queryValue(java.lang.String valueName)
- The method called to query the value of the gauge. This
provides a direct query for the gauge, as opposed to the
gauge reporting to value on the bus.
- Overrides:
queryValue
in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
- Parameters:
valueName
- The name of the value to query.- Returns:
- The corresponding value of the gauge. (Note: it is assumed
that the querier know the property associated with this
value).
reportNewValue
public void reportNewValue()
- Overrides:
reportNewValue
in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
onProbeEvent
public void onProbeEvent(edu.cmu.cs.able.probebus.IProbeEvent event)
- Specified by:
onProbeEvent
in interface edu.cmu.cs.able.probebus.IProbeConsumer