|
|
@ -146,7 +146,7 @@ static const char *COMMA = ","; |
|
|
|
static const char SEPARATOR = '|'; |
|
|
|
static const char SEPARATOR = '|'; |
|
|
|
static const char GPUSEP = ','; |
|
|
|
static const char GPUSEP = ','; |
|
|
|
|
|
|
|
|
|
|
|
static const char *APIVERSION = "1.0"; |
|
|
|
static const char *APIVERSION = "1.1"; |
|
|
|
static const char *DEAD = "Dead"; |
|
|
|
static const char *DEAD = "Dead"; |
|
|
|
static const char *SICK = "Sick"; |
|
|
|
static const char *SICK = "Sick"; |
|
|
|
static const char *NOSTART = "NoStart"; |
|
|
|
static const char *NOSTART = "NoStart"; |
|
|
@ -526,20 +526,24 @@ static void gpustatus(int gpu, bool isjson) |
|
|
|
if (cgpu->dynamic) |
|
|
|
if (cgpu->dynamic) |
|
|
|
strcpy(intensity, DYNAMIC); |
|
|
|
strcpy(intensity, DYNAMIC); |
|
|
|
else |
|
|
|
else |
|
|
|
sprintf(intensity, "%d", gpus->intensity); |
|
|
|
sprintf(intensity, "%d", cgpu->intensity); |
|
|
|
|
|
|
|
|
|
|
|
if (isjson) |
|
|
|
if (isjson) |
|
|
|
sprintf(buf, "{\"GPU\":%d,\"Enabled\":\"%s\",\"Status\":\"%s\",\"Temperature\":%.2f,\"Fan Speed\":%d,\"Fan Percent\":%d,\"GPU Clock\":%d,\"Memory Clock\":%d,\"GPU Voltage\":%.3f,\"GPU Activity\":%d,\"Powertune\":%d,\"MHS av\":%.2f,\"MHS %ds\":%.2f,\"Accepted\":%d,\"Rejected\":%d,\"Hardware Errors\":%d,\"Utility\":%.2f,\"Intensity\":\"%s\"}", |
|
|
|
sprintf(buf, "{\"GPU\":%d,\"Enabled\":\"%s\",\"Status\":\"%s\",\"Temperature\":%.2f,\"Fan Speed\":%d,\"Fan Percent\":%d,\"GPU Clock\":%d,\"Memory Clock\":%d,\"GPU Voltage\":%.3f,\"GPU Activity\":%d,\"Powertune\":%d,\"MHS av\":%.2f,\"MHS %ds\":%.2f,\"Accepted\":%d,\"Rejected\":%d,\"Hardware Errors\":%d,\"Utility\":%.2f,\"Intensity\":\"%s\",\"Last Share Pool\":%d,\"Last Share Time\":%lu}", |
|
|
|
gpu, enabled, status, gt, gf, gp, gc, gm, gv, ga, pt, |
|
|
|
gpu, enabled, status, gt, gf, gp, gc, gm, gv, ga, pt, |
|
|
|
cgpu->total_mhashes / total_secs, opt_log_interval, cgpu->rolling, |
|
|
|
cgpu->total_mhashes / total_secs, opt_log_interval, cgpu->rolling, |
|
|
|
cgpu->accepted, cgpu->rejected, cgpu->hw_errors, |
|
|
|
cgpu->accepted, cgpu->rejected, cgpu->hw_errors, |
|
|
|
cgpu->utility, intensity); |
|
|
|
cgpu->utility, intensity, |
|
|
|
|
|
|
|
((unsigned long)(cgpu->last_share_pool_time) > 0) ? cgpu->last_share_pool : -1, |
|
|
|
|
|
|
|
(unsigned long)(cgpu->last_share_pool_time)); |
|
|
|
else |
|
|
|
else |
|
|
|
sprintf(buf, "GPU=%d,Enabled=%s,Status=%s,Temperature=%.2f,Fan Speed=%d,Fan Percent=%d,GPU Clock=%d,Memory Clock=%d,GPU Voltage=%.3f,GPU Activity=%d,Powertune=%d,MHS av=%.2f,MHS %ds=%.2f,Accepted=%d,Rejected=%d,Hardware Errors=%d,Utility=%.2f,Intensity=%s%c", |
|
|
|
sprintf(buf, "GPU=%d,Enabled=%s,Status=%s,Temperature=%.2f,Fan Speed=%d,Fan Percent=%d,GPU Clock=%d,Memory Clock=%d,GPU Voltage=%.3f,GPU Activity=%d,Powertune=%d,MHS av=%.2f,MHS %ds=%.2f,Accepted=%d,Rejected=%d,Hardware Errors=%d,Utility=%.2f,Intensity=%s,Last Share Pool=%d,Last Share Time=%lu%c", |
|
|
|
gpu, enabled, status, gt, gf, gp, gc, gm, gv, ga, pt, |
|
|
|
gpu, enabled, status, gt, gf, gp, gc, gm, gv, ga, pt, |
|
|
|
cgpu->total_mhashes / total_secs, opt_log_interval, cgpu->rolling, |
|
|
|
cgpu->total_mhashes / total_secs, opt_log_interval, cgpu->rolling, |
|
|
|
cgpu->accepted, cgpu->rejected, cgpu->hw_errors, |
|
|
|
cgpu->accepted, cgpu->rejected, cgpu->hw_errors, |
|
|
|
cgpu->utility, intensity, SEPARATOR); |
|
|
|
cgpu->utility, intensity, |
|
|
|
|
|
|
|
((unsigned long)(cgpu->last_share_pool_time) > 0) ? cgpu->last_share_pool : -1, |
|
|
|
|
|
|
|
(unsigned long)(cgpu->last_share_pool_time), SEPARATOR); |
|
|
|
|
|
|
|
|
|
|
|
strcat(io_buffer, buf); |
|
|
|
strcat(io_buffer, buf); |
|
|
|
} |
|
|
|
} |
|
|
@ -556,17 +560,21 @@ static void cpustatus(int cpu, bool isjson) |
|
|
|
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60; |
|
|
|
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60; |
|
|
|
|
|
|
|
|
|
|
|
if (isjson) |
|
|
|
if (isjson) |
|
|
|
sprintf(buf, "{\"CPU\":%d,\"MHS av\":%.2f,\"MHS %ds\":%.2f,\"Accepted\":%d,\"Rejected\":%d,\"Utility\":%.2f}", |
|
|
|
sprintf(buf, "{\"CPU\":%d,\"MHS av\":%.2f,\"MHS %ds\":%.2f,\"Accepted\":%d,\"Rejected\":%d,\"Utility\":%.2f,\"Last Share Pool\":%d,\"Last Share Time\":%lu}", |
|
|
|
cpu, cgpu->total_mhashes / total_secs, |
|
|
|
cpu, cgpu->total_mhashes / total_secs, |
|
|
|
opt_log_interval, cgpu->rolling, |
|
|
|
opt_log_interval, cgpu->rolling, |
|
|
|
cgpu->accepted, cgpu->rejected, |
|
|
|
cgpu->accepted, cgpu->rejected, |
|
|
|
cgpu->utility); |
|
|
|
cgpu->utility, |
|
|
|
|
|
|
|
((unsigned long)(cgpu->last_share_pool_time) > 0) ? cgpu->last_share_pool : -1, |
|
|
|
|
|
|
|
(unsigned long)(cgpu->last_share_pool_time)); |
|
|
|
else |
|
|
|
else |
|
|
|
sprintf(buf, "CPU=%d,MHS av=%.2f,MHS %ds=%.2f,Accepted=%d,Rejected=%d,Utility=%.2f%c", |
|
|
|
sprintf(buf, "CPU=%d,MHS av=%.2f,MHS %ds=%.2f,Accepted=%d,Rejected=%d,Utility=%.2f,Last Share Pool=%d,Last Share Time=%lu%c", |
|
|
|
cpu, cgpu->total_mhashes / total_secs, |
|
|
|
cpu, cgpu->total_mhashes / total_secs, |
|
|
|
opt_log_interval, cgpu->rolling, |
|
|
|
opt_log_interval, cgpu->rolling, |
|
|
|
cgpu->accepted, cgpu->rejected, |
|
|
|
cgpu->accepted, cgpu->rejected, |
|
|
|
cgpu->utility, SEPARATOR); |
|
|
|
cgpu->utility, |
|
|
|
|
|
|
|
((unsigned long)(cgpu->last_share_pool_time) > 0) ? cgpu->last_share_pool : -1, |
|
|
|
|
|
|
|
(unsigned long)(cgpu->last_share_pool_time), SEPARATOR); |
|
|
|
|
|
|
|
|
|
|
|
strcat(io_buffer, buf); |
|
|
|
strcat(io_buffer, buf); |
|
|
|
} |
|
|
|
} |
|
|
|