Spike hunter throws an exception that prevents to scan all RRAs.

Description

When executing the JAR for a specific RRD and the value after removing all NaNs is 0 when procesing a specific RRA, an exception is thrown (no matter if the RRA contains or not a spike):

[root@opennms bin]# java -jar spike-hunter-1.8.13-jar-with-dependencies.jar -n -v -f mib2-interfaces.jrb -d ifOutOctets -o 95,5
Running in dry-run mode, no modifications will be made to the specified file
Operating on archive with CF AVERAGE, 1 steps
Operating on DS ifOutOctets
Before removing NaN values, 2016 values are in the set
After removing NaN values, 0 values are left
Rank of Nth percentile value (N=95) is 1
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.opennms.netmgt.util.spikehunter.PercentileDataAnalyzer.calculatePercentile(PercentileDataAnalyzer.java:61)
at org.opennms.netmgt.util.spikehunter.PercentileDataAnalyzer.findSamplesInViolation(PercentileDataAnalyzer.java:23)
at org.opennms.netmgt.util.spikehunter.SpikeHunter.replaceInDs(SpikeHunter.java:282)
at org.opennms.netmgt.util.spikehunter.SpikeHunter.replaceInArchive(SpikeHunter.java:267)
at org.opennms.netmgt.util.spikehunter.SpikeHunter.doReplacement(SpikeHunter.java:227)
at org.opennms.netmgt.util.spikehunter.SpikeHunter.main(SpikeHunter.java:82)

This is related with the ticket 881 from customer support.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Alejandro Galue December 8, 2011 at 2:08 PM

I added a validation in order to continue processing the remaining RRAs, when a specific RRA returns 0 after removing all NaNs.

Now it works as expected, and the spike on the second RRA has been detected and removed.

Fixed on revision c527909a334168d0074f0d7a334f1ed743f6ea19 for 1.10
Fixed on revision c90159822f5cb70e45ea45a0a7b30a47da7616dd for 1.8

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

PagerDuty

Created December 8, 2011 at 1:57 PM
Updated January 27, 2017 at 4:20 PM
Resolved December 8, 2011 at 2:08 PM