This commit adds revenue based close recommendations which use the
fees a channel has generated, scaled by the number of confirmations
it has to compare channels. We do not have opening timestamps for
channels at present, so we cannot compare channels over a time range
(because we do not know whether the channel was open or not).
A metric enum is used to identify the datapoint that we wish to use.
In this commit, the rpc server is set to default to uptime calculations
so that the rpc/cli changes can be made in a separate commit.
This commit separates uptime based and threshold based recommendations
into two separate calls. This decreases the matrix of possible values
that users have to specify as we introduce more datasets that close
decisions can be made based
This change passes in lower outlier and below threshold values to allow
for more flexible recommendations; future metrics used may want to
recommend channels with upper values for close (eg recommend high peer
flap rate).
Channel insights calcualte the values required for recommendations,
pass insights in rather than raw rpc channels so that we do not need
to calcualte values (uptime, revenue etc) in the recommend package and
can focus on producing recommendations.
Earlier commits in this repo were made with 4 spaces in a tab instead
of 8. This commit updates relevant files to wrap at 80 chars with this
line spacing.
Internally catch error that is thrown when we have too few
values to calcualte outliers and simply return an all false
map rather than exposing the error to calling functions. If
there are too few values to calculate outliers, then no values
are outliers so a false map is appropriate.
This commit adds a Recommendation stuct which provides the value that
a close recommendation was based on and the close recommendation
boolean. It also adds channels with false recommendations to the
report (rather than only containing the channels recommended for close).
The value is added to provide users more
information about how the recommendation
was reached, and providing the false
recommendations provides better insight
into which channels were and were eligible
for a close recommendation but did not
meet the close criteria.
This commit updates outlier close recommendation logic to allow user
specified outlier multipliers. This change is made to allow more
flexibility when the grpc server is introduced.