Comments (24)
I would prefer MySQL support.
from pogom.
I think an advantage is that we could offload the database over to a separate server/instance if necessary.
from pogom.
what about using this as DB format? store static (forts/spawns) and dynamic (pokemon sightings) separately? Right now too much garbage is stored.
https://www.reddit.com/r/pokemongodev/comments/4ull2o/working_on_a_database_standard_for_map_objects/
from pogom.
Peewee (the orm library we use) supports SQLite, MySQL and PostgreSQL. So it should be possible to add support for those other DBMS in the near future.
from pogom.
I defnitely want to support more dbs in the future, but not via a clunky command line flag.
We can do it, when we have a HTML config page.
from pogom.
Peewee (the orm library we use)
Damn, I should've taken a better look at the model. I'm sorry. Next time, I'll examine the codebase better before posting here.
but not via a clunky command line flag
What else do you propose, besides the config object inside __init__.py
and the web config interface?
from pogom.
Just the web config interface actually.
from pogom.
Why use an "external" database at all? Even with large search radii, the amount of data to store is small enough to simply store and process in-memory, or isn't it?
from pogom.
@bas-stringer I want stats to work across restarts. And in the future we want heatmaps, which depend on a large dataset.
from pogom.
@nborrmann I'm unsure what exactly you mean by stats working across restarts. The heatmap thing sounds fun, but again, I have doubts if the quantity of data is so big it can't be done in-memory.
How about going the in-memory route for updating the map ASAP while scanning, and then in between scan rounds updating the database? (Or, possibly, dumping serialized data e.g. through (c)pickle, simplejson or ujson? Caveat emptor with all of these, as the speedups they provide over pickle and json resp. come at the cost of weird quirks that can be very difficult to debug.)
Analyses requiring historical data can still reload it from databases/dumps as required, and the max velocity of your data insertion/(de)serialization becomes far less impactful on the speed of your scan.
from pogom.
SQLite causes too much of a bottleneck to run an efficient number of accounts (at least on my POS box). I would love to see MySQL implementation.
from pogom.
I already added MySQL support on my fork (I didn't push the changes, though. Sorry!). I simply changed line 7 SqliteDatabase
with MySQLDatabase
, and changed lines 15-19 on models.py with the following:
db = MySQLDatabase('database_name', user='user', passwd='password', host='localhost')
(Adjust the options according to your system)
You'll also need to install PyMySQL (pip install PyMySQL
) and have a database with database_name
(or whatever you want) created on your MySQL/MariaDB instance.
from pogom.
@lisandro52 Is the performance better with MySql?
from pogom.
@nborrmann I couldn't say, actually, because I'm using no more than 10 accounts. I added MySQL because I wanted to keep the data on something else that wasn't a file and be able to better share the data with other instances of pogom.
from pogom.
PERFECT!!!
BTW, the tables created by pogom do not play well with the tables created by pokemongomap (AAHHH...), so creating a new DB is a necessity.
from pogom.
@MrE81 That's odd, I've been using pogom to gather the data (two instances), and PokemonGo-Map to display it, both sharing the same MySQL DB, and it's working great.
from pogom.
I just profiled it. A worker thread spends about 5-7% of the time writing to the database. So this really seems not to be a huge performance benefit.
ncalls tottime percall cumtime percall filename:lineno(function)
690 49.620 0.072 49.620 0.072 {method 'read' of '_ssl._SSLSocket' objects}
22 13.482 0.613 13.482 0.613 {time.sleep}
103 4.086 0.040 7.583 0.074 C:\pogom\pogom\models.py:105(parse_map)
162 2.883 0.018 2.888 0.018 {method 'execute' of 'sqlite3.Cursor' objects}
4349 1.796 0.000 1.796 0.000 {method 'acquire' of 'thread.lock' objects}
22 1.046 0.048 1.046 0.048 {method 'do_handshake' of '_ssl._SSLSocket' objects}
from pogom.
@lisandro52 I am far from a SQL guru, I am barely a novice, but my guess would be that reading the data via PokemonGo-Map might be more accommodating than trying to write to the tables created by same using pogom. Of course, I didn't put much work into it, I just saw the updates freeze up when I tried to use the same database, with no mons showing on the map, so I quickly created a new map.
from pogom.
@MrE81 You're totally right on that. But what I forgot to say is that the DB I'm using with pogom was originally created by the PokemonGo-Map worker, and later reused by pogom.
from pogom.
Traceback (most recent call last):
File "runserver.py", line 13, in
from pogom.app import Pogom
File "/root/pogom/pogom/app.py", line 17, in
from .models import Pokemon, Gym, Pokestop
File "/root/pogom/pogom/models.py", line 23
log = logging.getLogger(name)
^
=/
from pogom.
@lisandro52 Can you explain how you're using PokemonGo-Map to display the pokemon? I'm trying to run a server only with the PokemonGo-Map for visualization using the data collected from Pogom. Pogom is writing to MySQL and PokemonGo-Map is pointed to MySQL. But no pokemon are showing up on the map. Although, the stats function is working fine...
from pogom.
@vinsilsim I'm so sorry for answering so late. That line on models.py
looks odd. Instead of log = logging.getLogger(name)
it should be log = logging.getLogger(__name__)
@diputz42 That's strange... If the stats page is doing fine, it's probably something else. Have you run all the steps to install the PokeMap? (grunt build, for example). Like I said here, or another issue, it was pretty plug&play: started pogom without the webserver -> started PokemonGo-Map -> that's it. If you are still having trouble with that, I'd be happy to help you, just send me a PM.
from pogom.
@lisandro52 I got it working now, but thanks for the offer! The community here has been great. I cloned the latest release of PoGoMap. I was previously running a dev build. Seems pogom and PoGoMap have slightly different field names and settings in the data tables. I had to create a new DB with pogom, copy all rows from my old DB over, add a couple columns, and now PoGoMap and pogom play nicely. It didn't seem to work the other way around for me, which is how I understand you did it.
from pogom.
from pogom.
Related Issues (20)
- Geographically Separated Scans: How is Pogom handling this? HOT 2
- Adding accounts no longer decreasing scan time. HOT 2
- [REQUEST] Enable/Disable scanning of Location
- [REQUEST] Edit Location on map
- PoC: use of Redis as backend, drop relational database HOT 4
- PTC Login Failed HOT 2
- Launch it on a server HOT 7
- Only update new Pokemons etc
- I cannot add spots HOT 1
- New API don't block pogom? HOT 9
- PTC Login failed
- Edit spawnpoint markers
- Can't delete or change location with iPokeGo HOT 1
- map.js - spot removal issue
- [Captcha update] all scanner die HOT 8
- Implementing the new api into the Scanner HOT 96
- I Am having Issues
- Getting continuous string of errors saying: Received empty map_object response. Logging out and retrying. HOT 4
- ImportError: cannot import name 'izip'
- New version available ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pogom.