update WriteSeries signature

pull/1298/head
Cory LaNou 2015-01-13 10:09:29 -07:00
parent 733110d4c7
commit a654e6e662
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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) {