Class FrameCollector
- java.lang.Object
-
- com.intergral.deep.agent.tracepoint.handler.VariableProcessor
-
- com.intergral.deep.agent.tracepoint.handler.FrameCollector
-
- Direct Known Subclasses:
FrameProcessor
public class FrameCollector extends VariableProcessor
This type allows the collection of frame data, ie stack frames, watchers and other tracepoint data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceFrameCollector.IExpressionResultThe result of evaluating an expression.protected static interfaceFrameCollector.IFrameResultThe result of processing the frames.protected static interfaceFrameCollector.ILogProcessResultThe result of processing the tracepoint log message.-
Nested classes/interfaces inherited from class com.intergral.deep.agent.tracepoint.handler.VariableProcessor
VariableProcessor.VariableResponse
-
-
Field Summary
Fields Modifier and Type Field Description protected IEvaluatorevaluatorThe evaluator that should be used by this callback.protected SettingssettingsThe current settings use my deep.protected Map<String,Object>variablesThe variables that have been captured by the callback.-
Fields inherited from class com.intergral.deep.agent.tracepoint.handler.VariableProcessor
frameConfig
-
-
Constructor Summary
Constructors Constructor Description FrameCollector(Settings settings, IEvaluator evaluator, Map<String,Object> variables, StackTraceElement[] stack, String methodName)Create a frame collector to collect the frame data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FrameCollector.IExpressionResultevaluateWatchExpression(String watch, String source)Evaluate a watch expression into aFrameCollector.IExpressionResult.protected StringgetMethodName(StackTraceElement stackTraceElement, Map<String,Object> variables, int frameIndex)Get the method name from the stack frame.protected booleanisAppFrame(StackTraceElement stackTraceElement)An app frame is defined via the settingsISettings.APP_FRAMES_INCLUDESandISettings.APP_FRAMES_EXCLUDES.protected voidlogTracepoint(String logMsg, String tracepointId, String snapshotId)protected ResourceprocessAttributes(TracePointConfig tracepoint)Using the current tracepoint config, create aResourcethe can be used as the attributes.protected FrameCollector.IFrameResultprocessFrame()Processes and collects all the data for the captured frame.protected FrameCollector.ILogProcessResultprocessLogMsg(TracePointConfig tracepoint, String logMsg)protected booleanprocessNode(Node node)This is where we take a node from BFS queue and process it back onto the queue.protected List<VariableID>processVars(Map<String,Object> variables)This is where we start the Breadth first search (BFS) of the selected variables.protected Map<String,Object>selectVariables(int frameIndex)Select from the available captured variables the variables we want to process for this frame.-
Methods inherited from class com.intergral.deep.agent.tracepoint.handler.VariableProcessor
appendChild, appendVariable, checkDepth, checkId, checkVarCount, closeLookup, configureSelf, newVarId, processChildNodes, processVariable
-
-
-
-
Field Detail
-
settings
protected final Settings settings
The current settings use my deep.
-
evaluator
protected final IEvaluator evaluator
The evaluator that should be used by this callback.
-
-
Constructor Detail
-
FrameCollector
public FrameCollector(Settings settings, IEvaluator evaluator, Map<String,Object> variables, StackTraceElement[] stack, String methodName)
Create a frame collector to collect the frame data.- Parameters:
settings- the current settings being used by deepevaluator- the evaluator to use for this callbackvariables- the variables captured by the callbackstack- the stack captured by the callbackmethodName- the name of the method we are wrapping, ornullif not a method wrapped collection
-
-
Method Detail
-
processFrame
protected FrameCollector.IFrameResult processFrame()
Processes and collects all the data for the captured frame.- Returns:
- the result of the process
FrameCollector.IFrameResult
-
selectVariables
protected Map<String,Object> selectVariables(int frameIndex)
Select from the available captured variables the variables we want to process for this frame. This is mainly here to allow for an easy way for CF to map the variables from their capture Java types to the expected CF types.- Parameters:
frameIndex- the index of the frame we are processing- Returns:
- the variables available at this frame
-
processVars
protected List<VariableID> processVars(Map<String,Object> variables)
This is where we start the Breadth first search (BFS) of the selected variables.Here we are essentially dealing with the BFS nodes and linking to the VariableProcessor to do the processing.
- Parameters:
variables- the variables to process- Returns:
- the variable ref used in the snapshot
- See Also:
VariableProcessor
-
processNode
protected boolean processNode(Node node)
This is where we take a node from BFS queue and process it back onto the queue.Essentially, we take a node, we process this node, the add the child nodes back onto the BFS queue.
- Parameters:
node- the node to process- Returns:
trueif we should continue to process more nodes, elsefalse.
-
isAppFrame
protected boolean isAppFrame(StackTraceElement stackTraceElement)
An app frame is defined via the settingsISettings.APP_FRAMES_INCLUDESandISettings.APP_FRAMES_EXCLUDES. This gives a way to tell deep that the frame is part of your app and not part of the framework. This is primarily used as a way to filter frames in the UI.- Parameters:
stackTraceElement- the stack frame to process- Returns:
trueif the class name is in the included packages, and not in the excluded packages, elsefalse.
-
getMethodName
protected String getMethodName(StackTraceElement stackTraceElement, Map<String,Object> variables, int frameIndex)
Get the method name from the stack frame.- Parameters:
stackTraceElement- the stack frame to processvariables- the variables for the frameframeIndex- the frame index- Returns:
- the name of the method
-
evaluateWatchExpression
protected FrameCollector.IExpressionResult evaluateWatchExpression(String watch, String source)
Evaluate a watch expression into aFrameCollector.IExpressionResult.We always need a result from a watch expression, however, it is possible to have bad watches that error. In some cases it is possible to not have a valid evaluator.
So if we cannot get a result from the
IEvaluatorthen we return an error result.- Parameters:
watch- the watch expression to evaluatesource- the source of the watch expression- Returns:
- a
FrameCollector.IExpressionResult - See Also:
WatchResult.LOG,WatchResult.METRIC,WatchResult.WATCH
-
processAttributes
protected Resource processAttributes(TracePointConfig tracepoint)
Using the current tracepoint config, create aResourcethe can be used as the attributes.The basic attributes created are:
- tracepoint - the id of the tracepoint
- path - the path of the tracepoint
- line - the line of the tracepoint
- stack - the stack type of the tracepoint
- frame - the frame type of the tracepoint
- has_watchers - boolean indicating there are watchers
- has_condition - boolean indicating there is a condition
- Parameters:
tracepoint- the current config- Returns:
- the new
Resource
-
processLogMsg
protected FrameCollector.ILogProcessResult processLogMsg(TracePointConfig tracepoint, String logMsg)
-
-