U011 Logging and Tracing 6 - Creating statistics and charts
The output of this last article of the series Logging and Tracing shall be a nice chart with more or less important information. Before i will show you the Signal Table and its tabular statistics.
If you want to get an overview of your signals in terms of statistical information, the Signal Table is the first place to look for. It provides a tabular representation of signals. But instead of displaying the values, it gives you statistical data (e.g. First event, No of events).
The preference fields allow you to sort, filter and select or add columns. The selection of the input signal works similar to the Value Table. It's also possible to add your own statistical code to impulse to extract the values you want.
Impulse charts set up a new dimension of displaying signals and signal related informations. Charts can be extended and configured in many ways. You can define your own charts or integrated existing chart tools.
Steps to define a chart
Opening the preferences pages of impulse, you will find the Chart settings. This is the place were all charts are defined and configured. You can use the impulse preference wallet to exchange charts and other configurations with your colleagues. Here are the basic steps to get a chart displayed.
- Get to chart preferences and create/ configure a chart.
- Select a signal of a type that is compatible with the intended chart, or
- prepare a signal script to set-up the chart data
- Open the plot configuration editor (in the viewer) and select your chart.
The type of signal that is required for a chart depends on the chart type and configuration.
Getting the log count
In this example, i just want to show the number of logs per signals.
After adding a new plot configuration, set its production to Signal Script and add all log signals as Additional signals. Set Signal Type to Struct and Domain to Index. Also set the domain range from 0 to 0 (just one struct)
The script is shown below. It creates a struct and pre-sets the values with the count value of the input signals.
Finally set the Diagram type to Chart and select or create a new chart config (BIRT Bar).
// members var members = out.createMembers(4); out.createMember(members,0,"r2_top", ISample.STRUCT_TYPE_INTEGER,null,-1); out.createMember(members,1,"r4_top", ISample.STRUCT_TYPE_INTEGER,null,-1); out.createMember(members,2,"entry", ISample.STRUCT_TYPE_INTEGER,null,-1); out.createMember(members,3,"generics", ISample.STRUCT_TYPE_INTEGER,null,-1); // Series 1 members.setIntValue(in1.getCount()); members.setIntValue(in2.getCount()); members.setIntValue(in3.getCount()); members.setIntValue(in4.getCount()); out.write(0,false,members);
I hope that this series brought you some ideas and hints how to use impulse and how to increase visibility and transparency of your design target. Thanks !