Budget Dashboard for monitor and analysis
##Dashboard CI
Build | Status |
---|---|
Component |
##Developer Guide
- cd lib directory and run command below to install cherry-py:
python ez_setup.py CherryPy-3.2.0-py2.6.egg
- install python dependent package
easy_install cherrypy pytz importlib mysql-connector
- install mysql server
yinst i mysql_server
- create mysql database as you want, create a table named '5m_summary' with below schema
- copy
conf/app.cnf
to root directory then change$(db_host) $ (db_user) and $(db_schema) to customed value. - run start.sh in shell
- login http://hostname:4080 in browser
schema of table 5m_summary
+-----------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+----------+------+-----+---------+-------+
| time | datetime | NO | PRI | NULL | |
| mb_spend | double | YES | | NULL | |
| ss_spend | double | YES | | NULL | |
| bing_spend | double | YES | | 0 | |
| mb_spend_usd | double | YES | | NULL | |
| ss_spend_usd | double | YES | | NULL | |
| bing_spend_usd | double | YES | | 0 | |
| mb_budget | double | YES | | 0 | |
| ss_budget | double | YES | | 0 | |
| bing_only_spend | double | YES | | 0 | |
+-----------------+----------+------+-----+---------+-------+
Prepare test data for your own dev box
We have 3-day sample data (2017-03-27, 2017-04-02, 2017-04-03) for the major pmdb tables: 5m_summary, 5m_section,
revenue_triage, 5m_cmp_spend, 5m_cmp_spend_cumulative. To load them into your dev box pmdb, you need to:
- download sample data from PhazonBlue HDFS: /projects/cb_budget/yobudget/db/sample_data.zip
- unzip sample_data.zip on your pmdb host
- create test tables
mysql -u<db_user> -h<db_host> pmdb < create_tables.sql
- load sample data into tables
mysql -u<db_user> -h<db_host> -e "load data local infile '`pwd`/5m_summary' replace into table 5m_summary" pmdb
``` mysql -u -h -e "load data local infile '`pwd`/5m_section' replace into table 5m_section" pmdb ```
``` mysql -u -h -e "load data local infile '`pwd`/revenue_triage' replace into table revenue_triage" pmdb ```
``` mysql -u -h -e "load data local infile '`pwd`/5m_cmp_spend' replace into table 5m_cmp_spend" pmdb ```
``` mysql -u -h -e "load data local infile '`pwd`/5m_cmp_spend_cumulative' replace into table 5m_cmp_spend_cumulative" pmdb ```