get
This commit is contained in:
parent
6b0730f636
commit
9815ccc84b
38
collector.go
38
collector.go
|
@ -12,7 +12,9 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
//crm "loafle.com/overflow/crawler_manager_go"
|
crm "loafle.com/overflow/crawler_manager_go"
|
||||||
|
"context"
|
||||||
|
g "loafle.com/overflow/crawler_go/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CONFIG_ROOT = "/config/container"
|
const CONFIG_ROOT = "/config/container"
|
||||||
|
@ -48,24 +50,24 @@ func (c *Collector) collect(id string) {
|
||||||
|
|
||||||
log.Printf("COLLECT %s - [ID: %s] [Crawler : %s]", time.Now(), conf.Id, conf.Crawler.Name)
|
log.Printf("COLLECT %s - [ID: %s] [Crawler : %s]", time.Now(), conf.Id, conf.Crawler.Name)
|
||||||
|
|
||||||
//conn, err := crm.GetClient(conf.Crawler.Container)
|
conn, err := crm.GetInstance().GetClient(conf.Crawler.Container)
|
||||||
//if err != nil {
|
if err != nil {
|
||||||
// log.Println(err)
|
log.Println(err)
|
||||||
//}
|
}
|
||||||
//defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
//dc := g.NewDataClient(conn);
|
dc := g.NewDataClient(conn);
|
||||||
//in := &g.Input{}
|
in := &g.Input{}
|
||||||
//
|
|
||||||
//in.Id = id
|
in.Id = id
|
||||||
//in.Name = g.Crawlers_HEALTH_MONGODB
|
in.Name = g.Crawlers(g.Crawlers_value[conf.Crawler.Name])
|
||||||
//
|
|
||||||
//out, err := dc.Get(context.Background(), in)
|
out, err := dc.Get(context.Background(), in)
|
||||||
//
|
|
||||||
//if err != nil {
|
if err != nil {
|
||||||
// log.Println(err)
|
log.Println(err)
|
||||||
//}
|
}
|
||||||
//log.Println(out)
|
log.Println(out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) AddSensor(path string) {
|
func (c *Collector) AddSensor(path string) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user