Documentation ¶
Index ¶
- Constants
- func GetStatesForFilter(filters []*model.Filter) []string
- type AggregateType
- type BasicParser
- type FieldParser
- type FromBuilder
- type GetJobRunErrorRepository
- type GetJobSpecRepository
- type GetJobsRepository
- type GetJobsResult
- type GroupByResult
- type GroupJobsRepository
- type JobOptions
- type JobSimulator
- func (js *JobSimulator) ApiJob() *api.Job
- func (js *JobSimulator) Build() *JobSimulator
- func (js *JobSimulator) Cancelled(timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Failed(node string, exitCode int32, message string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Job() *model.Job
- func (js *JobSimulator) Lease(runId string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) LeaseExpired(timestamp time.Time) *JobSimulator
- func (js *JobSimulator) LeaseReturned(runId string, message string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Pending(runId string, cluster string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Preempted(timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Reprioritized(newPriority uint32, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) RunFailed(runId string, node string, exitCode int32, message string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) RunSucceeded(runId string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) RunTerminated(runId string, cluster string, node string, message string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) RunUnschedulable(runId string, cluster string, node string, message string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Running(runId string, node string, timestamp time.Time) *JobSimulator
- func (js *JobSimulator) Submit(queue, jobSet, owner string, timestamp time.Time, opts *JobOptions) *JobSimulator
- func (js *JobSimulator) Succeeded(timestamp time.Time) *JobSimulator
- type JoinType
- type LastTransitionTimeParser
- type LookoutTables
- func (c *LookoutTables) ColumnFromField(field string) (string, error)
- func (c *LookoutTables) GroupAggregateForCol(col string) (AggregateType, error)
- func (c *LookoutTables) IsFilterable(col string) bool
- func (c *LookoutTables) IsGroupable(col string) bool
- func (c *LookoutTables) IsOrderable(col string) bool
- func (c *LookoutTables) SupportsMatch(col, match string) bool
- func (c *LookoutTables) TableAbbrev(table string) (string, error)
- func (c *LookoutTables) TablePrecedence() []string
- func (c *LookoutTables) TablesForColumn(col string) (map[string]bool, error)
- type Query
- type QueryAggregator
- type QueryBuilder
- func (qb *QueryBuilder) CountGroups(filters []*model.Filter, activeJobSets bool, groupedField *model.GroupedField) (*Query, error)
- func (qb *QueryBuilder) CreateTempTable() (*Query, string)
- func (qb *QueryBuilder) GroupBy(filters []*model.Filter, activeJobSets bool, order *model.Order, ...) (*Query, error)
- func (qb *QueryBuilder) InsertIntoTempTable(tempTableName string, filters []*model.Filter, activeJobSets bool, ...) (*Query, error)
- func (qb *QueryBuilder) JobCount(filters []*model.Filter, activeJobSets bool) (*Query, error)
- type SqlFunctionAggregator
- type SqlGetJobRunErrorRepository
- type SqlGetJobSpecRepository
- type SqlGetJobsRepository
- type SqlGroupJobsRepository
- type StateCountAggregator
- type StateParser
- type TimeParser
Constants ¶
const ( Unknown AggregateType = -1 Max = 0 Average = 1 StateCounts = 2 )
Variables ¶
This section is empty.
Functions ¶
func GetStatesForFilter ¶ added in v0.3.77
GetStatesForFilter returns a list of states as string if filter for state exists Will always return the states in the same order, irrespective of the ordering of the states in the filter
Types ¶
type AggregateType ¶ added in v0.3.50
type AggregateType int
type BasicParser ¶ added in v0.3.77
type BasicParser[T any] struct { // contains filtered or unexported fields }
func (*BasicParser[T]) GetField ¶ added in v0.3.77
func (fp *BasicParser[T]) GetField() string
func (*BasicParser[T]) GetVariableRef ¶ added in v0.3.77
func (fp *BasicParser[T]) GetVariableRef() interface{}
func (*BasicParser[T]) ParseValue ¶ added in v0.3.77
func (fp *BasicParser[T]) ParseValue() (interface{}, error)
type FieldParser ¶ added in v0.3.77
type FieldParser interface { GetField() string GetVariableRef() interface{} ParseValue() (interface{}, error) }
func ParserForGroup ¶ added in v0.3.77
func ParserForGroup(field string) FieldParser
func ParsersForAggregate ¶ added in v0.3.77
func ParsersForAggregate(field string, filters []*model.Filter) ([]FieldParser, error)
type FromBuilder ¶ added in v0.3.53
type FromBuilder struct {
// contains filtered or unexported fields
}
func NewFromBuilder ¶ added in v0.3.53
func NewFromBuilder(baseTable, baseTableAbbrev string) *FromBuilder
func (*FromBuilder) Build ¶ added in v0.3.53
func (b *FromBuilder) Build() string
func (*FromBuilder) Join ¶ added in v0.3.53
func (b *FromBuilder) Join(joinType JoinType, table string, abbrev string, on []string) *FromBuilder
Join specifies JOIN with other table Include multiple values in the on list to join by multiple columns Note: the columns you join on need to have the same names in both tables
type GetJobSpecRepository ¶
type GetJobsRepository ¶
type GetJobsResult ¶
type GroupByResult ¶
type GroupJobsRepository ¶
type JobOptions ¶
type JobSimulator ¶
type JobSimulator struct {
// contains filtered or unexported fields
}
func NewJobSimulator ¶
func NewJobSimulator(converter *instructions.InstructionConverter, store *lookoutdb.LookoutDb) *JobSimulator
func (*JobSimulator) ApiJob ¶
func (js *JobSimulator) ApiJob() *api.Job
func (*JobSimulator) Build ¶
func (js *JobSimulator) Build() *JobSimulator
func (*JobSimulator) Cancelled ¶
func (js *JobSimulator) Cancelled(timestamp time.Time) *JobSimulator
func (*JobSimulator) Failed ¶
func (js *JobSimulator) Failed(node string, exitCode int32, message string, timestamp time.Time) *JobSimulator
func (*JobSimulator) Job ¶
func (js *JobSimulator) Job() *model.Job
func (*JobSimulator) Lease ¶ added in v0.3.77
func (js *JobSimulator) Lease(runId string, timestamp time.Time) *JobSimulator
func (*JobSimulator) LeaseExpired ¶
func (js *JobSimulator) LeaseExpired(timestamp time.Time) *JobSimulator
func (*JobSimulator) LeaseReturned ¶
func (js *JobSimulator) LeaseReturned(runId string, message string, timestamp time.Time) *JobSimulator
func (*JobSimulator) Pending ¶
func (js *JobSimulator) Pending(runId string, cluster string, timestamp time.Time) *JobSimulator
func (*JobSimulator) Preempted ¶ added in v0.3.77
func (js *JobSimulator) Preempted(timestamp time.Time) *JobSimulator
func (*JobSimulator) Reprioritized ¶
func (js *JobSimulator) Reprioritized(newPriority uint32, timestamp time.Time) *JobSimulator
func (*JobSimulator) RunFailed ¶
func (js *JobSimulator) RunFailed(runId string, node string, exitCode int32, message string, timestamp time.Time) *JobSimulator
func (*JobSimulator) RunSucceeded ¶
func (js *JobSimulator) RunSucceeded(runId string, timestamp time.Time) *JobSimulator
func (*JobSimulator) RunTerminated ¶
func (js *JobSimulator) RunTerminated(runId string, cluster string, node string, message string, timestamp time.Time) *JobSimulator
func (*JobSimulator) RunUnschedulable ¶
func (js *JobSimulator) RunUnschedulable(runId string, cluster string, node string, message string, timestamp time.Time) *JobSimulator
func (*JobSimulator) Running ¶
func (js *JobSimulator) Running(runId string, node string, timestamp time.Time) *JobSimulator
func (*JobSimulator) Submit ¶
func (js *JobSimulator) Submit(queue, jobSet, owner string, timestamp time.Time, opts *JobOptions) *JobSimulator
func (*JobSimulator) Succeeded ¶
func (js *JobSimulator) Succeeded(timestamp time.Time) *JobSimulator
type LastTransitionTimeParser ¶ added in v0.3.77
type LastTransitionTimeParser struct {
// contains filtered or unexported fields
}
func (*LastTransitionTimeParser) GetField ¶ added in v0.3.77
func (fp *LastTransitionTimeParser) GetField() string
func (*LastTransitionTimeParser) GetVariableRef ¶ added in v0.3.77
func (fp *LastTransitionTimeParser) GetVariableRef() interface{}
func (*LastTransitionTimeParser) ParseValue ¶ added in v0.3.77
func (fp *LastTransitionTimeParser) ParseValue() (interface{}, error)
type LookoutTables ¶
type LookoutTables struct {
// contains filtered or unexported fields
}
func NewTables ¶
func NewTables() *LookoutTables
func (*LookoutTables) ColumnFromField ¶
func (c *LookoutTables) ColumnFromField(field string) (string, error)
func (*LookoutTables) GroupAggregateForCol ¶ added in v0.3.50
func (c *LookoutTables) GroupAggregateForCol(col string) (AggregateType, error)
func (*LookoutTables) IsFilterable ¶
func (c *LookoutTables) IsFilterable(col string) bool
func (*LookoutTables) IsGroupable ¶
func (c *LookoutTables) IsGroupable(col string) bool
func (*LookoutTables) IsOrderable ¶
func (c *LookoutTables) IsOrderable(col string) bool
func (*LookoutTables) SupportsMatch ¶
func (c *LookoutTables) SupportsMatch(col, match string) bool
func (*LookoutTables) TableAbbrev ¶
func (c *LookoutTables) TableAbbrev(table string) (string, error)
func (*LookoutTables) TablePrecedence ¶
func (c *LookoutTables) TablePrecedence() []string
func (*LookoutTables) TablesForColumn ¶
func (c *LookoutTables) TablesForColumn(col string) (map[string]bool, error)
type QueryAggregator ¶ added in v0.3.77
func GetAggregatorsForColumn ¶ added in v0.3.77
func GetAggregatorsForColumn(queryCol *queryColumn, aggregateType AggregateType, filters []*model.Filter) ([]QueryAggregator, error)
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder is a struct responsible for building a single Lookout SQL query
func NewQueryBuilder ¶
func NewQueryBuilder(lookoutTables *LookoutTables) *QueryBuilder
func (*QueryBuilder) CountGroups ¶
func (qb *QueryBuilder) CountGroups(filters []*model.Filter, activeJobSets bool, groupedField *model.GroupedField) (*Query, error)
CountGroups returns Query that counts the total number of groups created by grouping by groupedField and filtering with filters
func (*QueryBuilder) CreateTempTable ¶
func (qb *QueryBuilder) CreateTempTable() (*Query, string)
CreateTempTable creates a temporary table of job ids Returns the Query and the name of the temporary table, to be used later in InsertIntoTempTable
func (*QueryBuilder) GroupBy ¶
func (qb *QueryBuilder) GroupBy( filters []*model.Filter, activeJobSets bool, order *model.Order, groupedField *model.GroupedField, aggregates []string, skip int, take int, ) (*Query, error)
GroupBy returns Query that performs a group by on filters
func (*QueryBuilder) InsertIntoTempTable ¶
func (qb *QueryBuilder) InsertIntoTempTable(tempTableName string, filters []*model.Filter, activeJobSets bool, order *model.Order, skip, take int) (*Query, error)
InsertIntoTempTable returns Query that returns Job IDs according to filters, order, skip and take, and inserts them in the temp table with name tempTableName
type SqlFunctionAggregator ¶ added in v0.3.77
type SqlFunctionAggregator struct {
// contains filtered or unexported fields
}
func NewSqlFunctionAggregator ¶ added in v0.3.77
func NewSqlFunctionAggregator(queryCol *queryColumn, fn string) *SqlFunctionAggregator
func (*SqlFunctionAggregator) AggregateSql ¶ added in v0.3.77
func (qa *SqlFunctionAggregator) AggregateSql() (string, error)
type SqlGetJobRunErrorRepository ¶
type SqlGetJobRunErrorRepository struct {
// contains filtered or unexported fields
}
func NewSqlGetJobRunErrorRepository ¶
func NewSqlGetJobRunErrorRepository(db *pgxpool.Pool, decompressor compress.Decompressor) *SqlGetJobRunErrorRepository
func (*SqlGetJobRunErrorRepository) GetJobRunError ¶
type SqlGetJobSpecRepository ¶
type SqlGetJobSpecRepository struct {
// contains filtered or unexported fields
}
func NewSqlGetJobSpecRepository ¶
func NewSqlGetJobSpecRepository(db *pgxpool.Pool, decompressor compress.Decompressor) *SqlGetJobSpecRepository
func (*SqlGetJobSpecRepository) GetJobSpec ¶
type SqlGetJobsRepository ¶
type SqlGetJobsRepository struct {
// contains filtered or unexported fields
}
func NewSqlGetJobsRepository ¶
func NewSqlGetJobsRepository(db *pgxpool.Pool) *SqlGetJobsRepository
type SqlGroupJobsRepository ¶
type SqlGroupJobsRepository struct {
// contains filtered or unexported fields
}
func NewSqlGroupJobsRepository ¶
func NewSqlGroupJobsRepository(db *pgxpool.Pool) *SqlGroupJobsRepository
type StateCountAggregator ¶ added in v0.3.77
type StateCountAggregator struct {
// contains filtered or unexported fields
}
func NewStateCountAggregator ¶ added in v0.3.77
func NewStateCountAggregator(queryCol *queryColumn, stateString string) *StateCountAggregator
func (*StateCountAggregator) AggregateSql ¶ added in v0.3.77
func (qa *StateCountAggregator) AggregateSql() (string, error)
type StateParser ¶ added in v0.3.77
type StateParser struct {
// contains filtered or unexported fields
}
func (*StateParser) GetField ¶ added in v0.3.77
func (fp *StateParser) GetField() string
func (*StateParser) GetVariableRef ¶ added in v0.3.77
func (fp *StateParser) GetVariableRef() interface{}
func (*StateParser) ParseValue ¶ added in v0.3.77
func (fp *StateParser) ParseValue() (interface{}, error)
type TimeParser ¶ added in v0.3.77
type TimeParser struct {
// contains filtered or unexported fields
}
func (*TimeParser) GetField ¶ added in v0.3.77
func (fp *TimeParser) GetField() string
func (*TimeParser) GetVariableRef ¶ added in v0.3.77
func (fp *TimeParser) GetVariableRef() interface{}
func (*TimeParser) ParseValue ¶ added in v0.3.77
func (fp *TimeParser) ParseValue() (interface{}, error)