Documentation ¶
Index ¶
- type Conn
- type Manager
- func (m *Manager) CacheMetrics(metrics []*dto.MetricFamily)
- func (m *Manager) Cleanup()
- func (m *Manager) CollectMetrics(peripheralIDs ...string) (metricsForNode []*dto.MetricFamily, paramsForAgent []map[string]string, ...)
- func (m *Manager) CreateExtensionHandleFunc(extensionName string) (server.ExtensionHandleFunc, server.OutOfBandMsgHandleFunc)
- func (m *Manager) Delete(ids ...string) (result []*aranyagopb.PeripheralStatusMsg)
- func (m *Manager) Ensure(cmd *aranyagopb.PeripheralEnsureCmd) (err error)
- func (m *Manager) GetAllStatuses() []*aranyagopb.PeripheralStatusMsg
- func (m *Manager) GetStatus(peripheralID string) *aranyagopb.PeripheralStatusMsg
- func (m *Manager) Operate(ctx context.Context, peripheralID, operationID string, data []byte) ([][]byte, error)
- func (m *Manager) RetrieveCachedMetrics() interface{}
- type Metric
- type MetricReportKey
- type MetricReportSpec
- type MetricSpec
- type MetricsCache
- type MetricsReporter
- type Peripheral
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func NewConnectivity ¶
func NewConnectivity( id uint64, ec *server.ExtensionContext, ) *Conn
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(ctx context.Context, config *conf.PeripheralExtensionConfig) *Manager
func (*Manager) CacheMetrics ¶
func (m *Manager) CacheMetrics(metrics []*dto.MetricFamily)
func (*Manager) CollectMetrics ¶
func (m *Manager) CollectMetrics(peripheralIDs ...string) ( metricsForNode []*dto.MetricFamily, paramsForAgent []map[string]string, metricsForAgent [][]*dto.MetricFamily, )
nolint:gocyclo
func (*Manager) CreateExtensionHandleFunc ¶
func (m *Manager) CreateExtensionHandleFunc( extensionName string, ) (server.ExtensionHandleFunc, server.OutOfBandMsgHandleFunc)
func (*Manager) Delete ¶
func (m *Manager) Delete(ids ...string) (result []*aranyagopb.PeripheralStatusMsg)
func (*Manager) Ensure ¶
func (m *Manager) Ensure(cmd *aranyagopb.PeripheralEnsureCmd) (err error)
func (*Manager) GetAllStatuses ¶
func (m *Manager) GetAllStatuses() []*aranyagopb.PeripheralStatusMsg
func (*Manager) GetStatus ¶
func (m *Manager) GetStatus(peripheralID string) *aranyagopb.PeripheralStatusMsg
func (*Manager) Operate ¶
type Metric ¶
type Metric struct { Name string Value float64 Timestamp int64 ValueType dto.MetricType ReportKey MetricReportKey ParamsForReporting map[string]string }
type MetricReportSpec ¶
type MetricReportSpec struct { Metrics *dto.MetricFamily ParamsForReporting map[string]string }
MetricReportSpec defines how to report this metric
type MetricSpec ¶
type MetricSpec struct { Name string ValueType aranyagopb.PeripheralMetric_ValueType ParamsForCollecting map[string]string ReportKey MetricReportKey ParamsForReporting map[string]string }
MetricSpec defines how to collect one metric from peripheral
type MetricsCache ¶
type MetricsCache struct {
// contains filtered or unexported fields
}
func NewMetricsCache ¶
func NewMetricsCache(maxCacheTime time.Duration) *MetricsCache
func (*MetricsCache) CacheMetrics ¶
func (m *MetricsCache) CacheMetrics(metrics []*dto.MetricFamily)
func (*MetricsCache) RetrieveCachedMetrics ¶
func (m *MetricsCache) RetrieveCachedMetrics() []*dto.MetricFamily
type MetricsReporter ¶
type MetricsReporter struct {
// contains filtered or unexported fields
}
func NewMetricsReporter ¶
func NewMetricsReporter( ctx context.Context, connectorHashHex string, conn *Conn, ) *MetricsReporter
func (*MetricsReporter) Close ¶
func (r *MetricsReporter) Close() error
func (*MetricsReporter) ReportMetrics ¶
func (r *MetricsReporter) ReportMetrics(params map[string]string, metrics []*dto.MetricFamily) error
func (MetricsReporter) Status ¶
func (d MetricsReporter) Status() *aranyagopb.PeripheralStatusMsg
type Peripheral ¶
type Peripheral struct {
// contains filtered or unexported fields
}
func NewPeripheral ¶
func NewPeripheral( ctx context.Context, name string, connector *Conn, operations []*aranyagopb.PeripheralOperation, metrics []*aranyagopb.PeripheralMetric, ) *Peripheral
func (*Peripheral) Close ¶
func (d *Peripheral) Close() error
func (*Peripheral) CollectMetrics ¶
func (d *Peripheral) CollectMetrics(resultCh chan<- *Metric)
CollectMetrics will collect all metrics configured when creating this peripheral and close the resultCh when finished
func (*Peripheral) Operate ¶
func (Peripheral) Status ¶
func (d Peripheral) Status() *aranyagopb.PeripheralStatusMsg
Click to show internal directories.
Click to hide internal directories.