things

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0, EPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CPUUtilization measurements id
	CPUUtilization = "cpu.utilization"

	// MemoryUtilization measurements id
	MemoryUtilization = "memory.utilization"

	// MemoryTotal measurements id
	MemoryTotal = "memory.total"

	// MemoryUsed measurements id
	MemoryUsed = "memory.used"

	// IOReadBytes measurements id
	IOReadBytes = "io.readBytes"

	// IOWriteBytes measurements id
	IOWriteBytes = "io.writeBytes"

	// NetReadBytes measurements id
	NetReadBytes = "net.readBytes"

	// NetWriteBytes measurements id
	NetWriteBytes = "net.writeBytes"

	// PIDs number of pid
	PIDs = "pids"
)
View Source
const (
	SoftwareUpdatableFeatureID           = "SoftwareUpdatable"
	SoftwareUpdatableDefinitionNamespace = "org.eclipse.hawkbit.swupdatable"
	SoftwareUpdatableDefinitionName      = "SoftwareUpdatable"
	SoftwareUpdatableDefinitionVersion   = "2.0.0"
)

SoftwareUpdatable feature information

View Source
const (
	// ContainerFactoryFeatureID is the feature ID of the container factory
	ContainerFactoryFeatureID = "ContainerFactory"
)
View Source
const (
	// ContainerThingsManagerServiceLocalID is the ID of the local container manager service of things
	ContainerThingsManagerServiceLocalID = "container-management.service.local.v1.service-things-container-manager"
)
View Source
const (
	// MetricsFeatureID is the feature ID of the container metrics
	MetricsFeatureID = "Metrics"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerThingsManager

type ContainerThingsManager interface {
	Connect() error
	Disconnect()
}

ContainerThingsManager interface declares connect and disconnect functions

type ContainerThingsManagerOpt

type ContainerThingsManagerOpt func(thingsOptions *thingsOpts) error

ContainerThingsManagerOpt represents the available configuration options for the ContainerThingsManager service

func WithConnectionAcknowledgeTimeout

func WithConnectionAcknowledgeTimeout(acknowledgeTimeout time.Duration) ContainerThingsManagerOpt

WithConnectionAcknowledgeTimeout configures the timeout for the acknowledge receival

func WithConnectionBroker

func WithConnectionBroker(broker string) ContainerThingsManagerOpt

WithConnectionBroker configures the broker, where the connection will be established

func WithConnectionClientPassword

func WithConnectionClientPassword(password string) ContainerThingsManagerOpt

WithConnectionClientPassword configures the client password used when establishing connection to the broker

func WithConnectionClientUsername

func WithConnectionClientUsername(username string) ContainerThingsManagerOpt

WithConnectionClientUsername configures the client username used when establishing connection to the broker

func WithConnectionConnectTimeout

func WithConnectionConnectTimeout(connectTimeout time.Duration) ContainerThingsManagerOpt

WithConnectionConnectTimeout configures the timeout before terminating the connect attempt

func WithConnectionDisconnectTimeout

func WithConnectionDisconnectTimeout(disconnectTimeout time.Duration) ContainerThingsManagerOpt

WithConnectionDisconnectTimeout configures the duration of inactivity before disconnecting from the broker

func WithConnectionKeepAlive

func WithConnectionKeepAlive(keepAlive time.Duration) ContainerThingsManagerOpt

WithConnectionKeepAlive configures the time between between each check for the connection presence

func WithConnectionSubscribeTimeout

func WithConnectionSubscribeTimeout(subscribeTimeout time.Duration) ContainerThingsManagerOpt

WithConnectionSubscribeTimeout configures the timeout before terminating the subscribe attempt

func WithConnectionUnsubscribeTimeout

func WithConnectionUnsubscribeTimeout(unsubscribeTimeout time.Duration) ContainerThingsManagerOpt

WithConnectionUnsubscribeTimeout configures the timeout before terminating the unsubscribe attempt

func WithFeatures

func WithFeatures(featureIds []string) ContainerThingsManagerOpt

WithFeatures configures the container runtime's Things representation via providing the desired Ditto Features to be created by ID

func WithMetaPath

func WithMetaPath(path string) ContainerThingsManagerOpt

WithMetaPath configures the directory to be used for storage by the service

func WithTLSConfig

func WithTLSConfig(rootCA, clientCert, clientKey string) ContainerThingsManagerOpt

WithTLSConfig configures the CA certificate for TLS communication

type Duration

type Duration struct {
	time.Duration
}

Duration is used to support duration string un-marshalling to time.Duration.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON supports marshalling to '50s' string format.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON supports '50s' string format.

type Filter

type Filter struct {
	ID         []string `json:"id"`
	Originator string   `json:"originator"`
}

Filter defines the type of metric data to be reported.

type Measurement

type Measurement struct {
	ID    string  `json:"id"`
	Value float64 `json:"value"`
}

Measurement represents a measured value per metric ID.

type MetricData

type MetricData struct {
	Snapshot  []OriginatorMeasurements `json:"snapshot"`
	Timestamp int64                    `json:"timestamp"`
}

MetricData contains a snapshot with all originators' measurements collected at a concrete time.

type OriginatorMeasurements

type OriginatorMeasurements struct {
	Originator   string        `json:"originator"`
	Measurements []Measurement `json:"measurements"`
}

OriginatorMeasurements represents all the measurements collected per originator.

type Request

type Request struct {
	Frequency Duration `json:"frequency"`
	Filter    []Filter `json:"filter"`
}

Request defines the metric data request with defined frequency.

func (*Request) HasFilterFor

func (mr *Request) HasFilterFor(originator string) bool

HasFilterFor returns true if there is filter for the provided originator.

func (*Request) HasFilterForItem

func (mr *Request) HasFilterForItem(dataID, dataOriginator string) bool

HasFilterForItem returns true if there is filter for same originator and filter's ID that is the same or with wildcard for the last ID segment, i.e. for provided "cpu.utilization" will return true if there is "cpu.utilization", "cpu.*" filter ID or if no filters are set.

Jump to

Keyboard shortcuts

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