Skip to content

Commit

Permalink
Fix per hour stats (#1772)
Browse files Browse the repository at this point in the history
* Fix per hour stats

We were wrongly round them to int

* Fix wrong format strings for costs
  • Loading branch information
onilton authored and sebastienvercammen committed Jan 28, 2017
1 parent 785b4b5 commit f24516a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pogom/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,18 @@ def get_stats_message(threadStatus):
if elapsed == 0:
elapsed = 1

sph = overseer['success_total'] * 3600 / elapsed
fph = overseer['fail_total'] * 3600 / elapsed
eph = overseer['empty_total'] * 3600 / elapsed
skph = overseer['skip_total'] * 3600 / elapsed
cph = overseer['captcha_total'] * 3600 / elapsed
sph = overseer['success_total'] * 3600.0 / elapsed
fph = overseer['fail_total'] * 3600.0 / elapsed
eph = overseer['empty_total'] * 3600.0 / elapsed
skph = overseer['skip_total'] * 3600.0 / elapsed
cph = overseer['captcha_total'] * 3600.0 / elapsed
ccost = cph * 0.00299
cmonth = ccost * 730

message = ('Total active: {} | Success: {} ({}/hr) | ' +
'Fails: {} ({}/hr) | Empties: {} ({}/hr) | ' +
'Skips {} ({}/hr) | ' +
'Captchas: {} ({}/hr)|${:2}/hr|${:2}/mo').format(
message = ('Total active: {} | Success: {} ({:.1f}/hr) | ' +
'Fails: {} ({:.1f}/hr) | Empties: {} ({:.1f}/hr) | ' +
'Skips {} ({:.1f}/hr) | ' +
'Captchas: {} ({:.1f}/hr)|${:.5f}/hr|${:.3f}/mo').format(
overseer['active_accounts'],
overseer['success_total'], sph,
overseer['fail_total'], fph,
Expand Down

0 comments on commit f24516a

Please sign in to comment.