mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	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:
		@@ -39,7 +39,7 @@ var (
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	initialResourcesAnnotation = "kubernetes.io/initial-resources"
 | 
			
		||||
	samplesThreshold           = 60
 | 
			
		||||
	samplesThreshold           = 30
 | 
			
		||||
	week                       = 7 * 24 * time.Hour
 | 
			
		||||
	month                      = 30 * 24 * time.Hour
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
@@ -27,10 +27,10 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	cpuSeriesName      = "autoscaling.cpu.usage.1m"
 | 
			
		||||
	memSeriesName      = "autoscaling.memory.usage.1m"
 | 
			
		||||
	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
 | 
			
		||||
	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
 | 
			
		||||
	cpuSeriesName      = "autoscaling.cpu.usage.2m"
 | 
			
		||||
	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(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(2m) into " + memSeriesName
 | 
			
		||||
	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
 | 
			
		||||
	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()
 | 
			
		||||
	if len(points) == 0 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user