diff --git a/analyze.py b/analyze.py index 3086067..44928e0 100644 --- a/analyze.py +++ b/analyze.py @@ -325,7 +325,10 @@ def binarySearch(distinctSamples, samples): # not return a row, so list entries must be made manually. errors = [0] * len(errorTypes) for index, count in db.span_error_count(fromTime, toTime): - errors[index] = count + try: + errors[index] = count + except IndexError as e: + print("could not track error with index", index, "and count", count, "in list", errors, "for error types", errorTypes) # RRDTool format string to explicitly specify the order of the data sources. # The first one is implicitly the time of the sample. @@ -375,7 +378,7 @@ def binarySearch(distinctSamples, samples): # Month: 3600 * 24 * 30 = 2592000 seconds # Week: 3600 * 24 * 7 = 604800 seconds # Period name, start. - for period in [('year', lastResult - 31536000), ('month', lastResult - 2592000), ('week', lastResult - 604800)]: + for period in [('decade', lastResult - 31536000 * 10), ('year', lastResult - 31536000), ('month', lastResult - 2592000), ('week', lastResult - 604800)]: # Width, height. for dimension in [(900, 300), (1200, 400)]: rrdtool.graph(args.outputDir + '/{0}_{1}x{2}_{3}'.format(period[0], dimension[0], dimension[1], args.sizeGraph), diff --git a/fnprobe/db.py b/fnprobe/db.py index 7e7aee4..ad56577 100644 --- a/fnprobe/db.py +++ b/fnprobe/db.py @@ -22,12 +22,13 @@ class probeTypes(Enum): # See the Error enum in src/freenet/node/probe/Error.java class errorTypes(Enum): - DISCONNECTED = 0 - OVERLOAD = 1 - TIMEOUT = 2 - UNKNOWN = 3 - UNRECOGNIZED_TYPE = 4 - CANNOT_FORWARD = 5 + DISCONNECTED=0 + OVERLOAD=1 + TIMEOUT=2 + UNKNOWN=3 + UNRECOGNIZED_TYPE=4 + CANNOT_FORWARD=5 + UNKNOWN=6 # Changes made to sequences are not transactional, no need to commit after.