common

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_HOST = "127.0.0.1"
View Source
const ENV_K8S_NODE_IP = "K8S_NODE_IP_FOR_DEEPFLOW"
View Source
const QUEUE_SIZE = 1 << 16

Variables

This section is empty.

Functions

func DropOrg

func DropOrg(orgId uint16) error

* 调用此接口删除组织时,ingester 会删除 ClickHouse 中所有该组织的数据库,并清理内存中对应的 ClickHouse session。 * 注意:当 deepflow-agent 携带的 org_id 在 ClickHouse 中没有对应的数据库时, * 同时满足下面两个条件,则 ingester 会自动为该 org_id 创建 ClickHouse 数据库: * 1. ingester 最近一次(每分钟获取一次)从 controller 获取到的 org_id list 中存在该 org_id * 2. 该 org_id 最近没有被删除过,或者被删除的时间早于 ingester 获取到 org_id list 的时间 * 因此,被删除的 org_id 不要立即复用,以避免被删除的组织中有一些 deepflow-agent 仍然在运行且未进入逃逸状态时,会将数据写入到复用此 org_id 的数据库中。 * 另外,注意当 org 被删除时,controller 需要确保下发的 org_id list 中不要包含被删除的 org_id。 * ---------------------------------------------------------------------- * When calling this interface to delete an organization, * Ingester will delete all the databases of that organization in ClickHouse and clean up the corresponding ClickHouse sessions in memory. * Note: When the org_id carried by the Deepflow-agent does not have a corresponding database in ClickHouse, * If both of the following conditions are met simultaneously, Ingester will automatically create a ClickHouse database for the org_id: * 1. The latest (obtained every minute) org_id list obtained by Ingester from the Controller contains the same org_id * 2. The org_id has not been deleted recently, or it was deleted earlier than the time when Ingester obtained the org_id list * Therefore, the deleted org_id should not be reused immediately to avoid some Deepflow-agents in the deleted organization still running and not entering the escape state, * which will write data to the database that reuses this org_id. * Additionally, please note that when an org is deleted, the controller needs to ensure that the issued org_i list does not contain the deleted org_id.

func ExportersEnabled

func ExportersEnabled(configPath string) bool

func GetMemInuse

func GetMemInuse() uint64

func GetNetIO

func GetNetIO() (uint64, uint64)

func NewDiskMonitor

func NewDiskMonitor(paths []string, hostIp string)

func SetOrgHandler

func SetOrgHandler(orgHandler OrgHanderInterface)

Types

type Config

type Config struct {
	Ingester IngesterConfig `yaml:"ingester"`
}

type ControllerIngesterShared

type ControllerIngesterShared struct {
	ResourceEventQueue *queue.OverwriteQueue
	TraceTreeQueue     *queue.OverwriteQueue
}

func NewControllerIngesterShared

func NewControllerIngesterShared() *ControllerIngesterShared

type Counter

type Counter struct {
	CpuPercent    float64 `statsd:"cpu-percent"`
	MemRSS        uint64  `statsd:"mem-rss"`
	MemInuse      uint64  `statsd:"mem-inuse"`
	BytesSend     uint64  `statsd:"bytes-send"`
	BytesRecv     uint64  `statsd:"bytes-recv"`
	BytesRead     uint64  `statsd:"bytes-read"`
	BytesWrite    uint64  `statsd:"bytes-write"`
	Load1         float64 `statsd:"load1"`
	Load1ByCpuNum float64 `statsd:"load1-by-cpu-num"`
}

type DiskCounter

type DiskCounter struct {
	Total       uint64  `statsd:"total"`
	Free        uint64  `statsd:"free"`
	Used        uint64  `statsd:"used"`
	UsedPercent float64 `statsd:"used-percent"`
}

type DiskMonitor

type DiskMonitor struct {
	utils.Closable
	// contains filtered or unexported fields
}

func (*DiskMonitor) GetCounter

func (m *DiskMonitor) GetCounter() interface{}

func (*DiskMonitor) Stop

func (m *DiskMonitor) Stop()

type ExportersConfig

type ExportersConfig struct {
	Enabled bool `yaml:"enabled"`
}

type IngesterConfig

type IngesterConfig struct {
	Exporters []ExportersConfig `yaml:"exporters"`
}

type Monitor

type Monitor struct {
	utils.Closable
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(paths []string) (*Monitor, error)

func (*Monitor) GetCounter

func (m *Monitor) GetCounter() interface{}

func (*Monitor) GetCpuNum

func (m *Monitor) GetCpuNum() uint64

func (*Monitor) GetCpuPercent

func (m *Monitor) GetCpuPercent() float64

func (*Monitor) GetDiskIO

func (m *Monitor) GetDiskIO() (uint64, uint64)

func (*Monitor) GetLoad1

func (m *Monitor) GetLoad1() float64

func (*Monitor) GetMemRSS

func (m *Monitor) GetMemRSS() uint64

func (*Monitor) Stop

func (m *Monitor) Stop()

type OrgHanderInterface

type OrgHanderInterface interface {
	DropOrg(orgId uint16) error
}

Jump to

Keyboard shortcuts

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