net.floodlightcontroller.perfmon
Class NullPktInProcessingTime

java.lang.Object
  extended by net.floodlightcontroller.perfmon.NullPktInProcessingTime
All Implemented Interfaces:
IFloodlightModule, IFloodlightService, IPktInProcessingTimeService

public class NullPktInProcessingTime
extends java.lang.Object
implements IFloodlightModule, IPktInProcessingTimeService

An IPktInProcessingTimeService implementation that does nothing. This is used mainly for performance testing or if you don't want to use the IPktInProcessingTimeService features.

Author:
alexreimers

Constructor Summary
NullPktInProcessingTime()
           
 
Method Summary
 void bootstrap(java.util.List<IOFMessageListener> listeners)
          Creates time buckets for a set of modules to measure their performance
 CumulativeTimeBucket getCtb()
           
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
          Get a list of Modules that this module depends on.
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
          Return the list of interfaces that this module implements.
 java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
          Instantiate (as needed) and return objects that implement each of the services exported by this module.
 void init(FloodlightModuleContext context)
          This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized.
 boolean isEnabled()
           
 void recordEndTimeComp(IOFMessageListener listener)
           
 void recordEndTimePktIn(IOFSwitch sw, OFMessage m, FloodlightContext cntx)
           
 void recordStartTimeComp(IOFMessageListener listener)
          Stores a timestamp in ns.
 void recordStartTimePktIn()
           
 void setEnabled(boolean enabled)
           
 void startUp(FloodlightModuleContext context)
          This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullPktInProcessingTime

public NullPktInProcessingTime()
Method Detail

getModuleServices

public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
Description copied from interface: IFloodlightModule
Return the list of interfaces that this module implements. All interfaces must inherit IFloodlightService

Specified by:
getModuleServices in interface IFloodlightModule
Returns:

getServiceImpls

public java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
Description copied from interface: IFloodlightModule
Instantiate (as needed) and return objects that implement each of the services exported by this module. The map returned maps the implemented service to the object. The object could be the same object or different objects for different exported services.

Specified by:
getServiceImpls in interface IFloodlightModule
Returns:
The map from service interface class to service implementation

getModuleDependencies

public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
Description copied from interface: IFloodlightModule
Get a list of Modules that this module depends on. The module system will ensure that each these dependencies is resolved before the subsequent calls to init().

Specified by:
getModuleDependencies in interface IFloodlightModule
Returns:
The Collection of IFloodlightServices that this module depends on.

init

public void init(FloodlightModuleContext context)
          throws FloodlightModuleException
Description copied from interface: IFloodlightModule
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized.

Specified by:
init in interface IFloodlightModule
Throws:
FloodlightModuleException

startUp

public void startUp(FloodlightModuleContext context)
Description copied from interface: IFloodlightModule
This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads.

Specified by:
startUp in interface IFloodlightModule

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface IPktInProcessingTimeService

bootstrap

public void bootstrap(java.util.List<IOFMessageListener> listeners)
Description copied from interface: IPktInProcessingTimeService
Creates time buckets for a set of modules to measure their performance

Specified by:
bootstrap in interface IPktInProcessingTimeService
Parameters:
listeners - The message listeners to create time buckets for

recordStartTimeComp

public void recordStartTimeComp(IOFMessageListener listener)
Description copied from interface: IPktInProcessingTimeService
Stores a timestamp in ns. Used right before a service handles an OF message. Only stores if the service is enabled.

Specified by:
recordStartTimeComp in interface IPktInProcessingTimeService

recordEndTimeComp

public void recordEndTimeComp(IOFMessageListener listener)
Specified by:
recordEndTimeComp in interface IPktInProcessingTimeService

recordStartTimePktIn

public void recordStartTimePktIn()
Specified by:
recordStartTimePktIn in interface IPktInProcessingTimeService

recordEndTimePktIn

public void recordEndTimePktIn(IOFSwitch sw,
                               OFMessage m,
                               FloodlightContext cntx)
Specified by:
recordEndTimePktIn in interface IPktInProcessingTimeService

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface IPktInProcessingTimeService

getCtb

public CumulativeTimeBucket getCtb()
Specified by:
getCtb in interface IPktInProcessingTimeService