mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +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 (
 | 
					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
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user