Documentation
¶
Index ¶
- Constants
- Variables
- func DevopsDispatchAll(d Devops, iteration int, q Query, scaleVar int)
- func IotDispatchAll(d Iot, iteration int, q Query, scaleVar int)
- type CommonParams
- type DatabaseConfig
- type Devops
- type HTTPQuery
- type Iot
- type Query
- type QueryGenerator
- type QueryGeneratorMaker
- type TimeInterval
- type TimeWindow
Constants ¶
const (
DatabaseName = "database-name"
)
const DefaultQueryInterval = time.Hour
Variables ¶
var ( TimeWindowShift time.Duration QueryIntervalType string )
Functions ¶
func DevopsDispatchAll ¶
devopsDispatchAll round-robins through the different devops queries.
Types ¶
type CommonParams ¶
type CommonParams struct {
AllInterval TimeInterval
ScaleVar int
}
func NewCommonParams ¶
func NewCommonParams(interval TimeInterval, scaleVar int) *CommonParams
type DatabaseConfig ¶
type Devops ¶
type Devops interface {
MaxCPUUsageHourByMinuteOneHost(Query)
MaxCPUUsageHourByMinuteTwoHosts(Query)
MaxCPUUsageHourByMinuteFourHosts(Query)
MaxCPUUsageHourByMinuteEightHosts(Query)
MaxCPUUsageHourByMinuteSixteenHosts(Query)
MaxCPUUsageHourByMinuteThirtyTwoHosts(Query)
MaxCPUUsage12HoursByMinuteOneHost(Query)
MeanCPUUsageDayByHourAllHostsGroupbyHost(Query)
Dispatch(int) Query
}
Devops describes a devops query generator.
type HTTPQuery ¶
type HTTPQuery struct {
HumanLabel []byte
HumanDescription []byte
Method []byte
Path []byte
Body []byte
StartTimestamp int64
EndTimestamp int64
}
HTTPQuery encodes an HTTP request. This will typically by serialized for use by the query_benchmarker program.
func NewHTTPQuery ¶
func NewHTTPQuery() *HTTPQuery
func (*HTTPQuery) HumanDescriptionName ¶
func (*HTTPQuery) HumanLabelName ¶
type QueryGenerator ¶
QueryGenerator describes a generator of queries, typically according to a use case.
type QueryGeneratorMaker ¶
type QueryGeneratorMaker func(dbConfig DatabaseConfig, queriesFullRange TimeInterval, queryInterval time.Duration, scaleVar int) QueryGenerator
type TimeInterval ¶
TimeInterval represents an interval of time.
func NewTimeInterval ¶
func NewTimeInterval(start, end time.Time) TimeInterval
NewTimeInterval constructs a TimeInterval.
func (*TimeInterval) Duration ¶
func (ti *TimeInterval) Duration() time.Duration
Duration converts a TimeInterval to a time.Duration.
func (*TimeInterval) EndString ¶
func (ti *TimeInterval) EndString() string
EndString formats the end of the time interval.
func (*TimeInterval) EndUnixNano ¶
func (ti *TimeInterval) EndUnixNano() int64
EndUnixNano returns the end time as nanoseconds.
func (*TimeInterval) RandWindow ¶
func (ti *TimeInterval) RandWindow(window time.Duration) TimeInterval
RandWindow creates a TimeInterval of duration `window` at a uniformly-random start time within this time interval.
func (*TimeInterval) StartString ¶
func (ti *TimeInterval) StartString() string
StartString formats the start of the time interval.
func (*TimeInterval) StartUnixNano ¶
func (ti *TimeInterval) StartUnixNano() int64
StartUnixNano returns the start time as nanoseconds.
type TimeWindow ¶
func (*TimeWindow) SlidingWindow ¶
func (tw *TimeWindow) SlidingWindow(AllInterval *TimeInterval) TimeInterval
Inspired by TimeInterval.RandWindow