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
feat: summary peer availability tracing #127
feat: summary peer availability tracing #127
Conversation
Codecov Report
@@ Coverage Diff @@
## master #127 +/- ##
==========================================
+ Coverage 57.32% 57.87% +0.54%
==========================================
Files 22 23 +1
Lines 2580 2611 +31
==========================================
+ Hits 1479 1511 +32
+ Misses 1101 1100 -1
Continue to review full report at Codecov.
|
41ebcf7
to
fd2fd0e
Compare
a651d48
to
5ae24d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. codecov is complaining that the total test coverage has gone a bit :)
5ae24d7
to
ac3124f
Compare
I think I can also rearrange code to make the calculation tetstable so codecov is more happy with me |
5add9c5
to
dae4835
Compare
Okay, I fixed the code coverage, even though it was just related to seemingly not profiling unittest thread itself. @cdecker : maybe we can reconfigure codecov also tracing the actual unittest threads instead of only the plugin threads within the daemon? |
summary/summary.py
Outdated
plugin.add_option( | ||
'summary-availability-interval', | ||
300, | ||
'How often in seconds the availability should be calculated. Causes RPC and CPU.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of Causes RPC and CPU
isn't totally clear to me. May be clearer as "uses" or "causes usage"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your okay, I simply removed that silly addition. I thought it would be useful to tell the user that this is just local RPC and doesn't consume much resources or network stuff. But it doesn't add anything particular interesting.
Solved, rebased an force-pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
efa191d
to
2a0d272
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent addition, I look forward to knowing which peers of mine are lazy and should be disconnected :-)
I went through with a fine-toothed comb, and added a couple of nits, nothing serious, so feel free to ignore them, just thought that since I'm this later to review I should at least put in that much effort.
ACK 2a0d272
@@ -2,7 +2,7 @@ | |||
from pyln.client import Plugin, Millisatoshi | |||
from packaging import version | |||
from collections import namedtuple | |||
from datetime import datetime | |||
from summary_avail import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're concerned that the path might not be unique you can explicitly import a local module by using the following:
from .availability import *
This saves you from having to prefix everything. Alternatively you could also have the executable in the top-level and create a summary
package containing all the sub-modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wont do, since plugin API or autoreload plugin gets me this:
from .availability import *
ImportError: attempted relative import with no known parent package
Regarding codecov, I'm really tempted to just remove it. It hasn't produced anything actionable, and has been outright misleading in some cases (some plugins flip-flopping despite not being touched...) It might just be our setup, with tests running as unit-tests and also collecting coverage when run as plugins. |
1. bitcoinaverage does not supply public prices since a while now: > Unauthenticated requests are not allowed. Take out a new plan or start > a free trial at https://pro.bitcoinaverage.com" This commit fixes this by porting to bitstamp public ticker API. 2. This commit fixes the missing thread loop, so the price is actually updated after a while. 3. This commit fixes an unchecked attribute access that crashed during my tests.
this applies a 72hr exponential smoothed sliding window to the online/offline availability state of a peer.
using level error caused the testframework to fail on non-essential price or availability thread log messages. likely caused by the test runner not being able to query the bitstamp API.
extracts the availability calculations to own testable module
2a0d272
to
fab43a0
Compare
Adds:
Fixes: