ing
This commit is contained in:
parent
0052da555c
commit
f330a9f4f5
|
@ -28,7 +28,7 @@ type CollectorService struct {
|
||||||
ocsp.CollectorService
|
ocsp.CollectorService
|
||||||
cda.TypeAnnotation `annotation:"@overflow:RPCService()"`
|
cda.TypeAnnotation `annotation:"@overflow:RPCService()"`
|
||||||
|
|
||||||
ProbeClientService *ProbeClientService `annotation:"@Inject()"`
|
ProbeService *ProbeService `annotation:"@Inject()"`
|
||||||
CrawlerService *CrawlerService `annotation:"@Inject()"`
|
CrawlerService *CrawlerService `annotation:"@Inject()"`
|
||||||
SensorConfigService *SensorConfigService `annotation:"@Inject()"`
|
SensorConfigService *SensorConfigService `annotation:"@Inject()"`
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ func (s *CollectorService) collectTask(sensorConfig *ocmsc.SensorConfig) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := s.ProbeClientService.Send("DataService.Metric", result); nil != err {
|
if err := s.ProbeService.Send("DataService.Metric", result); nil != err {
|
||||||
logging.Logger().Errorf("Cannot send data from config id[%s] of crawler[%s] %v", sensorConfig.ConfigID, sensorConfig.Crawler.Name, err)
|
logging.Logger().Errorf("Cannot send data from config id[%s] of crawler[%s] %v", sensorConfig.ConfigID, sensorConfig.Crawler.Name, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,35 +11,35 @@ import (
|
||||||
_ "git.loafle.net/overflow/commons-go/core/annotation"
|
_ "git.loafle.net/overflow/commons-go/core/annotation"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ProbeClientServiceType = reflect.TypeOf((*ProbeClientService)(nil))
|
var ProbeServiceType = reflect.TypeOf((*ProbeService)(nil))
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cdr.RegisterType(ProbeClientServiceType)
|
cdr.RegisterType(ProbeServiceType)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProbeClientService struct {
|
type ProbeService struct {
|
||||||
cda.TypeAnnotation `annotation:"@overflow:RPCService()"`
|
cda.TypeAnnotation `annotation:"@overflow:RPCService()"`
|
||||||
|
|
||||||
Client *crc.Client `annotation:"@Resource(name='CONTAINER_CLIENT')"`
|
Client *crc.Client `annotation:"@Resource(name='CONTAINER_CLIENT')"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProbeClientService) InitService() error {
|
func (s *ProbeService) InitService() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProbeClientService) StartService() error {
|
func (s *ProbeService) StartService() error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProbeClientService) StopService() {
|
func (s *ProbeService) StopService() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProbeClientService) DestroyService() {
|
func (s *ProbeService) DestroyService() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProbeClientService) Send(method string, params ...interface{}) error {
|
func (s *ProbeService) Send(method string, params ...interface{}) error {
|
||||||
return s.Client.Send(method, params...)
|
return s.Client.Send(method, params...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import "reflect"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
OrderedServices = []reflect.Type{
|
OrderedServices = []reflect.Type{
|
||||||
ProbeClientServiceType,
|
ProbeServiceType,
|
||||||
SensorConfigServiceType,
|
SensorConfigServiceType,
|
||||||
CrawlerServiceType,
|
CrawlerServiceType,
|
||||||
CollectorServiceType,
|
CollectorServiceType,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user