Skip to content

Commit c242fd0

Browse files
committed
tmf: change statistics analysis to use long
Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
1 parent 5d68fc5 commit c242fd0

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statistics/TmfStateStatistics.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void dispose() {
155155
sortedIntervals.sort(Comparator.comparingLong(ITmfStateInterval::getStartTime));
156156
long previousTotal;
157157
if (fTotalsStats.getStartTime() != sortedIntervals.get(0).getStartTime()) {
158-
previousTotal = sortedIntervals.get(0).getValueInt();
158+
previousTotal = sortedIntervals.get(0).getValueLong();
159159
} else {
160160
previousTotal = 0;
161161
}
@@ -164,9 +164,9 @@ public void dispose() {
164164
while (j < sortedIntervals.size() - 1 && sortedIntervals.get(j).getEndTime() < times.get(i)) {
165165
j++;
166166
}
167-
long count = sortedIntervals.get(j).getValueInt() - previousTotal;
167+
long count = sortedIntervals.get(j).getValueLong() - previousTotal;
168168
results.add(count);
169-
previousTotal = sortedIntervals.get(j).getValueInt();
169+
previousTotal = sortedIntervals.get(j).getValueLong();
170170
}
171171
return results;
172172
} catch (StateSystemDisposedException e) {

tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statistics/TmfStatisticsEventTypesModule.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class StatsProviderEventTypes extends AbstractTmfStateProvider {
101101
* Version number of this input handler. Please bump this if you modify the
102102
* contents of the generated state history in some way.
103103
*/
104-
private static final int VERSION = 3;
104+
private static final int VERSION = 4;
105105

106106
/**
107107
* Constructor
@@ -139,12 +139,12 @@ protected void eventHandle(ITmfEvent event) {
139139
ITmfLostEvent le = (ITmfLostEvent) event;
140140
quark = ss.getQuarkAbsoluteAndAdd(Attributes.EVENT_TYPES, eventName);
141141

142-
int curVal = ss.queryOngoingState(quark).unboxInt();
142+
long curVal = ss.queryOngoingState(quark).unboxLong();
143143
if (curVal == -1) {
144144
curVal = 0;
145145
}
146146

147-
ss.modifyAttribute(ts, (int) (curVal + le.getNbLostEvents()), quark);
147+
ss.modifyAttribute(ts, curVal + le.getNbLostEvents(), quark);
148148

149149
long lostEventsStartTime = le.getTimeRange().getStartTime().toNanos();
150150
long lostEventsEndTime = le.getTimeRange().getEndTime().toNanos();
@@ -160,7 +160,7 @@ protected void eventHandle(ITmfEvent event) {
160160

161161
/* Number of events of each type, globally */
162162
quark = ss.getQuarkAbsoluteAndAdd(Attributes.EVENT_TYPES, eventName);
163-
StateSystemBuilderUtils.incrementAttributeInt(ss, ts, quark, 1);
163+
StateSystemBuilderUtils.incrementAttributeLong(ss, ts, quark, 1);
164164
}
165165
}
166166
}

tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statistics/TmfStatisticsTotalsModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class StatsProviderTotals extends AbstractTmfStateProvider {
8585
* Version number of this input handler. Please bump this if you modify the
8686
* contents of the generated state history in some way.
8787
*/
88-
private static final int VERSION = 2;
88+
private static final int VERSION = 3;
8989

9090
/**
9191
* Constructor
@@ -122,7 +122,7 @@ protected void eventHandle(ITmfEvent event) {
122122

123123
/* Total number of events */
124124
int quark = ss.getQuarkAbsoluteAndAdd(Attributes.TOTAL);
125-
StateSystemBuilderUtils.incrementAttributeInt(ss, ts, quark, 1);
125+
StateSystemBuilderUtils.incrementAttributeLong(ss, ts, quark, 1);
126126
}
127127
}
128128

0 commit comments

Comments
 (0)