mirror of
https://github.com/Retropex/custom-ocean.xyz-dashboard.git
synced 2025-05-12 19:20:45 +02:00
Remove acceptance rate tracking from mining services
This commit removes the `avg_acceptance_rate` and `acceptance_rate` fields from both the `MiningDashboardService` and `WorkerService` classes. The changes simplify the data structures and calculations related to worker data, as acceptance rates are no longer tracked or displayed in the mining dashboard. This includes the removal of default values and random generation of acceptance rates for workers.
This commit is contained in:
parent
9a9f9ae178
commit
3bb74c37e7
@ -639,7 +639,6 @@ class MiningDashboardService:
|
|||||||
# Find total worker counts
|
# Find total worker counts
|
||||||
workers_online = 0
|
workers_online = 0
|
||||||
workers_offline = 0
|
workers_offline = 0
|
||||||
avg_acceptance_rate = 95.0 # Default value
|
|
||||||
|
|
||||||
# Iterate through worker rows in the table
|
# Iterate through worker rows in the table
|
||||||
for row in workers_table.find_all('tr', class_='table-row'):
|
for row in workers_table.find_all('tr', class_='table-row'):
|
||||||
@ -675,7 +674,6 @@ class MiningDashboardService:
|
|||||||
"efficiency": 90.0, # Default efficiency
|
"efficiency": 90.0, # Default efficiency
|
||||||
"last_share": "N/A",
|
"last_share": "N/A",
|
||||||
"earnings": 0,
|
"earnings": 0,
|
||||||
"acceptance_rate": 95.0, # Default acceptance rate
|
|
||||||
"power_consumption": 0,
|
"power_consumption": 0,
|
||||||
"temperature": 0
|
"temperature": 0
|
||||||
}
|
}
|
||||||
@ -815,7 +813,6 @@ class MiningDashboardService:
|
|||||||
'workers_online': workers_online,
|
'workers_online': workers_online,
|
||||||
'workers_offline': workers_offline,
|
'workers_offline': workers_offline,
|
||||||
'total_earnings': total_earnings,
|
'total_earnings': total_earnings,
|
||||||
'avg_acceptance_rate': avg_acceptance_rate,
|
|
||||||
'daily_sats': daily_sats,
|
'daily_sats': daily_sats,
|
||||||
'timestamp': datetime.now(ZoneInfo(get_timezone())).isoformat()
|
'timestamp': datetime.now(ZoneInfo(get_timezone())).isoformat()
|
||||||
}
|
}
|
||||||
@ -876,7 +873,6 @@ class MiningDashboardService:
|
|||||||
"efficiency": 90.0,
|
"efficiency": 90.0,
|
||||||
"last_share": "N/A",
|
"last_share": "N/A",
|
||||||
"earnings": 0,
|
"earnings": 0,
|
||||||
"acceptance_rate": 95.0,
|
|
||||||
"power_consumption": 0,
|
"power_consumption": 0,
|
||||||
"temperature": 0
|
"temperature": 0
|
||||||
}
|
}
|
||||||
@ -963,7 +959,6 @@ class MiningDashboardService:
|
|||||||
'workers_online': workers_online,
|
'workers_online': workers_online,
|
||||||
'workers_offline': workers_offline,
|
'workers_offline': workers_offline,
|
||||||
'total_earnings': total_earnings,
|
'total_earnings': total_earnings,
|
||||||
'avg_acceptance_rate': 99.0,
|
|
||||||
'timestamp': datetime.now(ZoneInfo(get_timezone())).isoformat()
|
'timestamp': datetime.now(ZoneInfo(get_timezone())).isoformat()
|
||||||
}
|
}
|
||||||
logging.info(f"Successfully retrieved {len(workers)} workers across multiple pages")
|
logging.info(f"Successfully retrieved {len(workers)} workers across multiple pages")
|
||||||
|
@ -48,7 +48,6 @@ class WorkerService:
|
|||||||
"hashrate_unit": "TH/s",
|
"hashrate_unit": "TH/s",
|
||||||
"total_earnings": 0.0,
|
"total_earnings": 0.0,
|
||||||
"daily_sats": 0,
|
"daily_sats": 0,
|
||||||
"avg_acceptance_rate": 0.0,
|
|
||||||
"hashrate_history": [],
|
"hashrate_history": [],
|
||||||
"timestamp": datetime.now(ZoneInfo(get_timezone())).isoformat()
|
"timestamp": datetime.now(ZoneInfo(get_timezone())).isoformat()
|
||||||
}
|
}
|
||||||
@ -307,7 +306,6 @@ class WorkerService:
|
|||||||
"efficiency": round(random.uniform(80, 95), 1) if is_online else 0,
|
"efficiency": round(random.uniform(80, 95), 1) if is_online else 0,
|
||||||
"last_share": last_share,
|
"last_share": last_share,
|
||||||
"earnings": round(random.uniform(0.0001, 0.001), 8),
|
"earnings": round(random.uniform(0.0001, 0.001), 8),
|
||||||
"acceptance_rate": round(random.uniform(95, 99), 1),
|
|
||||||
"power_consumption": round(random.uniform(2000, 3500)) if is_online else 0,
|
"power_consumption": round(random.uniform(2000, 3500)) if is_online else 0,
|
||||||
"temperature": round(random.uniform(55, 75)) if is_online else 0
|
"temperature": round(random.uniform(55, 75)) if is_online else 0
|
||||||
}
|
}
|
||||||
@ -437,7 +435,6 @@ class WorkerService:
|
|||||||
"hashrate_unit": hashrate_unit,
|
"hashrate_unit": hashrate_unit,
|
||||||
"total_earnings": total_earnings,
|
"total_earnings": total_earnings,
|
||||||
"daily_sats": daily_sats, # Fixed daily_sats value
|
"daily_sats": daily_sats, # Fixed daily_sats value
|
||||||
"avg_acceptance_rate": 98.8, # Default value
|
|
||||||
"hashrate_history": hashrate_history,
|
"hashrate_history": hashrate_history,
|
||||||
"timestamp": datetime.now(ZoneInfo(get_timezone())).isoformat()
|
"timestamp": datetime.now(ZoneInfo(get_timezone())).isoformat()
|
||||||
}
|
}
|
||||||
@ -511,9 +508,6 @@ class WorkerService:
|
|||||||
minutes_ago = random.randint(0, 5)
|
minutes_ago = random.randint(0, 5)
|
||||||
last_share = (current_time - timedelta(minutes=minutes_ago)).strftime("%Y-%m-%d %H:%M")
|
last_share = (current_time - timedelta(minutes=minutes_ago)).strftime("%Y-%m-%d %H:%M")
|
||||||
|
|
||||||
# Generate acceptance rate (95-100%)
|
|
||||||
acceptance_rate = round(random.uniform(95, 100), 1)
|
|
||||||
|
|
||||||
# Generate temperature (normal operating range)
|
# Generate temperature (normal operating range)
|
||||||
temperature = random.randint(55, 70) if model_info["type"] == "ASIC" else random.randint(45, 55)
|
temperature = random.randint(55, 70) if model_info["type"] == "ASIC" else random.randint(45, 55)
|
||||||
|
|
||||||
@ -532,7 +526,6 @@ class WorkerService:
|
|||||||
"efficiency": round(random.uniform(65, 95), 1),
|
"efficiency": round(random.uniform(65, 95), 1),
|
||||||
"last_share": last_share,
|
"last_share": last_share,
|
||||||
"earnings": 0, # Will be set after all workers are generated
|
"earnings": 0, # Will be set after all workers are generated
|
||||||
"acceptance_rate": acceptance_rate,
|
|
||||||
"power_consumption": model_info["power"],
|
"power_consumption": model_info["power"],
|
||||||
"temperature": temperature
|
"temperature": temperature
|
||||||
})
|
})
|
||||||
@ -571,7 +564,6 @@ class WorkerService:
|
|||||||
"efficiency": 0,
|
"efficiency": 0,
|
||||||
"last_share": last_share,
|
"last_share": last_share,
|
||||||
"earnings": 0, # Minimal earnings for offline workers
|
"earnings": 0, # Minimal earnings for offline workers
|
||||||
"acceptance_rate": round(random.uniform(95, 99), 1),
|
|
||||||
"power_consumption": 0,
|
"power_consumption": 0,
|
||||||
"temperature": 0
|
"temperature": 0
|
||||||
})
|
})
|
||||||
@ -673,9 +665,6 @@ class WorkerService:
|
|||||||
minutes_ago = random.randint(0, 3)
|
minutes_ago = random.randint(0, 3)
|
||||||
last_share = (current_time - timedelta(minutes=minutes_ago)).strftime("%Y-%m-%d %H:%M")
|
last_share = (current_time - timedelta(minutes=minutes_ago)).strftime("%Y-%m-%d %H:%M")
|
||||||
|
|
||||||
# Generate acceptance rate (95-100%)
|
|
||||||
acceptance_rate = round(random.uniform(95, 100), 1)
|
|
||||||
|
|
||||||
# Generate temperature (normal operating range)
|
# Generate temperature (normal operating range)
|
||||||
temperature = random.randint(55, 70) if model_info["type"] == "ASIC" else random.randint(45, 55)
|
temperature = random.randint(55, 70) if model_info["type"] == "ASIC" else random.randint(45, 55)
|
||||||
|
|
||||||
@ -701,7 +690,6 @@ class WorkerService:
|
|||||||
"efficiency": round(random.uniform(65, 95), 1),
|
"efficiency": round(random.uniform(65, 95), 1),
|
||||||
"last_share": last_share,
|
"last_share": last_share,
|
||||||
"earnings": 0, # Will be set after all workers are generated
|
"earnings": 0, # Will be set after all workers are generated
|
||||||
"acceptance_rate": acceptance_rate,
|
|
||||||
"power_consumption": model_info["power"],
|
"power_consumption": model_info["power"],
|
||||||
"temperature": temperature
|
"temperature": temperature
|
||||||
})
|
})
|
||||||
@ -747,7 +735,6 @@ class WorkerService:
|
|||||||
"efficiency": 0,
|
"efficiency": 0,
|
||||||
"last_share": last_share,
|
"last_share": last_share,
|
||||||
"earnings": 0, # Minimal earnings for offline workers
|
"earnings": 0, # Minimal earnings for offline workers
|
||||||
"acceptance_rate": round(random.uniform(95, 99), 1),
|
|
||||||
"power_consumption": 0,
|
"power_consumption": 0,
|
||||||
"temperature": 0
|
"temperature": 0
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user