|
Execution Pattern View · Reference Pattern View |
Multidimensional analysis using slices
You may use the Table view in conjunction with slices to compute and compare measurements of your run along two dimensions at the same time. The rows of the table may be any level of detail: threads, packages, classes, methods, method invocations, or objects. Each column may show a measurement of execution activity or memory computed relative to a particular slice. From the Columns menu, select Choose Attributes... to choose the attributes to display, and Choose Slices... to determine which slices are displayed for each attribute.
The following example from a transaction processing application illustrates how you may use this feature to study functional areas of your program at various levels of detail. We have created a slice for each of the five types of transaction in our application. In the first example below, we have created a view to help us understand why so many strings are being created. The view shows the number of calls to each String constructor, broken down by transaction type. By comparing columns, we can see the two transaction types (NewOrder and Payment) that are creating the most strings. We can also sort by a single column to see where the most activity is within a single slice. In this case we sorted by the column that shows total activity for the workspace base slice, and we can see that most strings are created from character arrays.
Calls to String constructors broken down by transaction type
We can also show numbers as percentages to more easily compare slices. In the next view we show the percentage of time each thread spends on each type of transaction. From the Columns menu, we selected Display Percentage of Base. The percentages are relative to the time in the workspace base slice (shown in the first numeric column on the left).
Time in each thread spent on each type of transaction
Coloring rows by slice
You may color each row of a Table view based on the slice that element is in. From the Columns menu select Color by Slice. This is useful for seeing correlations between an attribute in the table and some other aspect of your run that you have identified.
In the example below taken from a transaction processing application, we have created a slice for each type of transaction. To analyze the execution of database queries from this perspective, we have opened a Table view of invocations of the executeQuery() method. We have shown time as bars, sorted by time, compressed the rows, and then colored the rows by slice. This allows us to easily see which type of transaction is responsible for the slowest queries.
Invocations of executeQuery() colored by transaction type. (Inset: Using the Table view of slices as a legend.)
Note that if an element is a member of more than one slice, then by default it will be colored by the most recently created slice of which it is a member. There is also an option to blend the colors of the slices instead (from the workspace window, select File -> Blend Colors when Slices Overlap).
Filtering rows with slices
You may use slices to limit the rows that are shown in the table. This is useful to make the amount of information you are working with more manageable. From the Rows menu select Display All <Classes/Methods/Invocations/etc.> in Slice and select a slice you have defined.
Effect of workspace base slice filtering
All measures displayed in the Table view take into account the workspace base slice filtering (and additional slice filtering for columns showing measures relative to a particular slice). All measurements in a Table view are refreshed whenever any slices in the workspace have changed, or new trace information has been loaded into the system.
The choice of rows shown in a Table view will not generally reflect the workspace base slice filtering. The only exception is when the user requests to display the current selection, in which case only those that are in the workspace base slice will be shown. The choice of rows shown is not automatically updated if the workspace base filtering criteria change.
Coloring by slice
You may color the execution view by slice, to highlight where various kinds of activity are occurring. From the Options menu select Color by Slice. The vertical bar and the horizontal line representing each method invocation will be colored based on the slice that invocation is in. By default, the method invocation will be colored in dark gray if it is in the workspace base slice but no other slice. Invocations completely outside of the workspace base slice filtering will be rendered in an almost invisible beige color.
If an invocation is a member of more than one slice, than it will be colored by the most recently created slice of which it is a member. If, however, you have selected the option Blend Colors when Slices Overlap (from the File menu in the workspace window) then the color of each invocation will be formed by blending the colors of every slice it is in. This is useful for seeing where functional areas you have defined overlap.
Effect of workspace base slice filtering
The Execution view renders any method invocations that are not in the workspace base slice in a very pale beige, so that they are almost invisible. (On some monitors they may actually be invisible.) Both the vertical bar and horizontal line are rendered as such depending upon the membership of the method invocation they represent.
The measures of time and number of calls shown in the flyover do not reflect the workspace base slice filtering.
If the user asks to display just the currently selected threads (either from the menu item or by drilling down to an execution view from another view), only those that are in the workspace base slice will be displayed. Other than that case, the workspace base slice filtering is not applied to the threads shown in the view.
Coloring by slice
You may color the elements shown in the Histogram view using slices. From the Object Appearance menu select Color by Slice. Each class name shown on the left will be colored based on the slice the class is in. Each object or method shown in the right pane will be colored based on the slice of which it is a member. Dark gray is the default color for classes and objects in the workspace but not in any slice. Classes completely outside of the workspace base slice filtering are rendered in an almost invisible beige color.
If a class, object, or method is a member of more than one slice, than it will be colored by the most recently created slice of which it is a member. If, however, you have selected the option Blend Colors when Slices Overlap (from the File menu in the workspace window) then the color will be formed by blending the colors of every slice it is in.
Filtering classes using slices
You may use slices to limit the classes shown in the Histogram view. This can be useful to reduce the amount of information in the view to a more manageable size. From the Classes menu, select Display all classes in slice and select a slice you have defined. Note that this will only determine the classes shown; the objects or methods shown for each class will be all those that are in the workspace base slice.
Effect of workspace base slice filtering
All measures shown in the Histogram views reflect the workspace base slice filtering. This is true of measures that are shown visually as colors or bars, as well as those shown as text during flyover. In the right pane, the individual objects or methods shown are only those that are in the workspace base slice. Lines showing a relationship between elements (e.g. showing which object calls another object), are filtered as well: only lines connecting elements that are both in the workspace base slice will be shown.
If the filtering criteria for the workspace base slice changes, all of the above will be updated to reflect the change.
The choice of which classes are shown in the left pane of the view will not generally reflect the workspace base slice filtering. The only exception is when the user requests to display the currently selected classes, in which case only those that are in the workspace base slice will be shown. The list of classes is not automatically updated if the workspace base filtering criteria change.
Grouping by slice
The Call Tree view allows you to group method invocations according to the slice they belong to. One case where this is useful is when you have a functional area that is implemented by a number of alternative methods that may be called, and you want to combine their activity together at each level of the call tree. From the Tree menu, select Group by slice to use this feature. Each node of the tree will be shown with the color of the slice.
If an invocation is in more than one slice, than it will be grouped according to the most recently created slice of which it is a member.
Effect of workspace base slice filtering
Only invocations which are in the workspace base slice are included in the Call Tree view. This is true of the starting set of invocations at the root, as well as all callers or callees shown. Therefore, all computations of time and number of calls take into account the workspace base slice filtering.
Note that if the workspace base slice filtering changes while a call tree is already open, the set of invocations at the root of the tree will remain the same. The entire tree and all computations will however be updated to reflect the change.
The Execution Pattern view currently has no features that specifically make use of slices.
Effect of workspace base slice filtering
The starting set of invocations chosen (based on the selection) will initially be filtered to take into account the workspace base slice filtering in effect. This is the only place in this view where this filtering is applied. All other invocations shown are not necessarily in the workspace base slice. The time measurements (shown in the flyover and rendered as the lengths of bars) follow this same rule, and do not take into account the workspace base slice filter.
The Reference Pattern view currently has no features that specifically make use of slices.
Effect of workspace base slice filtering
When you choose a starting set of objects, only objects that are in the workspace base slice will be included in the starting set. The starting set of objects is the only place in this view where the workspace base filtering is applied. Other objects shown in the view (those referring to or referred to by the starting set) are not necessarily in the workspace base slice.
|
|