mongodb

package
v0.0.0-...-b673533 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlatFormat       = "flat"
	KeyPairFormat    = "key-pair"
	TimeseriesFormat = "timeseries"
)

Variables

View Source
var DocumentFormat = FlatFormat
View Source
var MongoQueryPool sync.Pool = sync.Pool{
	New: func() interface{} {
		return &MongoQuery{
			HumanLabel:       []byte{},
			HumanDescription: []byte{},
			DatabaseName:     []byte{},
			CollectionName:   []byte{},
			BsonDoc:          []M{},

			MeasurementName: []byte{},
			FieldName:       []byte{},
			AggregationType: []byte{},
			TagSets:         [][]string{},
		}
	},
}
View Source
var UseSingleCollection = false
View Source
var UseTimeseries = false

Functions

func NewMongoDevops

func NewMongoDevops(dbConfig bulkQuerygen.DatabaseConfig, interval bulkQuerygen.TimeInterval, duration time.Duration, scaleVar int) bulkQuerygen.QueryGenerator

NewMongoDevops makes an MongoDevops object ready to generate Queries.

func NewMongoDevops8Hosts1Hr

func NewMongoDevops8Hosts1Hr(dbConfig bulkQuerygen.DatabaseConfig, queriesFullRange bulkQuerygen.TimeInterval, queryInterval time.Duration, scaleVar int) bulkQuerygen.QueryGenerator

func NewMongoDevopsSingleHost

func NewMongoDevopsSingleHost(dbConfig bulkQuerygen.DatabaseConfig, queriesFullRange bulkQuerygen.TimeInterval, queryInterval time.Duration, scaleVar int) bulkQuerygen.QueryGenerator

func NewMongoDevopsSingleHost12hr

func NewMongoDevopsSingleHost12hr(dbConfig bulkQuerygen.DatabaseConfig, queriesFullRange bulkQuerygen.TimeInterval, queryInterval time.Duration, scaleVar int) bulkQuerygen.QueryGenerator

func NewMongoIot

func NewMongoIot(dbConfig bulkQuerygen.DatabaseConfig, interval bulkQuerygen.TimeInterval, duration time.Duration, scaleVar int) bulkQuerygen.QueryGenerator

NewMongoIot makes an MongoIot object ready to generate Queries.

func NewMongoIotSingleHost

func NewMongoIotSingleHost(dbConfig bulkQuerygen.DatabaseConfig, queriesFullRange bulkQuerygen.TimeInterval, queryInterval time.Duration, scaleVar int) bulkQuerygen.QueryGenerator

func ParseOptions

func ParseOptions(documentFormat string, oneCollection bool)

Types

type M

type M = bson.M // map[string]interface{}

type MongoDevops

type MongoDevops struct {
	bulkQuerygen.CommonParams
	DatabaseName string
}

MongoDevops produces Mongo-specific queries for the devops use case.

func (*MongoDevops) Dispatch

func (d *MongoDevops) Dispatch(i int) bulkQuerygen.Query

Dispatch fulfills the QueryGenerator interface.

func (*MongoDevops) MaxCPUUsage12HoursByMinuteOneHost

func (d *MongoDevops) MaxCPUUsage12HoursByMinuteOneHost(q bulkQuerygen.Query)

func (*MongoDevops) MaxCPUUsageHourByMinuteEightHosts

func (d *MongoDevops) MaxCPUUsageHourByMinuteEightHosts(q bulkQuerygen.Query)

MaxCPUUsageHourByMinuteEightHosts populates a Query for getting the maximum CPU usage for four hosts over the course of an hour.

func (*MongoDevops) MaxCPUUsageHourByMinuteFourHosts

func (d *MongoDevops) MaxCPUUsageHourByMinuteFourHosts(q bulkQuerygen.Query)

MaxCPUUsageHourByMinuteFourHosts populates a Query for getting the maximum CPU usage for four hosts over the course of an hour.

func (*MongoDevops) MaxCPUUsageHourByMinuteOneHost

func (d *MongoDevops) MaxCPUUsageHourByMinuteOneHost(q bulkQuerygen.Query)

MaxCPUUsageHourByMinuteOneHost populates a Query for getting the maximum CPU usage for one host over the course of an hour.

func (*MongoDevops) MaxCPUUsageHourByMinuteSixteenHosts

func (d *MongoDevops) MaxCPUUsageHourByMinuteSixteenHosts(q bulkQuerygen.Query)

MaxCPUUsageHourByMinuteSixteenHosts populates a Query for getting the maximum CPU usage for four hosts over the course of an hour.

func (*MongoDevops) MaxCPUUsageHourByMinuteThirtyTwoHosts

func (d *MongoDevops) MaxCPUUsageHourByMinuteThirtyTwoHosts(q bulkQuerygen.Query)

func (*MongoDevops) MaxCPUUsageHourByMinuteTwoHosts

func (d *MongoDevops) MaxCPUUsageHourByMinuteTwoHosts(q bulkQuerygen.Query)

MaxCPUUsageHourByMinuteTwoHosts populates a Query for getting the maximum CPU usage for two hosts over the course of an hour.

func (*MongoDevops) MeanCPUUsageDayByHourAllHostsGroupbyHost

func (d *MongoDevops) MeanCPUUsageDayByHourAllHostsGroupbyHost(qi bulkQuerygen.Query)

type MongoDevops8Hosts1Hr

type MongoDevops8Hosts1Hr struct {
	MongoDevops
}

MongoDevopsSingleHost produces Mongo-specific queries for the devops single-host case.

func (*MongoDevops8Hosts1Hr) Dispatch

func (d *MongoDevops8Hosts1Hr) Dispatch(i int) bulkQuerygen.Query

type MongoDevopsSingleHost

type MongoDevopsSingleHost struct {
	MongoDevops
}

MongoDevopsSingleHost produces Mongo-specific queries for the devops single-host case.

func (*MongoDevopsSingleHost) Dispatch

type MongoDevopsSingleHost12hr

type MongoDevopsSingleHost12hr struct {
	MongoDevops
}

MongoDevopsSingleHost produces Mongo-specific queries for the devops single-host case.

func (*MongoDevopsSingleHost12hr) Dispatch

type MongoIot

type MongoIot struct {
	bulkQuerygen.CommonParams
	DatabaseName string
}

MongoIot produces Mongo-specific queries for the devops use case.

func (*MongoIot) AverageTemperatureDayByHourOneHome

func (d *MongoIot) AverageTemperatureDayByHourOneHome(q bulkQuerygen.Query)

func (*MongoIot) Dispatch

func (d *MongoIot) Dispatch(i int) bulkQuerygen.Query

Dispatch fulfills the QueryGenerator interface.

type MongoIotSingleHost

type MongoIotSingleHost struct {
	MongoIot
}

MongoIotSingleHost produces Mongo-specific queries for the devops single-host case.

func (*MongoIotSingleHost) Dispatch

func (d *MongoIotSingleHost) Dispatch(i int) bulkQuerygen.Query

type MongoQuery

type MongoQuery struct {
	HumanLabel       []byte
	HumanDescription []byte
	DatabaseName     []byte
	CollectionName   []byte
	BsonDoc          []M

	// these are only for debugging. the data is encoded in BsonDoc.
	MeasurementName []byte // e.g. "cpu"
	FieldName       []byte // e.g. "usage_user"
	AggregationType []byte // e.g. "avg" or "sum"
	TimeStart       time.Time
	TimeEnd         time.Time
	GroupByDuration time.Duration
	TagSets         [][]string // semantically, each subgroup is OR'ed and they are all AND'ed together
}

MongoQuery encodes a Mongo request. This will be serialized for use by the query_benchmarker program.

func NewMongoQuery

func NewMongoQuery() *MongoQuery

func (*MongoQuery) HumanDescriptionName

func (q *MongoQuery) HumanDescriptionName() []byte

func (*MongoQuery) HumanLabelName

func (q *MongoQuery) HumanLabelName() []byte

func (*MongoQuery) Release

func (q *MongoQuery) Release()

func (*MongoQuery) String

func (q *MongoQuery) String() string

String produces a debug-ready description of a Query.

type S

type S = bson.A // []interface{}

Jump to

Keyboard shortcuts

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