edu.cmu.cs.able.gauges.Siena.Demo
Class ServerLoadGauge
java.lang.Object
|
+--edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
|
+--edu.cmu.cs.able.gauges.Siena.Demo.ServerLoadGauge
- All Implemented Interfaces:
- edu.cmu.cs.able.gaugeInfrastructure.GaugeControl
- public class ServerLoadGauge
- extends edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
Implementation of the ServerLoadGauge, conforming to gauge type:
ServerLoadGauge = [
type = edu.cmu.cs.able.gauges.Siena.Demo.ServerLoadGauge
setup = [where : String]
config = []
values = [load : int]
Field Summary |
protected java.lang.String |
gaugeType
|
Fields inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge |
gaugeBus, mappings, myManagerID, setupParams |
Constructor Summary |
ServerLoadGauge(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gaugeID,
java.lang.String creatorID,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
Creates new ServerLoadGauge |
Method Summary |
boolean |
configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
This method is used to configure the gauge. |
static void |
main(java.lang.String[] args)
A command-line interface to start the gauge. |
void |
processDelete(java.lang.String gaugeMgrID)
Processes a delete message from the gauge manager. |
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. |
Methods inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge |
finalizeCreation, finalizeDeletion, getGaugeID, setGaugeID |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
gaugeType
protected java.lang.String gaugeType
ServerLoadGauge
public ServerLoadGauge(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gaugeID,
java.lang.String creatorID,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
- Creates new ServerLoadGauge
- 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.Siena.SienaGauge
- Parameters:
configParams
- The parameters used to configure the gauge. For the
ServerLoadGauge, it is (reset, boolean)- Returns:
- Whether the gauge was successfully configured.
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.Siena.SienaGauge
- 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.Siena.SienaGauge
- 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 emptymappings
- The property that each gauge value is associated with.
Will have an element for load
.- 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.Siena.SienaGauge
- 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).
main
public static void main(java.lang.String[] args)
- A command-line interface to start the gauge.
- Parameters:
args
- -gt gauge type
-gn gauge name
-mt model type
-mn model name
[-setup name=value]
[-mappings name=property]
-creator creator ID
-senp siena port
[-debug]
processDelete
public void processDelete(java.lang.String gaugeMgrID)
- Description copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Processes a delete message from the gauge manager. This is called by the gauge infrastructure
when a delete message is sent to the gauge. This method follows the process for
deleting a gauge, i.e.:
report the fact that the gauge was deleted to the gauge bus
stop reporting values
don't listen to any more events
It should be assumed by the gauge that it will be destroyed after this method is called
(destroyed could mean that the JVM running this gauge is stopped)
- Overrides:
processDelete
in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Following copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Parameters:
gaugeMgrID
- The ID of the gauge manager requesting deletion.