Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing error types and adding decade as timeframe #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
Expand Down
13 changes: 7 additions & 6 deletions fnprobe/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down