Skip to content

Commit 0bf12cf

Browse files
authored
Merge pull request #32 from twkrol/main
Added hashrate reporting per gpu
2 parents 30ee8f0 + f28dd53 commit 0bf12cf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

integrations/hiveos/h-stats.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ if [ "$diffTime" -lt "$maxDelay" ]; then
5555
BRAND_MINER="amd"
5656
fi
5757
58-
# TODO, get hash per gpu
59-
avg_hashrate=$((total_hashrate/brand_gpu_count))
6058
for(( i=0; i < gpu_count; i++ )); do
6159
[[ "${brands[i]}" != $BRAND_MINER ]] && continue
6260
[[ "${busids[i]}" =~ ^([A-Fa-f0-9]+): ]]
6361
busid_arr+=($((16#${BASH_REMATCH[1]})))
6462
temp_arr+=(${temps[i]})
65-
fan_arr+=(${fans[i]})
66-
hash_arr+=($avg_hashrate)
63+
fan_arr+=(${fans[i]})
64+
gpu_raw=`cat $CUSTOM_LOG_BASENAME.log | grep -w "Device #"$i | tail -n 1 `
65+
hashrate=`echo $gpu_raw | awk '{print $(NF-1)}' | cut -d "." -f 1,2 --output-delimiter='' | sed 's/$/0/'`
66+
if [[ $gpu_raw == *"Ghash"* ]]; then
67+
hashrate=$(($hashrate*1000))
68+
fi
69+
hash_arr+=($hashrate)
6770
done
6871
6972
hash_json=`printf '%s\n' "${hash_arr[@]}" | jq -cs '.'`

0 commit comments

Comments
 (0)