Exemple #1
0
func (s *Server) appendOpenTSDBService(c opentsdb.Config) error {
	if !c.Enabled {
		return nil
	}
	srv, err := opentsdb.NewService(c)
	if err != nil {
		return err
	}
	srv.PointsWriter = s.PointsWriter
	srv.MetaStore = s.MetaStore
	s.Services = append(s.Services, srv)
	return nil
}
Exemple #2
0
func (s *Server) appendOpenTSDBService(c opentsdb.Config) error {
	if !c.Enabled {
		return nil
	}
	l := s.LogService.NewStaticLevelLogger("[opentsdb] ", log.LstdFlags, wlog.INFO)
	srv, err := opentsdb.NewService(c)
	if err != nil {
		return err
	}
	srv.SetLogger(l)
	srv.PointsWriter = s.TaskMaster
	srv.MetaStore = s.MetaStore
	s.Services = append(s.Services, srv)
	return nil
}
Exemple #3
0
// NewService returns a new instance of Service.
func NewService(database string) *Service {
	srv, _ := opentsdb.NewService(opentsdb.Config{
		BindAddress:      "127.0.0.1:0",
		Database:         database,
		ConsistencyLevel: "one",
	})
	s := &Service{Service: srv}
	s.Service.PointsWriter = &s.PointsWriter
	s.Service.MetaClient = &DatabaseCreator{}

	if !testing.Verbose() {
		s.Logger = log.New(ioutil.Discard, "", log.LstdFlags)
	}

	return s
}