Skip to content

Commit

Permalink
Merge pull request kubernetes#201 from vishh/influxdb_batch_issue
Browse files Browse the repository at this point in the history
Set 'time' column in InfluxDB driver
  • Loading branch information
monnand committed Aug 28, 2014
2 parents 221ef43 + 9bf831a commit 4706361
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/influxdb/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type influxdbStorage struct {
}

const (
colTimestamp string = "timestamp"
colTimestamp string = "time"
colMachineName string = "machine"
colContainerName string = "container_name"
colCpuCumulativeUsage string = "cpu_cumulative_usage"
Expand Down Expand Up @@ -67,7 +67,7 @@ func (self *influxdbStorage) containerStatsToValues(

// Timestamp
columns = append(columns, colTimestamp)
values = append(values, stats.Timestamp.Format(time.RFC3339Nano))
values = append(values, stats.Timestamp.Unix())

// Machine name
columns = append(columns, colMachineName)
Expand Down Expand Up @@ -274,7 +274,7 @@ func (self *influxdbStorage) AddStats(ref info.ContainerReference, stats *info.C
}
}()
if len(seriesToFlush) > 0 {
err := self.client.WriteSeries(seriesToFlush)
err := self.client.WriteSeriesWithTimePrecision(seriesToFlush, influxdb.Second)
if err != nil {
return fmt.Errorf("failed to write stats to influxDb - %s", err)
}
Expand Down

0 comments on commit 4706361

Please sign in to comment.