From 3bb74c37e75be364eec4d892a8c3d3795ff96713 Mon Sep 17 00:00:00 2001 From: DJObleezy Date: Sun, 20 Apr 2025 06:20:38 -0700 Subject: [PATCH] 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. --- data_service.py | 5 ----- worker_service.py | 15 +-------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/data_service.py b/data_service.py index 1f672ab..b2619c8 100644 --- a/data_service.py +++ b/data_service.py @@ -639,7 +639,6 @@ class MiningDashboardService: # Find total worker counts workers_online = 0 workers_offline = 0 - avg_acceptance_rate = 95.0 # Default value # Iterate through worker rows in the table for row in workers_table.find_all('tr', class_='table-row'): @@ -675,7 +674,6 @@ class MiningDashboardService: "efficiency": 90.0, # Default efficiency "last_share": "N/A", "earnings": 0, - "acceptance_rate": 95.0, # Default acceptance rate "power_consumption": 0, "temperature": 0 } @@ -815,7 +813,6 @@ class MiningDashboardService: 'workers_online': workers_online, 'workers_offline': workers_offline, 'total_earnings': total_earnings, - 'avg_acceptance_rate': avg_acceptance_rate, 'daily_sats': daily_sats, 'timestamp': datetime.now(ZoneInfo(get_timezone())).isoformat() } @@ -876,7 +873,6 @@ class MiningDashboardService: "efficiency": 90.0, "last_share": "N/A", "earnings": 0, - "acceptance_rate": 95.0, "power_consumption": 0, "temperature": 0 } @@ -963,7 +959,6 @@ class MiningDashboardService: 'workers_online': workers_online, 'workers_offline': workers_offline, 'total_earnings': total_earnings, - 'avg_acceptance_rate': 99.0, 'timestamp': datetime.now(ZoneInfo(get_timezone())).isoformat() } logging.info(f"Successfully retrieved {len(workers)} workers across multiple pages") diff --git a/worker_service.py b/worker_service.py index e66d939..2610e11 100644 --- a/worker_service.py +++ b/worker_service.py @@ -48,7 +48,6 @@ class WorkerService: "hashrate_unit": "TH/s", "total_earnings": 0.0, "daily_sats": 0, - "avg_acceptance_rate": 0.0, "hashrate_history": [], "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, "last_share": last_share, "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, "temperature": round(random.uniform(55, 75)) if is_online else 0 } @@ -437,7 +435,6 @@ class WorkerService: "hashrate_unit": hashrate_unit, "total_earnings": total_earnings, "daily_sats": daily_sats, # Fixed daily_sats value - "avg_acceptance_rate": 98.8, # Default value "hashrate_history": hashrate_history, "timestamp": datetime.now(ZoneInfo(get_timezone())).isoformat() } @@ -510,10 +507,7 @@ class WorkerService: # Generate last share time (within last 5 minutes) minutes_ago = random.randint(0, 5) 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) 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), "last_share": last_share, "earnings": 0, # Will be set after all workers are generated - "acceptance_rate": acceptance_rate, "power_consumption": model_info["power"], "temperature": temperature }) @@ -571,7 +564,6 @@ class WorkerService: "efficiency": 0, "last_share": last_share, "earnings": 0, # Minimal earnings for offline workers - "acceptance_rate": round(random.uniform(95, 99), 1), "power_consumption": 0, "temperature": 0 }) @@ -673,9 +665,6 @@ class WorkerService: minutes_ago = random.randint(0, 3) 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) 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), "last_share": last_share, "earnings": 0, # Will be set after all workers are generated - "acceptance_rate": acceptance_rate, "power_consumption": model_info["power"], "temperature": temperature }) @@ -747,7 +735,6 @@ class WorkerService: "efficiency": 0, "last_share": last_share, "earnings": 0, # Minimal earnings for offline workers - "acceptance_rate": round(random.uniform(95, 99), 1), "power_consumption": 0, "temperature": 0 })