fix: cuda metrics and initialize estimated rate gauge
This commit is contained in:
@@ -485,6 +485,11 @@ impl CudaEngine {
|
||||
metrics::inc_candidates_false_positive("gpu-cuda");
|
||||
}
|
||||
hash_count = hash_count.saturating_add(covered);
|
||||
#[cfg(feature = "metrics")]
|
||||
{
|
||||
metrics::inc_candidates_false_positive("gpu-cuda");
|
||||
}
|
||||
hash_count = hash_count.saturating_add(covered);
|
||||
if covered < total_elems_u64 {
|
||||
return Ok(EngineStatus::Exhausted { hash_count });
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ default = ["cpu", "metrics", "montgomery"]
|
||||
# Enable CPU engine by default.
|
||||
cpu = ["engine-cpu"]
|
||||
# Optional metrics/observability (Prometheus endpoint).
|
||||
metrics = ["dep:metrics", "engine-montgomery?/metrics", "metrics/http-exporter"]
|
||||
metrics = ["dep:metrics", "engine-montgomery?/metrics", "engine-gpu-cuda?/metrics", "metrics/http-exporter"]
|
||||
# Optional GPU backends (off by default).
|
||||
cuda = ["dep:engine-gpu-cuda", "engine-gpu-cuda/cuda"]
|
||||
opencl = ["engine-gpu-opencl"]
|
||||
|
||||
@@ -130,6 +130,8 @@ impl MiningService {
|
||||
metrics::set_job_status_gauge(self.engine.name(), &job_id, "completed", 0);
|
||||
metrics::set_job_status_gauge(self.engine.name(), &job_id, "failed", 0);
|
||||
metrics::set_job_status_gauge(self.engine.name(), &job_id, "cancelled", 0);
|
||||
// initialize estimated rate gauge so it appears immediately
|
||||
metrics::set_job_estimated_rate(self.engine.name(), &job_id, 0.0);
|
||||
// increment active jobs
|
||||
{
|
||||
let mut g = self.active_jobs_gauge.lock().await;
|
||||
|
||||
Reference in New Issue
Block a user