Quit value-less requests as soon as possible

pull/1465/head
Philip O'Toole 2015-01-30 22:59:52 -08:00
parent 237a04e5c2
commit 9846f05edf
1 changed files with 5 additions and 5 deletions

View File

@ -1371,6 +1371,11 @@ func (s *Server) WriteSeries(database, retentionPolicy string, points []Point) (
}
name, tags, timestamp, values := points[0].Name, points[0].Tags, points[0].Timestamp, points[0].Values
// Ignore requests that have no values.
if len(values) == 0 {
return 0, nil
}
// Find the id for the series and tagset
seriesID, err := s.createSeriesIfNotExists(database, name, tags)
if err != nil {
@ -1405,11 +1410,6 @@ func (s *Server) WriteSeries(database, retentionPolicy string, points []Point) (
// Find appropriate shard within the shard group.
sh := g.ShardBySeriesID(seriesID)
// Ignore requests that have no values.
if len(values) == 0 {
return 0, nil
}
// Convert string-key/values to fieldID-key/values.
// If not all fields can be converted then send as a non-raw write series.
rawValues := m.mapValues(values)