dfiter

package
v0.0.0-...-a96dc21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package dfiter efficiently creates dataframes used in regression detection.

Index

Constants

This section is empty.

Variables

View Source
var ErrInsufficientData = errors.New("insufficient data")

ErrInsufficientData is returned by the DataFrameIterator if all the queries compeleted successfully, but there wasn't enough data to continue.

Functions

This section is empty.

Types

type DataFrameIterator

type DataFrameIterator interface {
	Next() bool
	Value(ctx context.Context) (*dataframe.DataFrame, error)
}

DataFrameIterator is an iterator that produces DataFrames.

for it.Next() {
  df, err := it.Value(ctx)
  // Do something with df.
}

func NewDataFrameIterator

func NewDataFrameIterator(
	ctx context.Context,
	progress progress.Progress,
	dfBuilder dataframe.DataFrameBuilder,
	perfGit perfgit.Git,
	regressionStateCallback types.ProgressCallback,
	queryAsString string,
	domain types.Domain,
	alert *alerts.Alert,
	anomalyConfig config.AnomalyConfig,
) (DataFrameIterator, error)

NewDataFrameIterator returns a DataFrameIterator that produces a set of dataframes for the given query, domain, and alert.

If domain.Offset is non-zero then we want the iterator to return a single dataframe of alert.Radius around the specified commit. Otherwise it returns a series of dataframes of size 2*alert.Radius+1 sliced from a single dataframe of size domain.N.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL