diff --git a/api.cpp b/api.cpp index a83c7cd..d473add 100644 --- a/api.cpp +++ b/api.cpp @@ -124,7 +124,6 @@ static void gpustatus(int thr_id) struct cgpu_info *cgpu = &thr_info[thr_id].gpu; int gpuid = cgpu->gpu_id; char buf[512]; *buf = '\0'; - char pstate[8]; char* card; #ifdef USE_WRAPNVML @@ -132,7 +131,6 @@ static void gpustatus(int thr_id) cgpu->gpu_bus = gpu_busid(cgpu); cgpu->gpu_temp = gpu_temp(cgpu); cgpu->gpu_fan = gpu_fanpercent(cgpu); - cgpu->gpu_pstate = gpu_pstate(cgpu); #endif gpu_clocks(cgpu); @@ -153,16 +151,12 @@ static void gpustatus(int thr_id) cgpu->khashes = stats_get_speed(cgpu->gpu_id, 0.0) / 1000.0; - memset(pstate, 0, sizeof(pstate)); - if (cgpu->gpu_pstate != -1) - snprintf(pstate, sizeof(pstate), "P%hu", cgpu->gpu_pstate); - card = device_name[gpuid]; snprintf(buf, sizeof(buf), "GPU=%d;BUS=%hd;CARD=%s;" - "TEMP=%.1f;FAN=%d;FREQ=%d;PST=%s;KHS=%.2f;HWF=%d;I=%d|", + "TEMP=%.1f;FAN=%d;FREQ=%d;KHS=%.2f;HWF=%d;I=%d|", gpuid, cgpu->gpu_bus, card, cgpu->gpu_temp, cgpu->gpu_fan, - cgpu->gpu_clock, pstate, cgpu->khashes, + cgpu->gpu_clock, cgpu->khashes, cgpu->hw_errors, cgpu->intensity); // append to buffer for multi gpus diff --git a/api/index.php b/api/index.php index de15c8d..c232398 100644 --- a/api/index.php +++ b/api/index.php @@ -42,7 +42,7 @@ function translateField($key) $intl['ALGO'] = 'Algorithm'; $intl['GPUS'] = 'GPUs'; $intl['CPUS'] = 'Threads'; - $intl['KHS'] = 'Hash rate (kH/s)'; + $intl['KHS'] = 'Hash rate'; $intl['ACC'] = 'Accepted shares'; $intl['ACCMN'] = 'Accepted / mn'; $intl['REJ'] = 'Rejected'; @@ -59,6 +59,12 @@ function translateField($key) $intl['FREQ'] = 'Freq.'; $intl['PST'] = 'P-State'; + // pool infos + $intl['POOL'] = 'Pool'; + $intl['PING'] = 'Ping (ms)'; + $intl['DISCO'] = 'Disconnects'; + $intl['USER'] = 'User'; + if (isset($intl[$key])) return $intl[$key]; else @@ -87,15 +93,44 @@ function translateValue($key,$val,$data=array()) case 'TS': $val = strftime("%H:%M:%S", (int) $val); break; + case 'KHS': + $val = ''.$val.' kH/s'; + break; + case 'NAME': + case 'POOL'; + case 'USER': + // long fields + $val = ''.$val.''; + break; } return $val; } +function filterPoolInfos($stats) +{ + $keys = array('USER','H','PING','DISCO'); + $data = array(); + $pool = array_pop($stats); + // simplify URL to host only + $data['POOL'] = $pool['URL']; + if (strstr($pool['URL'],'://')) { + $parts = explode(':', $pool['URL']); + $data['POOL'] = substr($parts[1],2); + } + foreach ($pool as $key=>$val) { + if (in_array($key, $keys)) + $data[$key] = $val; + } + return $data; +} + function displayData($data) { $htm = ''; $totals = array(); foreach ($data as $name => $stats) { + if (!isset($stats['summary'])) + continue; $htm .= '
'.$name." | |
---|---|
POOL | |
'.translateField($key).' | '. + ''.translateValue($key, $val)." |
'.$g." $card |