explainer

package
v5.5.8 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 19 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 CloseHandleError added in v5.2.3

func CloseHandleError(status *models.CloseIssuesStatus, idIssue int64, err error, apiError render.APIError)

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 CloseIssues added in v5.2.3

func CloseIssues(idIssues []int64, user users.User, status *models.CloseIssuesStatus)

func CreateIssue

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

CreateIssue function used to create an issue

func DrafHandleError added in v5.2.3

func DrafHandleError(status *models.DraftIssuesStatus, idIssue int64, err error, apiError render.APIError)

func DraftIssues added in v5.2.3

func DraftIssues(idIssues []int64, user users.User, status *models.DraftIssuesStatus)

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 IsOpenOrDraftIssue added in v5.0.14

func IsOpenOrDraftIssue(issueKey string) (bool, error)

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