feat(ui): Smooth efficiency average display using Exponential Moving Average (EMA)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in main/http_server/axe-os/src/app/components/home/home.component.ts, at the efficiencyAverage update and the existing calculateEfficiency calls. Trace how telemetry updates reach this component, then verify in the web interface that the displayed average uses the one-hour hashrate and remains stable while power readings fluctuate.
Written by the indexing model from the issue text.
Description
Markdown
Problem
The efficiencyAverage in the web interface currently calculates the 1-minute average (or 1-hour average when modified) by dividing the live power consumption (info.power) by the hashrate. Because info.power is updated and telemetry is fetched every second, the displayed efficiency value fluctuates rapidly by ~0.15 J/TH or more due to minor real-time power draw spikes. This causes unnecessary visual flickering in the UI for a value labeled as an "average".
Solution
This introduces a frontend-side Exponential Moving Average (EMA) filter to smooth out the real-time power fluctuations for the efficiencyAverage display.
- Added
smoothedEfficiencyAveragetohome.component.tsto persist the filtered state. - Applied a 99% historical / 1% new value split
(old * 0.99) + (new * 0.01)to damp out the per-second noise. - Changed the backend data source for the average from
hashRate_1mtohashRate_1hto provide a true, rock-solid long-term efficiency metric.
Result
The efficiency average indicator is now visually stable and reflects the true hardware performance without nervous second-by-second jumping, while still accurately adapting to frequency or voltage changes over a few minutes.
diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts
index b5314a74..7a5d4cdf 100644
--- a/main/http_server/axe-os/src/app/components/home/home.component.ts
+++ b/main/http_server/axe-os/src/app/components/home/home.component.ts
@@ -175,6 +175,7 @@ export class HomeComponent implements OnInit, OnDestroy {
public asicDomainsAmount: number = 0;
public efficiency: number = 0;
public efficiencyAverage: number = 0;
+ public smoothedEfficiencyAverage: number = 0;
public expectedEfficiency: number = 0;
public activePoolUserAddressPart: string = '';
public activePoolUserSuffixPart: string = '';
@@ -871,12 +872,24 @@ export class HomeComponent implements OnInit, OnDestroy {
this.efficiency = this.calculateEfficiency(info, 'hashRate');
- // MANUELLE BERECHNUNG FÜR DEN STUNDEN-DURCHSCHNITT:
+ // BERECHNUNG MIT GEGLÄTTETEM FILTER (DÄMPFUNG)
if (info && info.power > 0 && info.hashRate_1h > 0) {
- // Leistung (W) geteilt durch Hashrate (GH/s umgerechnet in TH/s -> durch 1000)
- this.efficiencyAverage = (info.power * 1000) / info.hashRate_1h;
+ const currentRawAvg = (info.power * 1000) / info.hashRate_1h;
+
+ // Wenn der Wert zum ersten Mal berechnet wird, nimm den aktuellen Wert
+ if (this.smoothedEfficiencyAverage === 0) {
+ this.smoothedEfficiencyAverage = currentRawAvg;
+ } else {
+ // FILTER: 99% alter Wert + 1% neuer Wert.
+ this.smoothedEfficiencyAverage = (this.smoothedEfficiencyAverage * 0.99) + (currentRawAvg * 0.01);
+ }
+
+ // Weise den geglätteten Wert der Anzeige zu
+ this.efficiencyAverage = this.smoothedEfficiencyAverage;
} else {
this.efficiencyAverage = 0;
+ this.smoothedEfficiencyAverage = 0;
}
this.expectedEfficiency = this.calculateEfficiency(info, 'expectedHashrate');```
- Dominant language
- C
- Stars
- 957
- Forks
- 423
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 19
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bitaxeorg/ESP-Miner
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
All issues in bitaxeorg/ESP-Miner
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·