common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentNameMoreOperations    = "moreOperations"
	ComponentNamePauseFormModal    = "pauseFormModal"
	ComponentNameEventOverviewInfo = "eventOverviewInfo"
	ComponentNameEventStatusInfo   = "eventStatusInfo"
	ComponentNameMonitorDataChart  = "monitorDataChart"
	ComponentNameEventHistoryTable = "eventHistoryTable"
)
View Source
const (
	StateKeyAlertEvent = "alertEvent"
	StateKeyPageTitle  = "pageTitle"
)
View Source
const (
	GlobalStateKeyConfigurableFilterOptionsKey = "gsConfigurableFilterOptions"
	GlobalStateKeyPaging                       = "table_paging"
	GlobalStateKeySort                         = "table_sort"
)
View Source
const (
	AlertEventStateAlert   = "alert"
	AlertEventStateRecover = "recover"
	AlertEventStatePause   = "pause"
	AlertEventStateStop    = "stop"
)
View Source
const DefaultPageSize = 10
View Source
const ScenarioKey = "msp-alert-event-detail"
View Source
const TimeFormatLayout = "2006/01/02 15:04:05"

Variables

This section is empty.

Functions

func FormatTimeMs

func FormatTimeMs(timestamp int64) string

func GetAlertEventFromGlobalState

func GetAlertEventFromGlobalState(gs cptype.GlobalStateData) *pb.AlertEventItem

func GetInterval

func GetInterval(startTimeMs, endTimeMs int64, minInterval time.Duration, preferredPoints int64) string

func GetMonitorAlertServiceFromContext

func GetMonitorAlertServiceFromContext(ctx context.Context) monitorpb.AlertServiceServer

func GetMonitorMetricServiceFromContext

func GetMonitorMetricServiceFromContext(ctx context.Context) metricpb.MetricServiceServer

func GetPagingFromGlobalState

func GetPagingFromGlobalState(globalState cptype.GlobalStateData) (pageNo int64, pageSize int64)

func SetAlertEventToGlobalState

func SetAlertEventToGlobalState(gs cptype.GlobalStateData, alertEvent *pb.AlertEventItem)

func SetPagingToGlobalState

func SetPagingToGlobalState(globalState cptype.GlobalStateData, opData table.OpTableChangePageClientData)

func SetSortsToGlobalState

func SetSortsToGlobalState(globalState cptype.GlobalStateData, opData table.OpTableChangeSortClientData)

Types

type AlertExpression

type AlertExpression struct {
	Filters   []*AlertExpressionFilter   `json:"filters"`
	Functions []*AlertExpressionFunction `json:"functions"`
	Group     []string                   `json:"group"`
	Metric    string                     `json:"metric"`
	Metrics   []string                   `json:"metrics"`
	Outputs   []string                   `json:"outputs"`
	Select    map[string]string          `json:"select"`
	Window    *int64                     `json:"window"`
}

type AlertExpressionFilter

type AlertExpressionFilter struct {
	DataType string      `json:"dataType"`
	Operator string      `json:"operator"`
	Tag      string      `json:"tag"`
	Value    interface{} `json:"value"`
}

type AlertExpressionFunction

type AlertExpressionFunction struct {
	Alias       *string     `json:"alias"`
	Aggregator  string      `json:"aggregator"`
	Field       string      `json:"field"`
	FieldScript *string     `json:"fieldScript"`
	Operator    *string     `json:"operator"`
	Value       interface{} `json:"value"`
	Trigger     string      `json:"trigger"`
	Condition   string      `json:"condition"`
}

type InParams

type InParams struct {
	Scope        string `json:"scope"`
	ScopeId      string `json:"scopeId"`
	AlertEventId string `json:"alertEventId"`
	StartTime    int64  `json:"startTime"`
	EndTime      int64  `json:"endTime"`
}

func ParseFromCpSdk

func ParseFromCpSdk(sdk *cptype.SDK) (*InParams, error)

type Sort

type Sort struct {
	FieldKey  string
	Ascending bool
}

func GetSortsFromGlobalState

func GetSortsFromGlobalState(globalState cptype.GlobalStateData) []*Sort

Jump to

Keyboard shortcuts

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