Noctem / Monocle

PoGo mapper and notifier
MIT License
122 stars 151 forks source link

[feature request] output stats from status bar to console #52

Open quixfz opened 7 years ago

quixfz commented 7 years ago

the status bar screen has many important statistics that are not visible when running with --no-status-bar.

i'm running it like this and barely get any useful info: nohup python3.6 scan.py --no-status-bar --log-level INFO > /tmp/pm2 &

it would be great if the stats would appear every few minutes. i'm mostly interested in number of captchas, number of active accounts, skipped spawnpoints, average hash_key usage, known/unknown spanws.

evenly-epic-mule commented 7 years ago

I had the Idea that it wouldn't be to hard to create a status file /tmp/pokeminer.stat or so. The status thread still runs but is printed to that file overwriting it every time. https://github.com/Noctem/pokeminer/blob/develop/pokeminer/overseer.py#L141 That is the line, which would have to be changed

And /tmp is really important as otherwise it may kill ssd based systems ^^

quixfz commented 7 years ago

there are people running multiple scanners... ;- ) so, one would need to be able to set the filename. or just output that to the console... hmm, have to see what happens when i start it without --no-status-bar

PS: just went through the code... that looks doable. i'll see what i can come up with.

quixfz commented 7 years ago

thanks for the pointer! i added another variable to check(): last_log_info = now

and the following code to the while loop:

                if not self.paused and now - last_log_info > 60:
                    self.logger.info(self.get_status_message());
                    last_log_info = now

it gets the job done

evenly-epic-mule commented 7 years ago

https://github.com/Noctem/Monocle/pull/73 not quite up to date, but will do the job