From 4bebd101821075dc15b033e868b5b6f2828a67dc Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Wed, 28 Feb 2024 05:11:11 +0100 Subject: [PATCH] Partially implement #11 Cumulative Share Effort on calculator, added mean shares per day --- cmd/web/views/calculate-share-time.qtpl | 82 ++++++++++++++++++++++--- cmd/web/views/funcs.go | 3 +- cmd/web/web.go | 28 ++++++--- utils/statistics.go | 35 +++++++++++ 4 files changed, 130 insertions(+), 18 deletions(-) create mode 100644 utils/statistics.go diff --git a/cmd/web/views/calculate-share-time.qtpl b/cmd/web/views/calculate-share-time.qtpl index ffcf523..1275f23 100644 --- a/cmd/web/views/calculate-share-time.qtpl +++ b/cmd/web/views/calculate-share-time.qtpl @@ -1,3 +1,4 @@ +{% import "git.gammaspectra.live/P2Pool/p2pool-observer/utils" %} {% code type CalculateShareTimePage struct { // inherit from base page, so its' title is used in error page. @@ -7,6 +8,8 @@ type CalculateShareTimePage struct { Magnitude float64 Efforts []CalculateShareTimePageEffortEntry EstimatedRewardPerDay uint64 + EstimatedSharesPerDay float64 + EstimatedBlocksPerDay float64 } %} @@ -16,6 +19,7 @@ type CalculateShareTimePageEffortEntry struct { Probability float64 Between float64 BetweenSolo float64 + ShareProbabilities []float64 } %} @@ -25,6 +29,17 @@ type CalculateShareTimePageEffortEntry struct { {% func (p *CalculateShareTimePage) Content() %} + +