- Clone this repo
- Install python, pip, elasticsearch, redis
- pip install virtualenv
- Instantiate a virtual environment
- Run
pip install -r requirements.txt
ic.create(index='spire')
ic.put_mapping(index='spire', doc_type='query', body={"query":{"properties":{"start":{"type":"date"}}}})
ic.put_mapping(index='spire', doc_type='query', body={"query":{"properties":{"end":{"type":"date"}}}})
ic.put_mapping(index='spire', doc_type='query', body={"query":{"properties":{"date":{"type":"date", "format":"date"}}}})
- Start Elasticsearch server
elasticsearch
- Start Redis Server
redis-server
- Start the celery worker
celery -A main.celery worker
in virtual environment - Run
python main.py
in virtual environment
select a.id as id, a.owner as owner, a.name as name, b.name as parent_name, a.statement as statement, a.start_ts as start_ts, a.heartbeat_ts as end_ts from ( select id, parent, owner, name, statement, start_ts, heartbeat_ts from hp_query where result=0 and parent is not null and statement not like 'explain %' and start_ts>=unix_timestamp($DATE(-28), 'yyyy-MM-dd') ) a join ( select id, name from hp_query where parent is null ) b on a.parent=b.id