metrics

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppMemory added in v0.1.2

type AppMemory struct {
	Alloc      uint64    `json:"alloc"`
	HeapAlloc  uint64    `json:"heap_alloc"`
	TotalAlloc uint64    `json:"total_alloc"`
	Sys        uint64    `json:"sys"`
	NumGC      uint64    `json:"num_gc"`
	LastGC     time.Time `json:"last_gc"`
}

AppMemory ...

type AppMemoryManager added in v0.1.2

type AppMemoryManager struct {
	// contains filtered or unexported fields
}

AppMemoryManager ...

func NewAppMemoryManager added in v0.1.2

func NewAppMemoryManager(publisher IPublisher) *AppMemoryManager

NewAppMemoryManager ...

func (AppMemoryManager) Snapshot added in v0.1.2

func (d AppMemoryManager) Snapshot() AppMemory

Snapshot ...

type Cpu added in v0.1.2

type Cpu struct {
	Cores int64   `json:"cores"`
	Mhz   float64 `json:"mhz"`
	All   float64 `json:"all"`
}

Cpu ...

type CpuManager added in v0.1.2

type CpuManager struct {
	// contains filtered or unexported fields
}

CpuManager ...

func NewCpuManager added in v0.1.2

func NewCpuManager(publisher IPublisher) (c *CpuManager)

NewCpuManager ...

func (*CpuManager) All added in v0.1.2

func (c *CpuManager) All() float64

All ...

func (*CpuManager) Snapshot added in v0.1.2

func (c *CpuManager) Snapshot() Cpu

Snapshot ...

type Device added in v0.1.2

type Device struct {
	Total    int64 `json:"total"`
	Disabled int64 `json:"disabled"`
}

Device ...

type DeviceAdd added in v0.1.2

type DeviceAdd struct {
	TotalNum    int64
	DisabledNum int64
}

DeviceAdd ...

type DeviceDelete added in v0.1.2

type DeviceDelete struct {
	TotalNum    int64
	DisabledNum int64
}

DeviceDelete ...

type DeviceManager added in v0.1.2

type DeviceManager struct {
	// contains filtered or unexported fields
}

DeviceManager ...

func NewDeviceManager added in v0.1.2

func NewDeviceManager(publisher IPublisher) *DeviceManager

NewDeviceManager ...

func (*DeviceManager) Snapshot added in v0.1.2

func (d *DeviceManager) Snapshot() Device

Snapshot ...

type Disk added in v0.1.2

type Disk struct {
	Root UsageStat `json:"root"`
}

Disk ...

type DiskManager added in v0.1.2

type DiskManager struct {
	// contains filtered or unexported fields
}

DiskManager ...

func NewDiskManager added in v0.1.2

func NewDiskManager(publisher IPublisher) (manager *DiskManager)

NewDiskManager ...

func (*DiskManager) Snapshot added in v0.1.2

func (d *DiskManager) Snapshot() Disk

Snapshot ...

type Entity added in v0.5.0

type Entity struct {
	Total    int64                  `json:"total"`
	Entities map[string]EntityState `json:"entities"`
}

Entity ...

type EntityAdd added in v0.5.0

type EntityAdd struct {
	Num int64
}

EntityAdd ...

type EntityCursor added in v0.5.0

type EntityCursor struct {
	DeviceId    int64
	ElementName string
}

EntityCursor ...

type EntityDelete added in v0.5.0

type EntityDelete struct {
	Num int64
}

EntityDelete ...

type EntityManager added in v0.5.0

type EntityManager struct {
	// contains filtered or unexported fields
}

EntityManager ...

func NewEntityManager added in v0.5.0

func NewEntityManager(publisher IPublisher) *EntityManager

NewEntityManager ...

func (*EntityManager) Snapshot added in v0.5.0

func (d *EntityManager) Snapshot() Entity

Snapshot ...

type EntitySetOption added in v0.5.0

type EntitySetOption struct {
	DeviceId     int64       `json:"device_id"`
	ElementName  string      `json:"element_name"`
	StateId      int64       `json:"state_id"`
	StateOptions interface{} `json:"state_options"`
}

EntitySetOption ...

type EntitySetState added in v0.5.0

type EntitySetState struct {
	DeviceId    int64  `json:"device_id"`
	ElementName string `json:"element_name"`
	StateId     int64  `json:"state_id"`
}

EntitySetState ...

type EntityState added in v0.5.0

type EntityState struct {
	DeviceId     int64       `json:"device_id"`
	ElementName  string      `json:"element_name"`
	StateId      int64       `json:"state_id"`
	StateOptions interface{} `json:"state_options"`
}

EntityState ...

type Gate added in v0.1.2

type Gate struct {
	Status      string `json:"status"`
	AccessToken string `json:"access_token"`
}

Gate ...

type GateManager added in v0.1.2

type GateManager struct {
	// contains filtered or unexported fields
}

GateManager ...

func NewGateManager added in v0.1.2

func NewGateManager(publisher IPublisher) *GateManager

NewGateManager ...

func (*GateManager) Snapshot added in v0.1.2

func (d *GateManager) Snapshot() Gate

Snapshot ...

type GateUpdate added in v0.1.2

type GateUpdate struct {
	Status, AccessToken string
}

GateUpdate ...

type History added in v0.2.0

type History struct {
	Items []HistoryItem `json:"items"`
}

History ...

type HistoryItem added in v0.2.0

type HistoryItem struct {
	DeviceName        string    `json:"device_name"`
	DeviceDescription string    `json:"device_description"`
	Type              string    `json:"type"`
	LogLevel          string    `json:"log_level"`
	Description       string    `json:"description"`
	CreatedAt         time.Time `json:"created_at"`
}

HistoryItem ...

type HistoryManager added in v0.2.0

type HistoryManager struct {
	// contains filtered or unexported fields
}

HistoryManager ...

func NewHistoryManager added in v0.2.0

func NewHistoryManager(publisher IPublisher, adaptors *adaptors.Adaptors) *HistoryManager

NewHistoryManager ...

func (HistoryManager) Snapshot added in v0.2.0

func (d HistoryManager) Snapshot() History

Snapshot ...

type IPublisher added in v0.1.2

type IPublisher interface {
	Broadcast(interface{})
}

IPublisher ...

type ISubscriber added in v0.1.2

type ISubscriber interface {
	Broadcast(interface{})
}

ISubscriber ...

type Memory added in v0.1.2

type Memory struct {
	SwapTotal uint64 `json:"swap_total"`
	SwapFree  uint64 `json:"swap_free"`
	MemTotal  uint64 `json:"mem_total"`
	MemFree   uint64 `json:"mem_free"`
}

Memory ...

type MemoryManager added in v0.1.2

type MemoryManager struct {
	// contains filtered or unexported fields
}

MemoryManager ...

func NewMemoryManager added in v0.1.2

func NewMemoryManager(publisher IPublisher) *MemoryManager

NewMemoryManager ...

func (*MemoryManager) Snapshot added in v0.1.2

func (d *MemoryManager) Snapshot() Memory

Snapshot ...

type MetricConfig

type MetricConfig struct {
	RunMode common.RunMode
	Host    string
	Port    int
	Enabled bool
}

MetricConfig ...

type MetricManager added in v0.1.2

type MetricManager struct {
	*Publisher
	// contains filtered or unexported fields
}

MetricManager ...

func NewMetricManager added in v0.1.2

func NewMetricManager(lc fx.Lifecycle,
	cfg *MetricConfig,
	adaptors *adaptors.Adaptors) *MetricManager

NewMetricManager ...

func (MetricManager) Shutdown added in v0.1.2

func (m MetricManager) Shutdown()

Shutdown ...

func (*MetricManager) Start added in v0.1.2

func (m *MetricManager) Start()

Start ...

func (*MetricManager) Update added in v0.1.2

func (m *MetricManager) Update(t interface{})

Update ...

type Mqtt added in v0.1.2

type Mqtt struct {
	ClientState MqttClientStats `json:"client_state"`
}

Mqtt ...

type MqttClientStats added in v0.1.2

type MqttClientStats struct {
	ConnectedTotal    uint64 `json:"connected_total"`
	DisconnectedTotal uint64 `json:"disconnected_total"`
	ActiveCurrent     uint64 `json:"active_current"`
	InactiveCurrent   uint64 `json:"inactive_current"`
	ExpiredTotal      uint64 `json:"expired_total"`
}

MqttClientStats ...

type MqttManager added in v0.1.2

type MqttManager struct {
	// contains filtered or unexported fields
}

MqttManager ...

func NewMqttManager added in v0.1.2

func NewMqttManager(publisher IPublisher) *MqttManager

NewMqttManager ...

func (*MqttManager) Snapshot added in v0.1.2

func (d *MqttManager) Snapshot() Mqtt

Snapshot ...

type Node added in v0.1.2

type Node struct {
	Total  int64            `json:"total"`
	Status map[int64]string `json:"status"`
}

Node ...

type NodeAdd added in v0.1.2

type NodeAdd struct {
	Num int64
}

NodeAdd ...

type NodeDelete added in v0.1.2

type NodeDelete struct {
	Num int64
}

NodeDelete ...

type NodeManager added in v0.1.2

type NodeManager struct {
	// contains filtered or unexported fields
}

NodeManager ...

func NewNodeManager added in v0.1.2

func NewNodeManager(publisher IPublisher) *NodeManager

NewNodeManager ...

func (*NodeManager) GetStatus added in v0.1.2

func (d *NodeManager) GetStatus(nodeId int64) (status string, err error)

GetStatus ...

func (*NodeManager) Snapshot added in v0.1.2

func (d *NodeManager) Snapshot() Node

Snapshot ...

type NodeUpdateStatus added in v0.1.2

type NodeUpdateStatus struct {
	Id     int64
	Status string
}

NodeUpdateStatus ...

type Publisher added in v0.1.2

type Publisher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Publisher ...

func NewPublisher added in v0.1.2

func NewPublisher() (t *Publisher)

NewPublisher ...

func (*Publisher) Broadcast added in v0.1.2

func (p *Publisher) Broadcast(param interface{})

Broadcast ...

func (*Publisher) Subscribe added in v0.1.2

func (p *Publisher) Subscribe(command string, f ISubscriber)

Subscribe ...

func (*Publisher) UnSubscribe added in v0.1.2

func (p *Publisher) UnSubscribe(command string)

UnSubscribe ...

type Uptime added in v0.1.2

type Uptime struct {
	Total      uint64    `json:"total"`
	AppStarted time.Time `json:"app_started"`
}

Uptime ...

type UsageStat added in v0.1.2

type UsageStat struct {
	Path              string  `json:"path"`
	Fstype            string  `json:"fstype"`
	Total             uint64  `json:"total"`
	Free              uint64  `json:"free"`
	Used              uint64  `json:"used"`
	UsedPercent       float64 `json:"used_percent"`
	InodesTotal       uint64  `json:"inodes_total"`
	InodesUsed        uint64  `json:"inodes_used"`
	InodesFree        uint64  `json:"inodes_free"`
	InodesUsedPercent float64 `json:"inodes_used_percent"`
}

UsageStat ...

type Workflow added in v0.1.2

type Workflow struct {
	Total    int64                    `json:"total"`
	Disabled int64                    `json:"disabled"`
	Status   map[int64]WorkflowStatus `json:"status"`
}

Workflow ...

type WorkflowAdd added in v0.1.2

type WorkflowAdd struct {
	TotalNum   int64
	EnabledNum int64
}

WorkflowAdd ...

type WorkflowDelete added in v0.1.2

type WorkflowDelete struct {
	TotalNum   int64
	EnabledNum int64
}

WorkflowDelete ...

type WorkflowManager added in v0.1.2

type WorkflowManager struct {
	// contains filtered or unexported fields
}

WorkflowManager ...

func NewWorkflowManager added in v0.1.2

func NewWorkflowManager(publisher IPublisher,
	adaptors *adaptors.Adaptors) (wf *WorkflowManager)

NewWorkflowManager ...

func (*WorkflowManager) GetStatus added in v0.1.2

func (d *WorkflowManager) GetStatus(workflowId int64) (status WorkflowStatus, err error)

GetStatus ...

func (*WorkflowManager) Snapshot added in v0.1.2

func (d *WorkflowManager) Snapshot() Workflow

Snapshot ...

type WorkflowStatus added in v0.1.2

type WorkflowStatus struct {
	Id         int64 `json:"id"`
	ScenarioId int64 `json:"scenario_id"`
}

WorkflowStatus ...

type WorkflowUpdateScenario added in v0.1.2

type WorkflowUpdateScenario struct {
	Id         int64
	ScenarioId int64
}

WorkflowUpdateScenario ...

type Zigbee2Mqtt added in v0.1.2

type Zigbee2Mqtt struct {
	Total    int64 `json:"total"`
	Disabled int64 `json:"disabled"`
}

Zigbee2Mqtt ...

type Zigbee2MqttAdd added in v0.1.2

type Zigbee2MqttAdd struct {
	TotalNum    int64
	DisabledNum int64
}

Zigbee2MqttAdd ...

type Zigbee2MqttDelete added in v0.1.2

type Zigbee2MqttDelete struct {
	TotalNum    int64
	DisabledNum int64
}

Zigbee2MqttDelete ...

type Zigbee2MqttManager added in v0.1.2

type Zigbee2MqttManager struct {
	// contains filtered or unexported fields
}

Zigbee2MqttManager ...

func NewZigbee2MqttManager added in v0.1.2

func NewZigbee2MqttManager(publisher IPublisher) *Zigbee2MqttManager

NewZigbee2MqttManager ...

func (*Zigbee2MqttManager) Snapshot added in v0.1.2

func (d *Zigbee2MqttManager) Snapshot() Zigbee2Mqtt

Snapshot ...

type Zigbee2MqttUpdate added in v0.2.0

type Zigbee2MqttUpdate struct{}

Zigbee2MqttUpdate ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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