This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Meact manage
zynzel edited this page Jul 17, 2016
·
1 revision
Manage is CLI tool to manage meact database.
Supported subcommands:
- create-db - Create meact database. It will remove old database
- sync-db-desc - Sync boards.yaml
- aggregate-metric - Aggregate historical metrics
- clean-action - Clean actions table (remove old records)
- clean-feed - Clean feeds table (remove old records)
Avarage environment can generate 300k records every week (15 boards, each board report 4 metrics every 120s).
Aggregate_metric parameters:
- start - seconds since epoch, we are interested in data >= start
- end - seconds since epoch, we are interested in data <= end
- policy - for what time period store data, 1 record per hour/day/week/month
- execute - do real data aggregation, by default (without this argument) aggregate_metric don't change database
Examples:
Store 1 sensor_type+board_id pair per hour for range [2 weeks ago - 1 week ago]
meact-manage --dir /root/meact/ aggregate-metric --start $(date +%s -d '2 weeks ago') --end $(date +%s -d '1 weeks ago') --execute --policy hour
Store 1 sensor_type+board_id pair per day for range [1 month ago - 2 weeks ago]
meact-manage --dir /root/meact/ aggregate-metric --start $(date +%s -d '1 months ago') --end $(date +%s -d '2 weeks ago') --execute --policy day