Package com.streambase.sb.monitor
Class Snapshot
java.lang.Object
com.streambase.sb.monitor.Snapshot
Stores a snapshot of information from a StreamBase application.
Snapshot objects are created by the StreamBaseMonitor class, and consumed
by MonitorListeners. New snapshots are produced at regular intervals,
depending on the period specified in the StreamBase Server's conf file.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
Result source(package private) static enum
Read result status -
Field Summary
Modifier and TypeFieldDescription(package private) static final long
Reference ticks per microsecond - 1000L(package private) static final long
Reference ticks per millisecond - 1000000L -
Constructor Summary
ConstructorDescriptionSnapshot
(StreamBaseMonitor sbmon, boolean enableOperatorDetails) Constructor -
Method Summary
Modifier and TypeMethodDescription(package private) void
Clear begin flagReturn a list of the names of the current containersReturns an iterator over all the DecisionTableInfo objects.Returns the set of all decision table names.Get containers(package private) int
getCycle()
Returns the cycle number of this snapshot.getDecisionTableInfo
(String name) Returns information about the specified decision table.(package private) Map<String,
DecisionTableInfo> Get decision table information(package private) final String
getModName
(String name) Given a queue name, retrieve the module name.getModuleInfo
(String name) Returns information about the specified module.(package private) Map<String,
ModuleInfo> Get module informationgetOperatorInfo
(String name) Returns information about the specified operator.getOperatorType
(StreamBaseClient sbClient, String name) Get operator type(package private) Map<String,
OperatorInfo> Get operator information(package private) Timestamp
Get previous timestamp valueGet resultsgetStreamInfo
(String name) Returns information about the specified stream.(package private) Map<String,
StreamInfo> Get stream informationThe SystemInfo object for this snapshot.getThreadInfo
(String name) Returns information about the specified thread.(package private) Map<String,
ThreadInfo> Get thread informationReturn the time when this snapshot was taken.(package private) boolean
Have begin snapshot?(package private) boolean
isDone
(Snapshot.Source source) Is result processing complete?Returns an iterator over all the ModuleInfo objects.Returns the set of all thread names.Returns an iterator over all the OperatorInfo objects.Returns the set of all operator names.void
Shortcut for prettyPrint(true, true, true, false).(package private) Snapshot.Status
readNextMonitorSnap
(StreamBaseClient sbClient, Snapshot.Source source) Read the next monitor snapshot, return Status if we are done or not(package private) void
recycle()
Recycle snapshotprotected void
reset()
Reset snapshot(package private) void
setCycle
(int cycle) Set cycle value(package private) void
setTimestamp
(Timestamp timestamp) Set timestamp of snapshot(package private) void
start()
Start snapshot processing (set begin flag)Returns an iterator over all the StreamInfo objects.Returns the set of all stream names.void
Ask the StreamBaseMonitor to terminate at the end of the current snapshot.Returns an iterator over all the ThreadInfo objects.Returns the set of all thread names.toString()
-
Field Details
-
TICKS_PER_MILLISECOND
static final long TICKS_PER_MILLISECONDReference ticks per millisecond - 1000000L- See Also:
-
TICKS_PER_MICROSECOND
static final long TICKS_PER_MICROSECONDReference ticks per microsecond - 1000L- See Also:
-
-
Constructor Details
-
Snapshot
Snapshot(StreamBaseMonitor sbmon, boolean enableOperatorDetails) Constructor- Parameters:
sbmon
- monitorenableOperatorDetails
- true to enable operator statistics
-
-
Method Details
-
getContainers
Get containers- Returns:
- containers
-
getOpInfos
Map<String,OperatorInfo> getOpInfos()Get operator information- Returns:
- operation information
-
getThreadInfos
Map<String,ThreadInfo> getThreadInfos()Get thread information- Returns:
- thread information
-
getModuleInfos
Map<String,ModuleInfo> getModuleInfos()Get module information- Returns:
- module information
-
getStreamInfos
Map<String,StreamInfo> getStreamInfos()Get stream information- Returns:
- stream information
-
getDecisionTableInfos
Map<String,DecisionTableInfo> getDecisionTableInfos()Get decision table information- Returns:
- decision table information
-
setTimestamp
Set timestamp of snapshot- Parameters:
timestamp
- timestamp
-
getPreviousTimestamp
Timestamp getPreviousTimestamp()Get previous timestamp value- Returns:
- previous timestamp
-
start
void start()Start snapshot processing (set begin flag) -
haveBegin
boolean haveBegin()Have begin snapshot?- Returns:
- true if begin snapshot received
-
clearBegin
void clearBegin()Clear begin flag -
readNextMonitorSnap
Read the next monitor snapshot, return Status if we are done or not- Parameters:
sbClient
- clientsource
- result source- Returns:
- status if we are done or not
-
getResults
Get results- Returns:
- results
-
isDone
Is result processing complete?- Parameters:
source
- result source- Returns:
- true if done
- Throws:
StreamBaseException
- error detecting completion
-
terminate
public void terminate()Ask the StreamBaseMonitor to terminate at the end of the current snapshot.- See Also:
-
getModName
Given a queue name, retrieve the module name.- Parameters:
name
- queue name- Returns:
- module name
-
getOperatorType
Get operator type- Parameters:
sbClient
- clientname
- operator name- Returns:
- operator type
-
containerNames
Return a list of the names of the current containers- Returns:
- list of the names of the current containers
-
getSystemInfo
The SystemInfo object for this snapshot.- Returns:
- the SystemInfo object
-
getOperatorInfo
Returns information about the specified operator.- Parameters:
name
- the operator name- Returns:
- the requested OperatorInfo object
-
getDecisionTableInfo
Returns information about the specified decision table.- Parameters:
name
- the decision table name- Returns:
- the requested DecisionTableInfo object
-
getThreadInfo
Returns information about the specified thread.- Parameters:
name
- the thread name- Returns:
- the requested ThreadInfo object
-
getModuleInfo
Returns information about the specified module.- Parameters:
name
- the module name- Returns:
- the requested ModuleInfo object
-
getStreamInfo
Returns information about the specified stream.- Parameters:
name
- the stream name- Returns:
- the requested StreamInfo object
-
operatorInfos
Returns an iterator over all the OperatorInfo objects.- Returns:
- an Iterator of OperatorInfos
- See Also:
-
operatorNames
Returns the set of all operator names.- Returns:
- Set of operator names
- See Also:
-
decisionTableInfos
Returns an iterator over all the DecisionTableInfo objects.- Returns:
- an Iterator of DecisionTableInfo
- See Also:
-
decisionTableNames
Returns the set of all decision table names.- Returns:
- Set of decision table names
- See Also:
-
threadInfos
Returns an iterator over all the ThreadInfo objects.- Returns:
- an Iterator of ThreadInfos
- See Also:
-
threadNames
Returns the set of all thread names.- Returns:
- Set of thread names
- See Also:
-
moduleInfos
Returns an iterator over all the ModuleInfo objects.- Returns:
- an Iterator of ModuleInfo
- See Also:
-
moduleInfoStream
- Returns:
- The module info stream
-
moduleNames
Returns the set of all thread names.- Returns:
- Set of thread names
- See Also:
-
streamInfos
Returns an iterator over all the StreamInfo objects.- Returns:
- an Iterator of StreamInfo
- See Also:
-
streamNames
Returns the set of all stream names.- Returns:
- Set of stream names
- See Also:
-
getCycle
int getCycle()Returns the cycle number of this snapshot. All subsequent snapshots will have an increasing cycle number. This is a monotonically increasing integer generated by the StreamBase daemon.- Returns:
- snapshot cycle number
-
setCycle
void setCycle(int cycle) Set cycle value- Parameters:
cycle
- new value
-
getTimestamp
Return the time when this snapshot was taken. It is the timestamp of the first tuple of this snapshot.- Returns:
- timestamp of whhen this snapshot was taken
-
reset
protected void reset()Reset snapshot -
recycle
void recycle()Recycle snapshot -
toString
-
prettyPrint
public void prettyPrint()Shortcut for prettyPrint(true, true, true, false).- See Also:
-
prettyPrint(boolean,boolean,boolean,boolean)
-