stat

package
v1.33.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectDistinctSourceSeries added in v1.33.0

func CollectDistinctSourceSeries(seriesList ...[]*pb.SourceSeries) []*pb.SourceSeries

CollectDistinctSourceSeries merges lists of SourceSeries. For same source series, the one with more data points is used. In most cases, this is the series with the latest data as well.

func FilterAndRank

func FilterAndRank(in *model.ObsTimeSeries, prop *model.StatObsProp)

FilterAndRank filters and ranks ObsTimeSeries in place.

func GetBestSeries

func GetBestSeries(
	in *pb.ObsTimeSeries,
	importName string,
	useLatest bool,
) (*pb.Series, *string)

GetBestSeries gets the best series for a collection of series with different metadata.

  • If "importName" is set, pick the series with the import name.
  • If "useLatest" is true, pick the series with latest date and set the second return value to be the latest date.

Note "importName" is preferred over "useLatest".

func GetStatAll

func GetStatAll(ctx context.Context, in *pb.GetStatAllRequest, store *store.Store) (
	*pb.GetStatAllResponse, error)

GetStatAll implements API for Mixer.GetStatAll.

func GetStatSeries

func GetStatSeries(
	ctx context.Context, in *pb.GetStatSeriesRequest, store *store.Store) (
	*pb.GetStatSeriesResponse, error)

GetStatSeries implements API for Mixer.GetStatSeries. TODO(shifucun): consilidate and dedup the logic among these similar APIs.

func GetStatSet

func GetStatSet(ctx context.Context, in *pb.GetStatSetRequest, store *store.Store) (
	*pb.GetStatSetResponse, error)

GetStatSet implements API for Mixer.GetStatSet.

func GetStatSetSeries

func GetStatSetSeries(ctx context.Context, in *pb.GetStatSetSeriesRequest, store *store.Store) (
	*pb.GetStatSetSeriesResponse, error)

GetStatSetSeries implements API for Mixer.GetStatSetSeries.

func GetStatSetSeriesWithinPlace

func GetStatSetSeriesWithinPlace(
	ctx context.Context, in *pb.GetStatSetSeriesWithinPlaceRequest, store *store.Store) (
	*pb.GetStatSetSeriesResponse, error,
)

GetStatSetSeriesWithinPlace implements API for Mixer.GetStatSetSeriesWithinPlace.

func GetStatSetWithinPlace

func GetStatSetWithinPlace(
	ctx context.Context, in *pb.GetStatSetWithinPlaceRequest, store *store.Store) (
	*pb.GetStatSetResponse, error,
)

GetStatSetWithinPlace implements API for Mixer.GetStatSetWithinPlace.

func GetStatSetWithinPlaceAll

func GetStatSetWithinPlaceAll(
	ctx context.Context, in *pb.GetStatSetWithinPlaceRequest, store *store.Store) (
	*pb.GetStatSetAllResponse, error,
)

GetStatSetWithinPlaceAll implements API for Mixer.GetStatSetWithinPlaceAll.

func GetStatValue

func GetStatValue(ctx context.Context, in *pb.GetStatValueRequest, store *store.Store) (
	*pb.GetStatValueResponse, error)

GetStatValue implements API for Mixer.GetStatValue.

func GetStats

func GetStats(ctx context.Context, in *pb.GetStatsRequest, store *store.Store) (
	*pb.GetStatsResponse, error)

GetStats implements API for Mixer.GetStats.

func ReadStatCollection added in v1.33.0

func ReadStatCollection(
	ctx context.Context,
	btGroup *bigtable.Group,
	rowList cbt.RowList,
	keyTokens map[string]string) (
	map[string]*pb.ObsCollection, error)

ReadStatCollection reads and process ObsCollection cache from BigTable in parallel.

func ReadStats added in v1.33.0

func ReadStats(
	ctx context.Context,
	btGroup *bigtable.Group,
	rowList cbt.RowList,
	keyTokens map[string]*util.PlaceStatVar) (
	map[string]map[string]*model.ObsTimeSeries, error)

ReadStats reads and process BigTable rows in parallel. Consider consolidate this function and bigTableReadRowsParallel.

func ReadStatsPb added in v1.33.0

func ReadStatsPb(
	ctx context.Context,
	btGroup *bigtable.Group,
	rowList cbt.RowList,
	keyTokens map[string]*util.PlaceStatVar) (
	map[string]map[string]*pb.ObsTimeSeries, error)

ReadStatsPb reads and process BigTable rows in parallel. Consider consolidate this function and bigTableReadRowsParallel.

func TokenFn added in v1.33.0

func TokenFn(
	keyTokens map[string]*util.PlaceStatVar) func(rowKey string) (string, error)

TokenFn generates a function that convert row key to token string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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