Documentation ¶
Index ¶
- Constants
- Variables
- func GetDefaultTaskProcessInterval(resourceName v1.ResourceName) (t time.Duration, err error)
- func HistogramOptionsFactory(resourceName v1.ResourceName) (vpautil.HistogramOptions, error)
- type HistogramTask
- func (t *HistogramTask) AddRangeSample(firstSampleTime, lastSampleTime time.Time, sampleValue float64, ...)
- func (t *HistogramTask) AddSample(sampleTime time.Time, sampleValue float64, sampleWeight float64)
- func (t *HistogramTask) IsTimeoutNotExecute() bool
- func (t *HistogramTask) QueryPercentileValue(ctx context.Context, percentile float64) (float64, error)
- func (t *HistogramTask) Run(ctx context.Context, datasourceProxy *datasource.Proxy) (nextRunInterval time.Duration, err error)
- type ProcessConfig
Constants ¶
View Source
const ( // DefaultSampleWeight is the default weight of any sample (prior to including decaying factor) DefaultSampleWeight = float64(1) // DefaultMinSampleWeight is the minimal sample weight of any sample (prior to including decaying factor) DefaultMinSampleWeight = float64(0.1) // DefaultEpsilon is the minimal weight kept in histograms, it should be small enough that old samples // (just inside MemoryAggregationWindowLength) added with DefaultMinSampleWeight are still kept DefaultEpsilon = 0.001 * DefaultMinSampleWeight // DefaultHistogramBucketSizeGrowth is the default value for HistogramBucketSizeGrowth. DefaultHistogramBucketSizeGrowth = 0.05 // Make each bucket 5% larger than the previous one. // DefaultCPUHistogramMaxValue CPU histograms max bucket size is 1000.0 cores DefaultCPUHistogramMaxValue = 1000.0 // DefaultCPUHistogramFirstBucketSize CPU histograms smallest bucket size is 0.01 cores DefaultCPUHistogramFirstBucketSize = 0.01 // DefaultMemHistogramMaxValue Mem histograms max bucket size is 1TB DefaultMemHistogramMaxValue = 1e12 // DefaultMemHistogramFirstBucketSize Mem histograms smallest bucket size is 10MB DefaultMemHistogramFirstBucketSize = 1e7 DefaultCPUTaskProcessInterval = time.Minute * 10 DefaultMemTaskProcessInterval = time.Hour * 1 // DefaultHistogramDecayHalfLife is the default value for HistogramDecayHalfLife. DefaultHistogramDecayHalfLife = time.Hour * 24 // DefaultInitDataLength is default data query span for the first run of the task DefaultInitDataLength = time.Hour * 25 // MaxOfAllowNotExecutionTime is maximum non-run tolerance time for a task MaxOfAllowNotExecutionTime = 50 * time.Hour )
View Source
const (
ProcessConfigHalfLifeKey = "decayHalfLife"
)
Variables ¶
View Source
var ( DataPreparingErr = errors.New("data preparing") SampleExpirationErr = errors.New("no samples in the last 24 hours") InsufficientSampleErr = errors.New("The data sample is insufficient to obtain the predicted value") QuerySamplesIsEmptyErr = errors.New("the sample found is empty") HistogramTaskRunPanicErr = errors.New("histogram task run panic") )
Functions ¶
func GetDefaultTaskProcessInterval ¶
func GetDefaultTaskProcessInterval(resourceName v1.ResourceName) (t time.Duration, err error)
func HistogramOptionsFactory ¶
func HistogramOptionsFactory(resourceName v1.ResourceName) (vpautil.HistogramOptions, error)
Types ¶
type HistogramTask ¶
type HistogramTask struct { ProcessInterval time.Duration // contains filtered or unexported fields }
func NewTask ¶
func NewTask(metric datasourcetypes.Metric, config processortypes.TaskConfigStr) (*HistogramTask, error)
func (*HistogramTask) AddRangeSample ¶
func (t *HistogramTask) AddRangeSample(firstSampleTime, lastSampleTime time.Time, sampleValue float64, sampleWeight float64)
func (*HistogramTask) AddSample ¶
func (t *HistogramTask) AddSample(sampleTime time.Time, sampleValue float64, sampleWeight float64)
func (*HistogramTask) IsTimeoutNotExecute ¶
func (t *HistogramTask) IsTimeoutNotExecute() bool
func (*HistogramTask) QueryPercentileValue ¶
func (*HistogramTask) Run ¶
func (t *HistogramTask) Run(ctx context.Context, datasourceProxy *datasource.Proxy) (nextRunInterval time.Duration, err error)
type ProcessConfig ¶
func GetTaskConfig ¶
func GetTaskConfig(extensions processortypes.TaskConfigStr) (*ProcessConfig, error)
Click to show internal directories.
Click to hide internal directories.