sadasd
This commit is contained in:
@@ -75,16 +75,13 @@ final class AnalyticsService
|
|||||||
|
|
||||||
if (is_array($previous) && $previousMeasuredTs !== null) {
|
if (is_array($previous) && $previousMeasuredTs !== null) {
|
||||||
$intervalStartTs = $previousMeasuredTs;
|
$intervalStartTs = $previousMeasuredTs;
|
||||||
$intervalStartCoins = (float) ($previousVisibleCoins ?? ($previous['coins_total'] ?? 0.0));
|
$intervalStartCoins = (float) ($previous['coins_total_effective'] ?? $previous['coins_total'] ?? 0.0);
|
||||||
if ($previousCoinCurrency !== null && $previousCoinCurrency === $coinCurrency) {
|
if ($previousCoinCurrency !== null && $previousCoinCurrency !== $coinCurrency) {
|
||||||
$intervalPayouts = max(0.0, $cumulativePayouts - (float) ($previousCumulativePayouts ?? 0.0));
|
$intervalStartCoins = $effectiveCoinsTotal;
|
||||||
$intervalStartCoins = max(0.0, $intervalStartCoins - $intervalPayouts);
|
|
||||||
} elseif ($previousCoinCurrency !== null && $previousCoinCurrency !== $coinCurrency) {
|
|
||||||
$intervalStartCoins = $visibleCoinsTotal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$intervalHours = max(0.0, ($measuredTs - $intervalStartTs) / 3600);
|
$intervalHours = max(0.0, ($measuredTs - $intervalStartTs) / 3600);
|
||||||
$intervalGrowth = $visibleCoinsTotal - $intervalStartCoins;
|
$intervalGrowth = $effectiveCoinsTotal - $intervalStartCoins;
|
||||||
$perHourInterval = $intervalHours > 0 ? $intervalGrowth / $intervalHours : null;
|
$perHourInterval = $intervalHours > 0 ? $intervalGrowth / $intervalHours : null;
|
||||||
$perDayInterval = $perHourInterval !== null ? $perHourInterval * 24 : null;
|
$perDayInterval = $perHourInterval !== null ? $perHourInterval * 24 : null;
|
||||||
if ($perHourInterval !== null && $activeHashrateMh > 0) {
|
if ($perHourInterval !== null && $activeHashrateMh > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user