-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstatisticsDensityXY.js
44 lines (38 loc) · 1.55 KB
/
statisticsDensityXY.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*******************************************************************************
* Copyright (c) 2019 Geneviève Bastien
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* statisticsDensityXY.js
*******************************************************************************/
loadModule("/TraceCompass/Trace");
loadModule('/TraceCompass/Analysis');
loadModule('/TraceCompass/DataProvider');
loadModule('/TraceCompass/View');
// Get the currently active trace
var trace = getActiveTrace();
if (trace == null) {
print("Trace is null");
exit();
}
// Get the Statistics module (by name) for that trace
var analysis = getTraceAnalysis(trace, 'Statistics');
if (analysis == null) {
print("Statistics analysis not found");
exit();
}
// Prepare the parameters for the data provider:
// * path in the state system of the events we want to display (here, all events starting with sched)
// * Whether to show the absolute value (we would see an incremental line) or the delta from the previous value
// Create a map and fill it, because javascript map cannot use the EASE constants as keys
var map = new java.util.HashMap();
map.put(ENTRY_PATH, 'event_types/sched*');
map.put(ENTRY_DELTA, true);
// create a XY data provider
var provider = createXYProvider(analysis, map);
// Open an XY chart with this data provider
if (provider != null) {
openXYChartView(provider);
}