Skip to content

Commit

Permalink
tmf: change statistics analysis to use long
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
  • Loading branch information
arfio committed Mar 1, 2024
1 parent 5d68fc5 commit c242fd0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Expand Up @@ -155,7 +155,7 @@ public void dispose() {
sortedIntervals.sort(Comparator.comparingLong(ITmfStateInterval::getStartTime));
long previousTotal;
if (fTotalsStats.getStartTime() != sortedIntervals.get(0).getStartTime()) {
previousTotal = sortedIntervals.get(0).getValueInt();
previousTotal = sortedIntervals.get(0).getValueLong();
} else {
previousTotal = 0;
}
Expand All @@ -164,9 +164,9 @@ public void dispose() {
while (j < sortedIntervals.size() - 1 && sortedIntervals.get(j).getEndTime() < times.get(i)) {
j++;
}
long count = sortedIntervals.get(j).getValueInt() - previousTotal;
long count = sortedIntervals.get(j).getValueLong() - previousTotal;
results.add(count);
previousTotal = sortedIntervals.get(j).getValueInt();
previousTotal = sortedIntervals.get(j).getValueLong();
}
return results;
} catch (StateSystemDisposedException e) {
Expand Down
Expand Up @@ -101,7 +101,7 @@ class StatsProviderEventTypes extends AbstractTmfStateProvider {
* Version number of this input handler. Please bump this if you modify the
* contents of the generated state history in some way.
*/
private static final int VERSION = 3;
private static final int VERSION = 4;

/**
* Constructor
Expand Down Expand Up @@ -139,12 +139,12 @@ protected void eventHandle(ITmfEvent event) {
ITmfLostEvent le = (ITmfLostEvent) event;
quark = ss.getQuarkAbsoluteAndAdd(Attributes.EVENT_TYPES, eventName);

int curVal = ss.queryOngoingState(quark).unboxInt();
long curVal = ss.queryOngoingState(quark).unboxLong();
if (curVal == -1) {
curVal = 0;
}

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

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

/* Number of events of each type, globally */
quark = ss.getQuarkAbsoluteAndAdd(Attributes.EVENT_TYPES, eventName);
StateSystemBuilderUtils.incrementAttributeInt(ss, ts, quark, 1);
StateSystemBuilderUtils.incrementAttributeLong(ss, ts, quark, 1);
}
}
}
Expand Up @@ -85,7 +85,7 @@ class StatsProviderTotals extends AbstractTmfStateProvider {
* Version number of this input handler. Please bump this if you modify the
* contents of the generated state history in some way.
*/
private static final int VERSION = 2;
private static final int VERSION = 3;

/**
* Constructor
Expand Down Expand Up @@ -122,7 +122,7 @@ protected void eventHandle(ITmfEvent event) {

/* Total number of events */
int quark = ss.getQuarkAbsoluteAndAdd(Attributes.TOTAL);
StateSystemBuilderUtils.incrementAttributeInt(ss, ts, quark, 1);
StateSystemBuilderUtils.incrementAttributeLong(ss, ts, quark, 1);
}
}

Expand Down

0 comments on commit c242fd0

Please sign in to comment.