Documentation ¶
Overview ¶
Metrics data holding and manipulation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpMetricsReporter ¶
type MetricsReporter ¶
type MetricsReporter interface { // Registers application uptime metric Uptime() SystemMetricsReporter RoomMetricsReporter HttpMetricsReporter }
func NewPrometheusReporter ¶
func NewPrometheusReporter() MetricsReporter
type MetricsSession ¶
type MetricsSession interface { // Reports metrics based on device data. Report(values *model.DataPollResponse, reporter MetricsReporter) // Resets all metrics. Reset(reporter MetricsReporter) }
Metrics session data holder.
func NewSession ¶
func NewSession(sysId string, reportConfiguration *config.ReportConfiguration) MetricsSession
Creates a new session to report metrics.
type PrometheusPublisher ¶
type PrometheusPublisher interface { io.Closer // Starts to listen and serve. Start() error // Stops serving and listening. Stop(context context.Context) error }
HTTP server
func NewPrometheusPublisher ¶
func NewPrometheusPublisher(port int) PrometheusPublisher
Creates a new server with the given port
type RoomMetricsReporter ¶
type RoomMetricsReporter interface { // Reports if the device connection is active or not. RoomConnected(sysId string, id string, room string, connected bool) // Reports the room temperature. RoomTemperature(sysId string, id string, room string, temperature float64) // Reports the room dew temperature. RoomDewTemperature(sysId string, id string, room string, temperature float64) // Reports the room target temperature. RoomTargetTemperature(sysId string, id string, room string, temperature float64) // Reports the relative humidity. RoomHumidity(sysId string, id string, room string, humidity float64) // Reports the relay state. RoomRelay(sysId string, id string, room string, connected bool) // Removes a room from reporting. RemoveRoom(sysId string, id string, room string) }
type SystemMetricsReporter ¶
type SystemMetricsReporter interface { // Reports if the device connection is active or not. Connected(sysId string, connected bool) // Reports the water temperature. WaterTemperature(sysId string, temperature float64) // Reports the external temperature. ExternalTemperature(sysId string, temperature float64) // Removes device from reporting. RemoveDevice(sysId string) }
Click to show internal directories.
Click to hide internal directories.