Been a while since I've popped my head in here...been running rather uneventfully with nvOC and my auto-switcher, watching coin pile up.
The auto-switcher writes its activity to a file, algo-log. Yesterday, I got around to knocking together a simple tool that looks at the algo-log file and tells you what you've been mining recently:
#!/usr/bin/env python3
from datetime import datetime, timedelta
import sys
import operator
end=datetime.now().replace(microsecond=0)
try:
start=end-timedelta(days=int(sys.argv[1]))
except:
start=end-timedelta(days=1)
l={}
with (open("algo-log", "r")) as f:
for i in f:
curr=datetime.strptime(i[0:19], "%Y-%m-%d %H:%M:%S")
curr_algo=i[28:].split(" ")[0]
if (curr>start):
try:
l[curr_algo]+=curr-last
except:
l[curr_algo]=curr-last
last=curr
last_algo=curr_algo
try:
l[last_algo]+=end-last
except:
l[last_algo]=end-last
for i in sorted(l.items(), key=operator.itemgetter(1), reverse=True):
print(i[0]+" {0:0.3f}".format(i[1].days*24+i[1].seconds/3600))
By default, it counts up which coins have been mined over the past day and prints a sorted list. Here's what I've been mining:
feathercoin 6.901
monacoin 5.013
digibyte-skein 4.043
vertcoin 4.014
zencash 4.010
bitcoin-gold 1.508
Follow it with a number to get that many days' worth of analysis. Here's my past week (./top-algos.py 7):
feathercoin 48.667
monacoin 22.975
vertcoin 17.542
zencash 16.712
digibyte-skein 16.211
groestlcoin 12.701
zclassic 8.029
bitcoin-gold 7.022
ethereum 4.514
monero 4.020
zcash 3.511
maxcoin 3.511
ethereum-classic 3.009
That looks quite handy to have. I hate to ask, but how do I go about running that? I'm not familiar with python at all.