From de2ea4ed9dd39feb554b1e8110e9d56dd6b2809b Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Tue, 10 Oct 2017 09:55:25 -0700 Subject: [PATCH] Add aggregator to watcher --- cmd/watcher/main.go | 8 ++++++++ ops/aggregator.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/cmd/watcher/main.go b/cmd/watcher/main.go index 3abad58..2960139 100644 --- a/cmd/watcher/main.go +++ b/cmd/watcher/main.go @@ -6,6 +6,8 @@ import ( "github.com/kcotugno/tacitus/ops" "github.com/kcotugno/tacitus/osutil" "github.com/kcotugno/tacitus/postgres" + + "time" ) func main() { @@ -35,6 +37,12 @@ func main() { return } + a := ops.Aggregator{} + a.Database = db + a.Logger = logger + a.Products = []string{"ETH-USD", "BTC-USD"} + a.Start(30 * time.Second) + v := validator{} v.db = db v.logger = logger diff --git a/ops/aggregator.go b/ops/aggregator.go index 56e0d38..963fb51 100644 --- a/ops/aggregator.go +++ b/ops/aggregator.go @@ -83,6 +83,8 @@ func (a *Aggregator) aggregate(product string, interval time.Duration) { if err != nil { a.Logger.Info(`aggregator: database error="%v"`, err) } + + a.Logger.Info(`aggregator: DONE product="%v" interval="%v"`, product, interval) } func (a *Aggregator) Stop() {