|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.counter.CounterStore
public class CounterStore
Implements a central store for system counters. These counters include overall packet-in, packet-out, and flow-mod counters. Additional packet-in counters are maintained for bcast/unicast/multicast traffic, as well as counters for traffic types based on ethertype and ip-proto (maintained on a per switch and controller level). These counters are maintained without the involvement of any other module in the system. For per-module counters and other detailed debug services, consider IDebugCounterService.
Nested Class Summary | |
---|---|
protected class |
CounterStore.CounterEntry
|
protected class |
CounterStore.CounterKeyTuple
|
protected class |
CounterStore.MutableInt
|
static class |
CounterStore.NetworkLayer
|
Field Summary | |
---|---|
protected static java.util.Map<CounterStore.NetworkLayer,java.util.Map<java.lang.String,java.util.List<java.lang.String>>> |
layeredCategories
Counter Categories grouped by network layers NetworkLayer -> CounterToCategories |
protected static org.slf4j.Logger |
log
|
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,CounterStore.CounterEntry> |
nameToCEIndex
A cache of counterName --> Counter used to retrieve counters quickly via string-counter-keys |
protected java.lang.ThreadLocal<java.util.Map<CounterStore.CounterKeyTuple,CounterStore.MutableInt>> |
pktin_local_buffer
Thread local counter stores |
protected java.util.concurrent.ConcurrentHashMap<CounterStore.CounterKeyTuple,java.util.List<ICounter>> |
pktinCounters
Counter storage across all threads. |
protected java.lang.ThreadLocal<java.util.Map<CounterStore.CounterKeyTuple,CounterStore.MutableInt>> |
pktout_local_buffer
|
protected java.util.concurrent.ConcurrentHashMap<CounterStore.CounterKeyTuple,java.util.List<ICounter>> |
pktoutCounters
|
Fields inherited from interface net.floodlightcontroller.counter.ICounterStoreService |
---|
BROADCAST, CONTROLLER_NAME, L3ET_IPV4, MULTICAST, TitleDelimitor, UNICAST |
Constructor Summary | |
---|---|
CounterStore()
|
Method Summary | |
---|---|
ICounter |
createCounter(java.lang.String key,
CounterValue.CounterType type)
Create a new ICounter and set the title. |
static java.lang.String |
createCounterName(java.lang.String switchID,
int portID,
java.lang.String counterName)
Create a title based on switch ID, portID, vlanID, and counterName If portID is -1, the title represents the given switch only If portID is a non-negative number, the title represents the port on the given switch |
protected static java.lang.String |
createCounterName(java.lang.String switchID,
int portID,
java.lang.String counterName,
java.lang.String subCategory,
CounterStore.NetworkLayer layer)
Create a title based on switch ID, portID, vlanID, counterName, and subCategory If portID is -1, the title represents the given switch only If portID is a non-negative number, the title represents the port on the given switch For example: PacketIns can be further categorized based on L2 etherType or L3 protocol |
protected java.util.List<ICounter> |
createPacketInCounters(IOFSwitch sw,
OFMessage m,
Ethernet eth)
|
java.util.Map<java.lang.String,ICounter> |
getAll()
Returns an immutable map of title:counter with all of the counters in the store. |
java.util.List<java.lang.String> |
getAllCategories(java.lang.String counterName,
CounterStore.NetworkLayer layer)
Retrieve a list of subCategories by counterName. |
ICounter |
getCounter(java.lang.String key)
Retrieves a counter with the given title, or null if none can be found. |
protected CounterStore.CounterKeyTuple |
getCountersKey(IOFSwitch sw,
OFMessage m,
Ethernet eth)
|
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. |
protected java.util.List<ICounter> |
getPktOutFMCounters(IOFSwitch sw,
OFMessage m)
|
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. |
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. |
void |
updateFlush()
Flush Local Counter Updates |
void |
updatePacketInCountersLocal(IOFSwitch sw,
OFMessage m,
Ethernet eth)
Update packetIn counters |
void |
updatePktOutFMCounterStoreLocal(IOFSwitch sw,
OFMessage m)
This method can only be used to update packetOut and flowmod counters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger log
protected java.util.concurrent.ConcurrentHashMap<CounterStore.CounterKeyTuple,java.util.List<ICounter>> pktinCounters
protected java.util.concurrent.ConcurrentHashMap<CounterStore.CounterKeyTuple,java.util.List<ICounter>> pktoutCounters
protected final java.lang.ThreadLocal<java.util.Map<CounterStore.CounterKeyTuple,CounterStore.MutableInt>> pktin_local_buffer
protected final java.lang.ThreadLocal<java.util.Map<CounterStore.CounterKeyTuple,CounterStore.MutableInt>> pktout_local_buffer
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,CounterStore.CounterEntry> nameToCEIndex
protected static java.util.Map<CounterStore.NetworkLayer,java.util.Map<java.lang.String,java.util.List<java.lang.String>>> layeredCategories
Constructor Detail |
---|
public CounterStore()
Method Detail |
---|
public void updatePacketInCountersLocal(IOFSwitch sw, OFMessage m, Ethernet eth)
ICounterStoreService
updatePacketInCountersLocal
in interface ICounterStoreService
public void updatePktOutFMCounterStoreLocal(IOFSwitch sw, OFMessage m)
ICounterStoreService
updatePktOutFMCounterStoreLocal
in interface ICounterStoreService
public void updateFlush()
ICounterStoreService
updateFlush
in interface ICounterStoreService
public ICounter createCounter(java.lang.String key, CounterValue.CounterType type)
ICounterStoreService
createCounter
in interface ICounterStoreService
public ICounter getCounter(java.lang.String key)
ICounterStoreService
getCounter
in interface ICounterStoreService
public java.util.Map<java.lang.String,ICounter> getAll()
ICounterStoreService
getAll
in interface ICounterStoreService
public java.util.List<java.lang.String> getAllCategories(java.lang.String counterName, CounterStore.NetworkLayer layer)
ICounterStoreService
getAllCategories
in interface ICounterStoreService
public static java.lang.String createCounterName(java.lang.String switchID, int portID, java.lang.String counterName)
protected CounterStore.CounterKeyTuple getCountersKey(IOFSwitch sw, OFMessage m, Ethernet eth)
protected java.util.List<ICounter> createPacketInCounters(IOFSwitch sw, OFMessage m, Ethernet eth)
protected java.util.List<ICounter> getPktOutFMCounters(IOFSwitch sw, OFMessage m)
protected static java.lang.String createCounterName(java.lang.String switchID, int portID, java.lang.String counterName, java.lang.String subCategory, CounterStore.NetworkLayer layer)
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
IFloodlightModule
getModuleServices
in interface IFloodlightModule
public java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
IFloodlightModule
getServiceImpls
in interface IFloodlightModule
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
IFloodlightModule
getModuleDependencies
in interface IFloodlightModule
public void init(FloodlightModuleContext context) throws FloodlightModuleException
IFloodlightModule
init
in interface IFloodlightModule
FloodlightModuleException
public void startUp(FloodlightModuleContext context)
IFloodlightModule
startUp
in interface IFloodlightModule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |