Skip to content

Commit

Permalink
Merge pull request #32 from twkrol/main
Browse files Browse the repository at this point in the history
Added hashrate reporting per gpu
  • Loading branch information
tmrlvi authored Apr 20, 2022
2 parents 30ee8f0 + f28dd53 commit 0bf12cf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions integrations/hiveos/h-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,18 @@ if [ "$diffTime" -lt "$maxDelay" ]; then
BRAND_MINER="amd"
fi
# TODO, get hash per gpu
avg_hashrate=$((total_hashrate/brand_gpu_count))
for(( i=0; i < gpu_count; i++ )); do
[[ "${brands[i]}" != $BRAND_MINER ]] && continue
[[ "${busids[i]}" =~ ^([A-Fa-f0-9]+): ]]
busid_arr+=($((16#${BASH_REMATCH[1]})))
temp_arr+=(${temps[i]})
fan_arr+=(${fans[i]})
hash_arr+=($avg_hashrate)
fan_arr+=(${fans[i]})
gpu_raw=`cat $CUSTOM_LOG_BASENAME.log | grep -w "Device #"$i | tail -n 1 `
hashrate=`echo $gpu_raw | awk '{print $(NF-1)}' | cut -d "." -f 1,2 --output-delimiter='' | sed 's/$/0/'`
if [[ $gpu_raw == *"Ghash"* ]]; then
hashrate=$(($hashrate*1000))
fi
hash_arr+=($hashrate)
done
hash_json=`printf '%s\n' "${hash_arr[@]}" | jq -cs '.'`
Expand Down

0 comments on commit 0bf12cf

Please sign in to comment.