Changed data window size to 2m in Initial Resources

It fixes the issue with delayed data after #14559 is merged
This commit is contained in:
Piotr Szczesniak 2015-10-05 16:05:42 +02:00
parent 26be3c3b95
commit 1a641027d2
2 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ var (
const ( const (
initialResourcesAnnotation = "kubernetes.io/initial-resources" initialResourcesAnnotation = "kubernetes.io/initial-resources"
samplesThreshold = 60 samplesThreshold = 30
week = 7 * 24 * time.Hour week = 7 * 24 * time.Hour
month = 30 * 24 * time.Hour month = 30 * 24 * time.Hour
) )

View File

@ -27,10 +27,10 @@ import (
) )
const ( const (
cpuSeriesName = "autoscaling.cpu.usage.1m" cpuSeriesName = "autoscaling.cpu.usage.2m"
memSeriesName = "autoscaling.memory.usage.1m" memSeriesName = "autoscaling.memory.usage.2m"
cpuContinuousQuery = "select derivative(value) as value from \"cpu/usage_ns_cumulative\" where pod_id <> '' group by pod_id, pod_namespace, container_name, container_base_image, time(1m) into " + cpuSeriesName cpuContinuousQuery = "select derivative(value) as value from \"cpu/usage_ns_cumulative\" where pod_id <> '' group by pod_id, pod_namespace, container_name, container_base_image, time(2m) into " + cpuSeriesName
memContinuousQuery = "select mean(value) as value from \"memory/usage_bytes_gauge\" where pod_id <> '' group by pod_id, pod_namespace, container_name, container_base_image, time(1m) into " + memSeriesName memContinuousQuery = "select mean(value) as value from \"memory/usage_bytes_gauge\" where pod_id <> '' group by pod_id, pod_namespace, container_name, container_base_image, time(2m) into " + memSeriesName
timeFormat = "2006-01-02 15:04:05" timeFormat = "2006-01-02 15:04:05"
) )
@ -140,7 +140,7 @@ func (s *influxdbSource) GetUsagePercentile(kind api.ResourceName, perc int64, i
// TODO(pszczesniak): fix issue with dropped data base // TODO(pszczesniak): fix issue with dropped data base
if len(res) == 0 { if len(res) == 0 {
return 0, 0, fmt.Errorf("Missing series %v in InfluxDB", series) return 0, 0, fmt.Errorf("Missing data in series %v in InfluxDB", series)
} }
points := res[0].GetPoints() points := res[0].GetPoints()
if len(points) == 0 { if len(points) == 0 {