User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
Hi Basavaraj,
The view you obtain is correct for the script you run. You seem
to have taken as is the statisticsDensityXY.js script [1] example
which takes the Statistics module which just counts the event
types. If you want your own data to be displayed in the view, you
need to create your own state system with the data in it. Look at
the basicAnalysis.js example [2] instead. It shows how to create
your own analysis from your trace's data.
I was curious to see if it all worked with custom parsers, so I
tried with your trace. At the end of this email is a script that
works with your trace. You can fine-tune it to your need.
// Create an analysis named activetid.js.
var analysis = getAnalysis("myanalysis.js");
if (analysis == null) {
print("Trace is null");
exit();
}
// Get the analysis's state system so we can fill it, false
indicates to create a new state system even if one already exists,
true would re-use an existing state system
var ss = analysis.getStateSystem(false);
// The analysis itself is in this function
function runAnalysis() {
// Get the event iterator for the trace
var iter = analysis.getEventIterator();
var event = null;
// Parse all events
while (iter.hasNext()) {
}
// Done parsing the events, close the state system at the time
of the last event, it needs to be done manually otherwise the
state system will still be waiting for values and will not be
considered finished building
if (event != null) {
ss.closeHistory(event.getTimestamp().toNanos());
}
}
// This condition verifies if the state system is completed. For
instance, if it had been built in a previous run of the script, it
wouldn't run again.
if (!ss.waitUntilBuilt(0)) {
// State system not built, run the analysis
runAnalysis();
}
var map = new java.util.HashMap();
map.put(ENTRY_PATH, '*');
map.put(ENTRY_DELTA, false);
provider = createXYProvider(analysis, map);
if (provider != null) {
openXYChartView(provider);
}
On 11/18/19 2:47 AM, Basavaraj Munnoli
wrote:
Hi
Geneviève,
I have attached the script (Script.txt) and trace (Sample
Trace.txt) files and also a screenshot of the XY chart
(trace_XY_chart.PNG) that I am getting. As you can see in
the screenshot, the Y axis is taking the quark values. How
can I make it take the cpu_load values instead? (The third
column in the trace file represents the cpu loads.)
I have also attached the custom parser that I have used
(sample_trace_custom_parser.xml).
It's hard to answer your question without seeing what
you did, maybe you could share a screenshot or the
script? In any case, make sure the content of the state
system that you are trying to display is OK.
Look at task 6, that shows how to view what's inside
your state system before building a data provider. The
next task creates a time graph data provider, which
could as well be an XY data provider.
HTH,
Geneviève
On 11/15/19 2:22 AM, Basavaraj Munnoli wrote:
Hello community,
I have a simple trace that has some event types
along with their cpu loads (in percentages) and
timestamps. I want to plot a simple line graph
(timpestamp vs cpu load in %) for each event type. I
have followed the example scripts and by using
createXYProvider(analysis, map) and
openXYChartView(provider) functions I have been able
to get a line graph for each event type, with time
stamp on the X axis. However, the Y axis displays
quark values. I am not getting how to make my Y axis
use the cpu load values instead of quark values.
Need support in this regard.