update WriteSeries signature
parent
733110d4c7
commit
a654e6e662
|
@ -16,7 +16,7 @@ const DefaultPort = 25826
|
|||
|
||||
// SeriesWriter defines the interface for the destination of the data.
|
||||
type SeriesWriter interface {
|
||||
WriteSeries(database, retentionPolicy, name string, tags map[string]string, timestamp time.Time, values map[string]interface{}) error
|
||||
WriteSeries(database, retentionPolicy, name string, tags map[string]string, timestamp time.Time, values map[string]interface{}) (uint64, error)
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
|
@ -115,7 +115,7 @@ func (s *Server) handleMessage(buffer []byte) {
|
|||
var values = make(map[string]interface{})
|
||||
values[m.Name] = m.Value
|
||||
|
||||
err := s.writer.WriteSeries(s.Database, "", m.Name, m.Tags, m.Timestamp, values)
|
||||
_, err := s.writer.WriteSeries(s.Database, "", m.Name, m.Tags, m.Timestamp, values)
|
||||
if err != nil {
|
||||
log.Printf("Collectd cannot write data: %s", err)
|
||||
continue
|
||||
|
|
|
@ -22,7 +22,7 @@ type serverResponse struct {
|
|||
|
||||
var responses = make(chan *serverResponse, 1024)
|
||||
|
||||
func (testServer) WriteSeries(database, retentionPolicy, name string, tags map[string]string, timestamp time.Time, values map[string]interface{}) error {
|
||||
func (testServer) WriteSeries(database, retentionPolicy, name string, tags map[string]string, timestamp time.Time, values map[string]interface{}) (uint64, error) {
|
||||
responses <- &serverResponse{
|
||||
database: database,
|
||||
retentionPolicy: retentionPolicy,
|
||||
|
@ -31,7 +31,7 @@ func (testServer) WriteSeries(database, retentionPolicy, name string, tags map[s
|
|||
timestamp: timestamp,
|
||||
values: values,
|
||||
}
|
||||
return nil
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func TestServer_ListenAndServe_ErrBindAddressRequired(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue