-
Notifications
You must be signed in to change notification settings - Fork 50
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
lndmon: cache closedChannels response #104
Conversation
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.
We should also cache ListSweeps
as well (see other items in that issue too).
d52b3b7
to
7c5b272
Compare
Squashed && force pushed @bhandras |
7c5b272
to
33fe8a3
Compare
Amended && force pushed @bhandras |
33fe8a3
to
47a7fc5
Compare
Fixed quitChan setting @bhandras |
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, thanks @djkazic 🎉
47a7fc5
to
7ec821a
Compare
Addressed nits @bhandras |
Deploying to testnet today. |
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.
Nice optimization! Code level nits only.
collectors/channels_collector.go
Outdated
|
||
// Start a ticker to update the cache once per 10m | ||
go func() { | ||
ticker := time.NewTicker(10 * time.Minute) |
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.
Should we make this a package-level variable just so "magic numbers" are easier to find and change?
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 10 minute magic number is still here in the latest push.
7ec821a
to
48670c8
Compare
Addressed nits @guggero |
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.
Almost there.
collectors/channels_collector.go
Outdated
|
||
// Start a ticker to update the cache once per 10m | ||
go func() { | ||
ticker := time.NewTicker(10 * time.Minute) |
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 10 minute magic number is still here in the latest push.
48670c8
to
0a31bae
Compare
Did another pass @guggero |
0a31bae
to
c8e69f9
Compare
c8e69f9
to
662470e
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.
Nice, LGTM 🎉
May also want to also cache |
…d-grpc-responses lndmon: cache closedChannels response
Currently we call closedChannels once per scrape, this can be fairly expensive for LND's grpcServer. This PR will add:
closedChannels
closedChannels
GRPC endpoint