Kieker 1.3

kieker.monitoring.core.controller
Class MonitoringController

java.lang.Object
  extended by kieker.monitoring.core.controller.AbstractController
      extended by kieker.monitoring.core.controller.MonitoringController
All Implemented Interfaces:
IMonitoringRecordReceiver, IMonitoringController, ISamplingController, IStateController, ITimeSourceController, IWriterController, MonitoringControllerMBean

public final class MonitoringController
extends AbstractController
implements IMonitoringController, MonitoringControllerMBean

Author:
Jan Waller

Method Summary
static IMonitoringController createInstance(Configuration configuration)
           
 boolean disableMonitoring()
          Disables monitoring.
 boolean enableMonitoring()
          Enables monitoring.
 int getExperimentId()
          Returns the experiment ID.
 String getHostName()
          The HostName will be part of the monitoring data and allows to distinguish observations in cases where the software system is deployed on more than one host.
static IMonitoringController getInstance()
           
 String getName()
          Returns the name of this controller.
 long getNumberOfInserts()
          Shows how many inserts have been performed since last restart of the execution environment.
 ITimeSource getTimeSource()
          Returns the ITimeSource used in this controller.
static String getVersion()
          Return the version name of this controller instance.
 int incExperimentId()
          Increments the experiment ID by 1 and returns the new value.
 boolean isMonitoringEnabled()
          Returns whether monitoring is enabled or disabled/terminated.
 boolean isMonitoringTerminated()
          Returns whether monitoring is permanently terminated.
 boolean newMonitoringRecord(IMonitoringRecord record)
          Called for each new record.
 boolean removeScheduledSampler(ScheduledSamplerJob sampler)
          Stops future executions of the given periodic ScheduledSamplerJob.
 ScheduledSamplerJob schedulePeriodicSampler(ISampler sampler, long initialDelay, long period, TimeUnit timeUnit)
          Schedules the given ISampler with given initial delay, and period.
 void setExperimentId(int newExperimentID)
          Sets the experiment ID to the given value.
 boolean terminateMonitoring()
          Permanently terminates monitoring
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createInstance

public static final IMonitoringController createInstance(Configuration configuration)

getVersion

public static final String getVersion()
Return the version name of this controller instance.

Returns:
the version name

toString

public final String toString()
Specified by:
toString in class AbstractController

terminateMonitoring

public final boolean terminateMonitoring()
Description copied from interface: IStateController
Permanently terminates monitoring

Specified by:
terminateMonitoring in interface IStateController
Returns:
true if now terminated; false if already terminated
See Also:
IStateController.isMonitoringTerminated()

isMonitoringTerminated

public final boolean isMonitoringTerminated()
Description copied from interface: IStateController
Returns whether monitoring is permanently terminated.

Specified by:
isMonitoringTerminated in interface IStateController
Returns:
true if monitoring is permanently terminated, false if monitoring is enabled or disabled.
See Also:
IStateController.terminateMonitoring()

enableMonitoring

public final boolean enableMonitoring()
Description copied from interface: IStateController
Enables monitoring.

Specified by:
enableMonitoring in interface IStateController
Returns:
true if monitoring is enabled, false otherwise

disableMonitoring

public final boolean disableMonitoring()
Description copied from interface: IStateController
Disables monitoring. If monitoring is disabled, the MonitoringController simply pauses. Furthermore, probes should stop collecting new data and monitoring writers stop should stop writing existing data.

Specified by:
disableMonitoring in interface IStateController
Returns:
true if monitoring is disabled, false otherwise

isMonitoringEnabled

public final boolean isMonitoringEnabled()
Description copied from interface: IStateController
Returns whether monitoring is enabled or disabled/terminated.

Specified by:
isMonitoringEnabled in interface IStateController
Returns:
true of monitoring is enabled, false if monitoring is disabled or terminated.
See Also:
IStateController.disableMonitoring(), IStateController.enableMonitoring()

getName

public final String getName()
Description copied from interface: IStateController
Returns the name of this controller.

Specified by:
getName in interface IStateController
Returns:
String

getHostName

public final String getHostName()
Description copied from interface: IStateController
The HostName will be part of the monitoring data and allows to distinguish observations in cases where the software system is deployed on more than one host. When you want to distinguish multiple Virtual Machines on one host, you have to set the HostName manually in the Configuration.

Specified by:
getHostName in interface IStateController

incExperimentId

public final int incExperimentId()
Description copied from interface: IStateController
Increments the experiment ID by 1 and returns the new value.

Specified by:
incExperimentId in interface IStateController
Returns:
experimentID

setExperimentId

public final void setExperimentId(int newExperimentID)
Description copied from interface: IStateController
Sets the experiment ID to the given value.

Specified by:
setExperimentId in interface IStateController

getExperimentId

public final int getExperimentId()
Description copied from interface: IStateController
Returns the experiment ID.

Specified by:
getExperimentId in interface IStateController
Returns:
experimentID

newMonitoringRecord

public final boolean newMonitoringRecord(IMonitoringRecord record)
Description copied from interface: IMonitoringRecordReceiver
Called for each new record. Notice, that this method should not throw an exception, but indicate an error by the return value false.

Specified by:
newMonitoringRecord in interface IMonitoringRecordReceiver
Specified by:
newMonitoringRecord in interface IWriterController
Parameters:
record - the record.
Returns:
true on success; false in case of an error.

getNumberOfInserts

public final long getNumberOfInserts()
Description copied from interface: IWriterController
Shows how many inserts have been performed since last restart of the execution environment.

Specified by:
getNumberOfInserts in interface IWriterController
Returns:
long

schedulePeriodicSampler

public final ScheduledSamplerJob schedulePeriodicSampler(ISampler sampler,
                                                         long initialDelay,
                                                         long period,
                                                         TimeUnit timeUnit)
Description copied from interface: ISamplingController
Schedules the given ISampler with given initial delay, and period.

Specified by:
schedulePeriodicSampler in interface ISamplingController
Returns:

removeScheduledSampler

public final boolean removeScheduledSampler(ScheduledSamplerJob sampler)
Description copied from interface: ISamplingController
Stops future executions of the given periodic ScheduledSamplerJob.

Specified by:
removeScheduledSampler in interface ISamplingController
Returns:
true if the sensor is not registered

getTimeSource

public final ITimeSource getTimeSource()
Description copied from interface: ITimeSourceController
Returns the ITimeSource used in this controller.

Specified by:
getTimeSource in interface ITimeSourceController
Returns:
ITimeSource

getInstance

public static final IMonitoringController getInstance()

Kieker 1.3

Copyright 2011 the Kieker Project, http://kieker.sourceforge.net