From a4687f52b17886c315aeac84175bca517d939092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Wed, 19 Apr 2017 23:17:52 +0200 Subject: [PATCH] Fix errors --- database/elasticsearch/elasticsearch.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/database/elasticsearch/elasticsearch.go b/database/elasticsearch/elasticsearch.go index 55bb828..3533ff6 100644 --- a/database/elasticsearch/elasticsearch.go +++ b/database/elasticsearch/elasticsearch.go @@ -9,14 +9,13 @@ import ( "log" "time" + "context" "github.com/FreifunkBremen/yanic/database" "github.com/FreifunkBremen/yanic/runtime" "gopkg.in/olivere/elastic.v5" - "context" - ) type Connection struct { @@ -63,9 +62,9 @@ func Connect(configuration interface{}) (database.Connection, error) { } func (conn *Connection) InsertNode(node *runtime.Node) { - log("InsertNode: [", node.Statistics.NodeID, "] clients: ", node.Statistics.Clients.Total) + log.Print("InsertNode: [", node.Statistics.NodeID, "] clients: ", node.Statistics.Clients.Total) - _, err = conn.client.Index() + _, err := conn.client.Index(). Index("ffhb"). Type("node"). BodyJson(node). @@ -80,13 +79,12 @@ func (conn *Connection) InsertNode(node *runtime.Node) { } - } func (conn *Connection) InsertGlobals(stats *runtime.GlobalStats, time time.Time) { log.Print("InsertGlobals: [", time.String(), "] nodes: ", stats.Nodes, ", clients: ", stats.Clients, " models: ", len(stats.Models)) - _, err = conn.client.Index() + _, err := conn.client.Index(). Index("ffhb"). Type("globals"). BodyJson(stats).