diff options
author | Gustavo Duarte <gustavo@HPgus.(none)> | 2013-02-11 14:50:08 (GMT) |
---|---|---|
committer | Gustavo Duarte <gustavo@HPgus.(none)> | 2013-02-11 14:50:08 (GMT) |
commit | c1f8a4fdde9207ca21d6662738028894ecd92800 (patch) | |
tree | 715e418b9c68b8d25128c20bdbeaf3c12f151ab7 | |
parent | 1978034bc7ff892b83b23097715194239a2d6b95 (diff) |
adding testing files
-rw-r--r--[-rwxr-xr-x] | sql/make_report | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | sql/report.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | sugar_stats_consolidation/consolidation_run | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | sugar_stats_consolidation/run.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/create-act.py | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/create.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/populate-act.py | 0 | ||||
-rw-r--r-- | test/test_cons.py | 13 | ||||
-rw-r--r-- | test/test_db.py | 6 | ||||
-rw-r--r-- | test/test_rrd.py | 52 | ||||
-rw-r--r-- | test/test_rrds_content.py | 31 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport_act.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport_bud.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport_inst.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport_new.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport_resumed.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | test/xport_uptime.sh | 0 |
18 files changed, 102 insertions, 0 deletions
diff --git a/sql/make_report b/sql/make_report index 7dc6805..7dc6805 100755..100644 --- a/sql/make_report +++ b/sql/make_report diff --git a/sql/report.sh b/sql/report.sh index 0a01ec0..0a01ec0 100755..100644 --- a/sql/report.sh +++ b/sql/report.sh diff --git a/sugar_stats_consolidation/consolidation_run b/sugar_stats_consolidation/consolidation_run index 46b676d..46b676d 100755..100644 --- a/sugar_stats_consolidation/consolidation_run +++ b/sugar_stats_consolidation/consolidation_run diff --git a/sugar_stats_consolidation/run.sh b/sugar_stats_consolidation/run.sh index 8e0e31e..8e0e31e 100755..100644 --- a/sugar_stats_consolidation/run.sh +++ b/sugar_stats_consolidation/run.sh diff --git a/test/create-act.py b/test/create-act.py index 2147b35..2147b35 100755..100644 --- a/test/create-act.py +++ b/test/create-act.py diff --git a/test/create.sh b/test/create.sh index 358d6c0..358d6c0 100755..100644 --- a/test/create.sh +++ b/test/create.sh diff --git a/test/populate-act.py b/test/populate-act.py index c4877b0..c4877b0 100755..100644 --- a/test/populate-act.py +++ b/test/populate-act.py diff --git a/test/test_cons.py b/test/test_cons.py new file mode 100644 index 0000000..f58f9fc --- /dev/null +++ b/test/test_cons.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import sugar_stats_consolidation +from sugar_stats_consolidation.db import * +from sugar_stats_consolidation.rrd_files import * +from sugar_stats_consolidation.consolidation import * + +db = DB_Stats('statistics', 'root', 'gustavo') +db.create(); + +con = Consolidation('/var/lib/sugar-stats/rrd', db) + +con.process_rrds() diff --git a/test/test_db.py b/test/test_db.py new file mode 100644 index 0000000..197510a --- /dev/null +++ b/test/test_db.py @@ -0,0 +1,6 @@ +import stats_consolidation +from stats_consolidation import * + +db = DB_Stats('statistics', 'root', 'gustavo') +db.create(); + diff --git a/test/test_rrd.py b/test/test_rrd.py new file mode 100644 index 0000000..81dd3c8 --- /dev/null +++ b/test/test_rrd.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +import argparse +from db import * +from rrd_files import * +from db import * + +parser = argparse.ArgumentParser() +parser.add_argument('--rrd_path',required=False) +parser.add_argument('--rrd_name',required=True) + +args = parser.parse_args() + +print "============================== TEST RRD -> Relational DB ========================================" +db = DB_Stats('statistics', 'root', 'gustavo') +db.create() + +DATE_START =datetime(year=2012, + month=12, + day=13, + hour=0, + minute=0, + second=0).strftime("%s") + + +DATE_END = datetime(year=2012, + month=12, + day=14, + hour=0, + minute=0, + second=0).strftime("%s") + +DATE_START = db.get_date_last_record() +DATE_END = datetime.now().strftime("%s") + +act_rrd = RRD (path = "/home/gustavo/AC/consolidation/rrds", name=args.rrd_name) +""" +act_rrd = RRD (path = "/home/gustavo/AC/consolidation/rrds", name="abacus.rrd", date_start=DATE_START, date_end=DATE_END) +""" +""" +act_rrd.show_valid_ds("resumed") +act_rrd.show_valid_ds("new") +act_rrd.show_valid_ds("instances") +act_rrd.show_valid_ds("buddies") +data = {} +db.store_activity_uptime(act_rrd) +""" +act_rrd.show_valid_ds("uptime") +act_rrd.show_valid_ds("active") + +act_rrd.get_uptime_by_interval() +act_rrd.get_active_by_interval() diff --git a/test/test_rrds_content.py b/test/test_rrds_content.py new file mode 100644 index 0000000..df6c99e --- /dev/null +++ b/test/test_rrds_content.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import argparse +from rrd_files import * + +parser = argparse.ArgumentParser() +parser.add_argument('--rrd_path',required=False) +parser.add_argument('--rrd_name',required=True) + +args = parser.parse_args() + +print "============================== TEST RRD analyze content ========================================" + +if args.rrd_path == None: + def_path = "/home/olpc/.sugar/default/stats" +else: + def_path = args.rrd_path + +rrd = RRD (path=def_path, name=args.rrd_name) + +""" +act_rrd.show_valid_ds("resumed") +act_rrd.show_valid_ds("new") +act_rrd.show_valid_ds("instances") +act_rrd.show_valid_ds("buddies") +""" +rrd.show_valid_ds("uptime") +rrd.show_valid_ds("active") + +rrd.get_uptime_by_interval() +rrd.get_active_by_interval() diff --git a/test/xport.sh b/test/xport.sh index 97e03ee..97e03ee 100755..100644 --- a/test/xport.sh +++ b/test/xport.sh diff --git a/test/xport_act.sh b/test/xport_act.sh index 4e69338..4e69338 100755..100644 --- a/test/xport_act.sh +++ b/test/xport_act.sh diff --git a/test/xport_bud.sh b/test/xport_bud.sh index 8fceaf5..8fceaf5 100755..100644 --- a/test/xport_bud.sh +++ b/test/xport_bud.sh diff --git a/test/xport_inst.sh b/test/xport_inst.sh index 12e6872..12e6872 100755..100644 --- a/test/xport_inst.sh +++ b/test/xport_inst.sh diff --git a/test/xport_new.sh b/test/xport_new.sh index 95213b3..95213b3 100755..100644 --- a/test/xport_new.sh +++ b/test/xport_new.sh diff --git a/test/xport_resumed.sh b/test/xport_resumed.sh index 18a97d4..18a97d4 100755..100644 --- a/test/xport_resumed.sh +++ b/test/xport_resumed.sh diff --git a/test/xport_uptime.sh b/test/xport_uptime.sh index f034749..f034749 100755..100644 --- a/test/xport_uptime.sh +++ b/test/xport_uptime.sh |