Fix errors
This commit is contained in:
parent
fb529130e9
commit
a4687f52b1
|
@ -9,14 +9,13 @@ import (
|
||||||
|
|
||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
"context"
|
||||||
|
|
||||||
"github.com/FreifunkBremen/yanic/database"
|
"github.com/FreifunkBremen/yanic/database"
|
||||||
"github.com/FreifunkBremen/yanic/runtime"
|
"github.com/FreifunkBremen/yanic/runtime"
|
||||||
"gopkg.in/olivere/elastic.v5"
|
"gopkg.in/olivere/elastic.v5"
|
||||||
|
|
||||||
|
|
||||||
"context"
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Connection struct {
|
type Connection struct {
|
||||||
|
@ -63,9 +62,9 @@ func Connect(configuration interface{}) (database.Connection, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (conn *Connection) InsertNode(node *runtime.Node) {
|
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").
|
Index("ffhb").
|
||||||
Type("node").
|
Type("node").
|
||||||
BodyJson(node).
|
BodyJson(node).
|
||||||
|
@ -80,13 +79,12 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (conn *Connection) InsertGlobals(stats *runtime.GlobalStats, time time.Time) {
|
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))
|
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").
|
Index("ffhb").
|
||||||
Type("globals").
|
Type("globals").
|
||||||
BodyJson(stats).
|
BodyJson(stats).
|
||||||
|
|
Loading…
Reference in New Issue