Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,10 @@ <h4 class="white-space-nowrap overflow-hidden text-overflow-ellipsis">Hashrate R
{{ i + 1 }}
</td>
<td *ngFor="let domain of asic.domains"
[style.background]="getHeatmapColor(info, normalizeHashrate(domain))"
[style.background]="getHeatmapColor(info, domain)"
[style.height]="(asicAmount <= 2 ? '2rem' : null)"
class="text-center">
<span class="text-xs">{{ normalizeHashrate(domain) | hashSuffix }}</span>
<span class="text-xs">{{ domain | hashSuffix }}</span>
</td>
</tr>
</tbody>
Expand Down
13 changes: 3 additions & 10 deletions main/http_server/axe-os/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ export class HomeComponent implements OnInit, OnDestroy {
}

stats.statistics.forEach(element => {
element[idxHashrate] = this.normalizeHashrate(element[idxHashrate]);
switch (chartLabelValue(chartY1DataLabel)) {
case eChartLabel.asicVoltage:
case eChartLabel.voltage:
Expand Down Expand Up @@ -364,8 +363,6 @@ export class HomeComponent implements OnInit, OnDestroy {
return this.systemService.getInfo()
}),
map(info => {
info.hashRate = this.normalizeHashrate(info.hashRate);
info.expectedHashrate = this.normalizeHashrate(info.expectedHashrate);
info.voltage = info.voltage / 1000;
info.current = info.current / 1000;
info.coreVoltageActual = info.coreVoltageActual / 1000;
Expand Down Expand Up @@ -556,7 +553,7 @@ export class HomeComponent implements OnInit, OnDestroy {
const efficiencies = hashrateData.map((hashrate, index) => {
const power = powerData[index] || 0;
if (hashrate > 0) {
return power / (hashrate / 1_000_000_000_000); // Convert to J/Th
return power / (hashrate / 1_000); // Convert to J/Th
} else {
return power; // in this case better than infinity or NaN
}
Expand Down Expand Up @@ -592,7 +589,7 @@ export class HomeComponent implements OnInit, OnDestroy {
if (info.power_fault || hashrate <= 0) {
return 0;
}
return info.power / (hashrate / 1_000_000_000_000);
return info.power / (hashrate / 1_000);
}

public getHashrateAverage(): number {
Expand Down Expand Up @@ -620,7 +617,7 @@ export class HomeComponent implements OnInit, OnDestroy {
}

public getDomainErrorPercentage(info: ISystemInfo, asic: { error: number }): number {
return asic.error ? (this.normalizeHashrate(asic.error) * 100 / info.expectedHashrate) : 0;
return asic.error ? (asic.error * 100 / info.expectedHashrate) : 0;
}

public getDomainErrorColor(info: ISystemInfo, asic: { error: number }): string {
Expand Down Expand Up @@ -657,10 +654,6 @@ export class HomeComponent implements OnInit, OnDestroy {
return `rgb(${finalR}, ${finalG}, ${finalB})`;
}

public normalizeHashrate(hashrate: number): number {
return hashrate * 1_000_000_000;
}

public clearDataPoints() {
this.dataLabel.length = 0;
this.hashrateData.length = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2>Swarm</h2>
<div class="grid">
<div class="col-6 xl:col-3" *ngFor="let metric of [
{ label: 'Total Devices', value: swarm.length },
{ label: 'Total Hashrate', value: totals.hashRate * 1000000000 | hashSuffix},
{ label: 'Total Hashrate', value: totals.hashRate | hashSuffix},
{ label: 'Total Power', value: (totals.power | number: '1.1-1') + ' W' },
{ label: 'Best Diff', value: totals.bestDiff | diffSuffix }
]">
Expand Down Expand Up @@ -150,7 +150,7 @@ <h2>Swarm</h2>
</div>
<div class="flex flex-column text-right white-space-nowrap cursor-pointer">
<span pTooltip="Hashrate" tooltipPosition="top">
{{axe.hashRate * 1000000000 | hashSuffix}}
{{axe.hashRate | hashSuffix}}
</span>
<div>
<span class="text-500 cursor-pointer mr-2" pTooltip="Shares Rejected" tooltipPosition="top">
Expand Down Expand Up @@ -237,7 +237,7 @@ <h2>Swarm</h2>
<i class="pi pi-star-fill text-xs"></i>
</span>
</td>
<td>{{axe.hashRate * 1000000000 | hashSuffix}}</td>
<td>{{axe.hashRate | hashSuffix}}</td>
<td>
<p class="cursor-pointer m-0" pTooltip="Shares Accepted" tooltipPosition="top">
{{axe.sharesAccepted | number: '1.0-0'}}
Expand Down
3 changes: 3 additions & 0 deletions main/http_server/axe-os/src/app/pipes/hash-suffix.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export class HashSuffixPipe implements PipeTransform {
return '0 H/s';
}

// Normalize GH/s to H/s
value = value * 1_000_000_000;

const suffixes = [' H/s', ' Kh/s', ' Mh/s', ' Gh/s', ' Th/s', ' Ph/s', ' Eh/s'];

let power = Math.floor(Math.log10(value) / 3);
Expand Down
Loading