common

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomSubsetPerm

func GetRandomSubsetPerm(numItems int, totalItems int) ([]int, error)

GetRandomSubsetPerm returns a subset of numItems of a permutation of numbers from 0 to totalNumbers, e.g., 5 items out of 30. This is an alternative to rand.Perm and then taking a sub-slice, which used up a lot more memory and slowed down query generation significantly. The subset of the permutation should have no duplicates and thus, can not be longer that original set Ex.: 12, 7, 25 for numItems=3 and totalItems=30 (3 out of 30)

func PanicUnimplementedQuery

func PanicUnimplementedQuery(dg utils.QueryGenerator)

PanicUnimplementedQuery generates a panic for the provided query generator.

Types

type Core

type Core struct {
	// Interval is the entire time range of the dataset
	Interval *internalutils.TimeInterval

	// Scale is the cardinality of the dataset in terms of devices/hosts
	Scale int
}

Core is the common component of all generators for all systems

func NewCore

func NewCore(start, end time.Time, scale int) (*Core, error)

NewCore returns a new Core for the given time range and cardinality

Jump to

Keyboard shortcuts

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