clickhouse

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromClickhouseStatRequests

func ConvertFromClickhouseStatRequests(data []*StatRequest) []*apiPb.GetAgentInformationResponse_Statistic

func ConvertFromSnapshots

func ConvertFromSnapshots(snapshots []*Snapshot) []*apiPb.SchedulerSnapshot

Types

type CPUInfo

type CPUInfo struct {
	Model         Model
	StatRequestID string
	Load          float64
}

type Clickhouse

type Clickhouse struct {
	Db *sql.DB
}

func (*Clickhouse) GetActiveIncidentByRuleId

func (c *Clickhouse) GetActiveIncidentByRuleId(ruleId string) (*apiPb.Incident, error)

func (*Clickhouse) GetCPUInfo

func (c *Clickhouse) GetCPUInfo(agentID string, pagination *apiPb.Pagination, filter *apiPb.TimeFilter) ([]*apiPb.GetAgentInformationResponse_Statistic, int32, error)

func (*Clickhouse) GetDiskInfo

func (c *Clickhouse) GetDiskInfo(agentID string, pagination *apiPb.Pagination, filter *apiPb.TimeFilter) ([]*apiPb.GetAgentInformationResponse_Statistic, int32, error)

func (*Clickhouse) GetIncidentById

func (c *Clickhouse) GetIncidentById(id string) (*apiPb.Incident, error)

func (*Clickhouse) GetIncidents

func (c *Clickhouse) GetIncidents(request *apiPb.GetIncidentsListRequest) ([]*apiPb.Incident, int64, error)

func (*Clickhouse) GetMemoryInfo

func (c *Clickhouse) GetMemoryInfo(agentID string, pagination *apiPb.Pagination, filter *apiPb.TimeFilter) ([]*apiPb.GetAgentInformationResponse_Statistic, int32, error)

func (*Clickhouse) GetNetInfo

func (c *Clickhouse) GetNetInfo(agentID string, pagination *apiPb.Pagination, filter *apiPb.TimeFilter) ([]*apiPb.GetAgentInformationResponse_Statistic, int32, error)

func (*Clickhouse) GetSnapshots

func (*Clickhouse) GetSnapshotsUptime

func (*Clickhouse) GetStatRequest

func (c *Clickhouse) GetStatRequest(agentID string, pagination *apiPb.Pagination, filter *apiPb.TimeFilter) ([]*apiPb.GetAgentInformationResponse_Statistic, int32, error)

func (*Clickhouse) GetTransactionByID

func (*Clickhouse) GetTransactionChildren

func (c *Clickhouse) GetTransactionChildren(transactionId, cyclicalLoopCheck string) ([]*TransactionInfo, error)

func (*Clickhouse) GetTransactionGroup

func (c *Clickhouse) GetTransactionGroup(request *apiPb.GetTransactionGroupRequest) (map[string]*apiPb.TransactionGroup, error)

todo order

func (*Clickhouse) GetTransactionInfo

func (c *Clickhouse) GetTransactionInfo(request *apiPb.GetTransactionsRequest) ([]*apiPb.TransactionInfo, int64, error)

func (*Clickhouse) InsertIncident

func (c *Clickhouse) InsertIncident(data *apiPb.Incident) error

func (*Clickhouse) InsertSnapshot

func (c *Clickhouse) InsertSnapshot(data *apiPb.SchedulerResponse) error

func (*Clickhouse) InsertStatRequest

func (c *Clickhouse) InsertStatRequest(data *apiPb.Metric) error

func (*Clickhouse) InsertTransactionInfo

func (c *Clickhouse) InsertTransactionInfo(data *apiPb.TransactionInfo) error

func (*Clickhouse) Migrate

func (c *Clickhouse) Migrate() error

func (*Clickhouse) UpdateIncidentStatus

func (c *Clickhouse) UpdateIncidentStatus(id string, status apiPb.IncidentStatus) (*apiPb.Incident, error)

type DiskInfo

type DiskInfo struct {
	Model         Model
	StatRequestID string
	Name          string
	Total         uint64
	Free          uint64
	Used          uint64
	UsedPercent   float64
}

type GroupResult

type GroupResult struct {
	Name         string
	Count        int64
	SuccessCount int64
	Latency      string
	MinTime      string
	MaxTime      string
	LowTime      string
}

type Incident

type Incident struct {
	Model      Model
	IncidentId string
	Status     int32
	RuleId     string
	StartTime  int64
	EndTime    int64
	Histories  []*IncidentHistory
}

type IncidentHistory

type IncidentHistory struct {
	Model      Model
	IncidentID string
	Status     int32
	Timestamp  int64
}

type MemoryInfo

type MemoryInfo struct {
	Model         Model
	StatRequestID string
	Mem           *MemoryMem
	Swap          *MemorySwap
}

type MemoryMem

type MemoryMem struct {
	Model         Model
	StatRequestID string
	MemoryInfoID  string
	Total         uint64
	Used          uint64
	Free          uint64
	Shared        uint64
	UsedPercent   float64
}

type MemorySwap

type MemorySwap struct {
	Model         Model
	StatRequestID string
	MemoryInfoID  string
	Total         uint64
	Used          uint64
	Free          uint64
	Shared        uint64
	UsedPercent   float64
}

type Model

type Model struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type NetInfo

type NetInfo struct {
	Model         Model
	StatRequestID string
	Name          string
	BytesSent     uint64
	BytesRecv     uint64
	PacketsSent   uint64
	PacketsRecv   uint64
	ErrIn         uint64
	ErrOut        uint64
	DropIn        uint64
	DropOut       uint64
}

type Snapshot

type Snapshot struct {
	Model         Model
	SchedulerID   string
	Code          int32
	Type          int32
	Error         string
	MetaStartTime int64
	MetaEndTime   int64
	MetaValue     []byte
}

func ConvertToSnapshot

func ConvertToSnapshot(request *apiPb.SchedulerResponse) (*Snapshot, error)

type StatRequest

type StatRequest struct {
	Model      Model
	AgentID    string
	AgentName  string
	CPUInfo    []*CPUInfo
	MemoryInfo *MemoryInfo
	DiskInfo   []*DiskInfo
	NetInfo    []*NetInfo
	Time       time.Time
}

func ConvertToClickhouseStatRequest

func ConvertToClickhouseStatRequest(request *apiPb.Metric) (*StatRequest, error)

type TransactionInfo

type TransactionInfo struct {
	Model
	TransactionId     string
	ApplicationId     string
	ParentId          string
	MetaHost          string
	MetaPath          string
	MetaMethod        string
	Name              string
	StartTime         int64
	EndTime           int64
	TransactionStatus int32
	TransactionType   int32
	Error             string
}

type UptimeResult

type UptimeResult struct {
	Count   int64
	Latency string
}

Jump to

Keyboard shortcuts

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