Documentation ¶
Index ¶
- type Config
- type Controller
- func (c *Controller) AddFlowValue(site, station string, lat, long float64, t time.Time, flow float64)
- func (c *Controller) AddLevelValue(site, station string, lat, long float64, t time.Time, level float64)
- func (c *Controller) GetFlowsBuffer() (levels map[string]JSONLineMetric)
- func (c *Controller) GetLevelsBuffer() (levels map[string]JSONLineMetric)
- func (c *Controller) Send() (nbMetrics, nbValues int, err error)
- type JSONLineMetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { VMURL string VMUser string VMPass string Levels map[string]JSONLineMetric Flows map[string]JSONLineMetric Context context.Context }
Config allows to configure a vmpusher controller with New()
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller handles the communication with the victoria metrics server
func (*Controller) AddFlowValue ¶
func (c *Controller) AddFlowValue(site, station string, lat, long float64, t time.Time, flow float64)
AddFlowValue will add a water flow value of a given station into the internal buffer
func (*Controller) AddLevelValue ¶
func (c *Controller) AddLevelValue(site, station string, lat, long float64, t time.Time, level float64)
AddLevelValue will add a water level value of a given station into the internal buffer
func (*Controller) GetFlowsBuffer ¶
func (c *Controller) GetFlowsBuffer() (levels map[string]JSONLineMetric)
GetFlowsBuffer returns the current flows buffer
func (*Controller) GetLevelsBuffer ¶
func (c *Controller) GetLevelsBuffer() (levels map[string]JSONLineMetric)
GetLevelsBuffer returns the current levels buffer
func (*Controller) Send ¶
func (c *Controller) Send() (nbMetrics, nbValues int, err error)
Send will push all the values within the internal buffer to victoria metrics and flush the buffer if successfull
Click to show internal directories.
Click to hide internal directories.