Documentation ¶
Index ¶
- func CreateFormattedVariables(session *data.InteractiveSession, botGroupIndex int)
- func ExecuteBotCondition(session *data.InteractiveSession, botGroup *data.BotGroup, bot *data.Bot, ...)
- func ExecuteBotGroupConditions(session *data.InteractiveSession, botGroupIndex int) bool
- func ExportMetricsOnVariables(session *data.InteractiveSession, botGroupIndex int)
- func ExtractBotsFromPromData(response data.PrometheusResponse, botGroup *data.BotGroup) []data.Bot
- func GetBotEvalMapAllVariables(bot *data.Bot) map[string]interface{}
- func GetBotEvalMapOnlyQueries(bot data.Bot, queryVariableNames []string) map[string]interface{}
- func GetCachedQueryResult(session *data.InteractiveSession, site *data.Site, query data.BotQuery) (data.QueryResult, error)
- func GetQueryKey(session *data.InteractiveSession, query data.BotQuery) string
- func InitializeBotStates(botGroup *data.BotGroup, bot *data.Bot)
- func IsQueryLocked(session *data.InteractiveSession, site *data.Site, query data.BotQuery) bool
- func QueryCacheSet(session *data.InteractiveSession, site *data.Site, query data.BotQuery, ...)
- func QueryLockClear(site *data.Site, queryKey string)
- func QueryLockSet(site *data.Site, queryKey string)
- func QueryPrometheus(host string, port int, queryType data.BotQueryType, query string, ...) data.PrometheusResponse
- func SortAllVariablesAndConditions(session *data.InteractiveSession, botGroupIndex int)
- func StoreQueryResult(session *data.InteractiveSession, site *data.Site, query data.BotQuery, ...)
- func UpdateBotConditionConsiderations(session *data.InteractiveSession, botGroupIndex int)
- func UpdateBotGroupFromPrometheus(session *data.InteractiveSession, site *data.Site, botGroupIndex int)
- func UpdateBotsFromQueries(session *data.InteractiveSession, site *data.Site, botGroupIndex int)
- func UpdateBotsWithSyntheticVariables(session *data.InteractiveSession, botGroupIndex int)
- func UpdateSiteBotGroups(session *data.InteractiveSession)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFormattedVariables ¶
func CreateFormattedVariables(session *data.InteractiveSession, botGroupIndex int)
Create formatted variables for all our Bots. This adds human-readable strings to all the sorted Pair Lists
func ExecuteBotCondition ¶
func ExecuteBotCondition(session *data.InteractiveSession, botGroup *data.BotGroup, bot *data.Bot, condition data.Condition, conditionData data.BotConditionData)
func ExecuteBotGroupConditions ¶
func ExecuteBotGroupConditions(session *data.InteractiveSession, botGroupIndex int) bool
Execute the highest scoring condition for any Bot in this Bot Group, if it is Available and meets all conditions
func ExportMetricsOnVariables ¶
func ExportMetricsOnVariables(session *data.InteractiveSession, botGroupIndex int)
func ExtractBotsFromPromData ¶
Extract our ephemeral Bots from the Prometheus response, using the BotKey extractor information
func GetBotEvalMapAllVariables ¶
Returns the map for doing the Evaluate with a Bots VariableValues. Uses Govaluate.Evaluate() NOTE(ghowland): bot.AccessLock should already be locked before we come here, because we are accessing a map
func GetBotEvalMapOnlyQueries ¶
Returns the map for doing the Evaluate against a Query to create our Scores. Uses Govaluate.Evaluate() NOTE(ghowland): bot.AccessLock should already be locked before we come here, because we are accessing a map
func GetCachedQueryResult ¶
func GetCachedQueryResult(session *data.InteractiveSession, site *data.Site, query data.BotQuery) (data.QueryResult, error)
GetCachedQueryResult returns a cached query result. Web App requests should set errorOverInterval=false, which is used by the background query system to test missing or expired query results as equivalent.
func GetQueryKey ¶
func GetQueryKey(session *data.InteractiveSession, query data.BotQuery) string
GetQueryKey returns "(QueryServer).(Query)", so it can be shared by any BotGroup
func InitializeBotStates ¶
Initialize all the States for this BotGroups Bots. They should all start at the first state value, and only move forward or reset.
func IsQueryLocked ¶
IsQueryLocked returned whether this Query currently being requested. Don't want to request more than once at a time
func QueryCacheSet ¶
func QueryCacheSet(session *data.InteractiveSession, site *data.Site, query data.BotQuery, newCacheItem data.QueryResultPoolItem)
func QueryLockClear ¶
QueryLockClear will clear the Query Lock, so we can make this Query again after the Interval
func QueryLockSet ¶
QueryLockSet will set the Query Lock for a QueryKey, so we won't request this Query again until it finishes or the AppConfig.QueryLockTimeout expires
func QueryPrometheus ¶
func QueryPrometheus(host string, port int, queryType data.BotQueryType, query string, timeStart time.Time, duration time.Duration) data.PrometheusResponse
Query the Prometheus metric server
func SortAllVariablesAndConditions ¶
func SortAllVariablesAndConditions(session *data.InteractiveSession, botGroupIndex int)
Sort all the Variables by name and Conditions by Final Score
func StoreQueryResult ¶
func StoreQueryResult(session *data.InteractiveSession, site *data.Site, query data.BotQuery, startTime time.Time, queryResult data.QueryResult)
StoreQueryResult will store a QueryResult in the cache
func UpdateBotConditionConsiderations ¶
func UpdateBotConditionConsiderations(session *data.InteractiveSession, botGroupIndex int)
For this BotGroup, update all the BotConditionData with new ConditionConsideration scores
func UpdateBotGroupFromPrometheus ¶
func UpdateBotGroupFromPrometheus(session *data.InteractiveSession, site *data.Site, botGroupIndex int)
Runs Queries against Prometheus for a BotGroup
func UpdateBotsFromQueries ¶
func UpdateBotsFromQueries(session *data.InteractiveSession, site *data.Site, botGroupIndex int)
Update all the Bot VariableValues from our Queries
func UpdateBotsWithSyntheticVariables ¶
func UpdateBotsWithSyntheticVariables(session *data.InteractiveSession, botGroupIndex int)
Update bot with Synthetic Variables. Happens after all the Query Variables are set. Synthetic vars can't work on each other
func UpdateSiteBotGroups ¶
func UpdateSiteBotGroups(session *data.InteractiveSession)
Update all the BotGroups in this Site
Types ¶
This section is empty.