benchs: show hashrate per watt

This commit is contained in:
Tanguy Pruvot 2016-05-23 02:58:35 +02:00
parent bea876bbd1
commit 3e0c13a2bd

View file

@ -150,16 +150,18 @@ foreach ($db_rows as $row) {
echo '</tbody>';
if (!empty($algo)) {
echo '<tfoot><tr class="ssfoot">';
echo '<th class="algo">'.CHtml::link($row['algo'],'/bench?algo='.$row['algo']).'</td>';
echo '<th>&nbsp;</td>';
$avg = dborow("SELECT AVG(khps) as khps, AVG(power) as power, AVG(intensity) as intensity, AVG(freq) as freq, ".
"COUNT(*) as records ".
"FROM benchmarks WHERE algo=:algo AND power > 5 AND $sqlFilter", array(':algo'=>$algo)
);
if (arraySafeVal($avg, 'records') > 0) {
echo '<tfoot><tr class="ssfoot">';
echo '<th class="algo">'.CHtml::link($row['algo'],'/bench?algo='.$row['algo']).'</td>';
echo '<th>&nbsp;</td>';
echo '<th colspan="3">Average ('.$avg["records"].' records)</td>';
echo '<th>'.Itoa2(1000*round($avg['khps'],3),3).'H</td>';
@ -167,9 +169,16 @@ if (!empty($algo)) {
echo '<th>'.round($avg['freq']).'</td>';
echo '<th>'.round($avg['power']).'</td>';
echo '<th colspan="4">&nbsp;</td>';
$hpw = 0;
if (floatval($avg['power']) > 0) {
$hpw = floatval($avg['khps']) / floatval($avg['power']);
}
echo '<th>'.Itoa2(1000*round($hpw,3),3).'H/W</td>';
echo '<th colspan="3">&nbsp;</td>';
echo '</tr></tfoot>';
}
}
echo'</table><br/>';