explainer

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIssueDetectionFeedback

func AddIssueDetectionFeedback(dbClient *sqlx.DB, issue models.Issue, user users.User, rating int) error

AddIssueDetectionFeedback add a new feedback in the detection_feedback table (or update it if the user already posted a feedback) Moreover, it updates the issue average rating for convenience

func CloseIssueWithFeedback

func CloseIssueWithFeedback(dbClient *sqlx.DB, issue models.Issue, recommendation models.FrontRecommendation, user users.User) error

CloseIssueWithFeedback generate and persist an issue feedback for the rootcause/action stats and ML models

func CloseIssueWithoutFeedback

func CloseIssueWithoutFeedback(dbClient *sqlx.DB, issue models.Issue, reason string, user users.User) error

CloseIssueWithoutFeedback close an issue without standard feedback on rootcause / action

func CreateIssue

func CreateIssue(situationID int64, ts time.Time, templateInstanceID int64, rule models.RuleData, name string, level models.IssueLevel, timeout time.Duration, key string) (int64, error)

CreateIssue function used to create an issue

func ExtractSelectedFromTree

func ExtractSelectedFromTree(recommendation models.FrontRecommendation) (*models.FrontRootCause, []*models.FrontAction, error)

ExtractSelectedFromTree extracts and returns selected rootcause and actions from a recommendation

func GetActionStats

func GetActionStats(situationID int64) (map[int64]ActionStats, error)

GetActionStats returns all actions usage statistics on a single situation

func GetFactsHistory

func GetFactsHistory(issue models.Issue) ([]models.FrontFactHistory, bool, error)

GetFactsHistory get the history of facts for an issue

func GetRecommendationTree

func GetRecommendationTree(issue models.Issue) (*models.FrontRecommendation, error)

GetRecommendationTree build a recommendation tree based on issue resolution stats table

func GetRootCauseStats

func GetRootCauseStats(situationID int64) (map[int64]RootCauseStats, error)

GetRootCauseStats returns all rootcauses usage statistics on a single situation

func SaveIssueDraft

func SaveIssueDraft(tx *sqlx.Tx, issue models.Issue, issueDraft models.FrontDraft, user users.User) error

SaveIssueDraft generate and persist an issue draft

Types

type ActionStats

type ActionStats struct {
	RootCauseID int64
	ActionID    int64
	Occurrences int64
	IssueCount  int64
}

ActionStats is a single action usage stats

func NewActionStats

func NewActionStats(rootCauseID int64, actionID int64, occurrences int64, issueCount int64) ActionStats

NewActionStats returns a new ActionStats

func (*ActionStats) GetRelativeFrequency

func (as *ActionStats) GetRelativeFrequency() float64

GetRelativeFrequency calculate the relative usage frequency of an action

type RootCauseStats

type RootCauseStats struct {
	RootCauseID int64
	Occurrences int64
	IssueCount  int64
}

RootCauseStats is a single rootcause usage stats

func NewRootCauseStats

func NewRootCauseStats(rootCauseID int64, occurrences int64, issueCount int64) RootCauseStats

NewRootCauseStats returns a new RootCauseStats

func (*RootCauseStats) GetRelativeFrequency

func (as *RootCauseStats) GetRelativeFrequency() float64

GetRelativeFrequency calculate the relative usage frequency of a rootcause

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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