forwarder

package
v0.0.0-...-1986343 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMQTTClient

func InitMQTTClient(clientid string, deliveries *chan string, dataRateDisplayInterval int)

InitMQTTClient Initiates the MQTT client and connects to the broker

func InitMQTTStatsClient

func InitMQTTStatsClient(clientid string, mqttStoredMessages *string)

InitMQTTStatsClient Initiates the MQTT client and connects to the broker

func MQTTCommander

func MQTTCommander(clientid string, command string)

MQTTCommander Initiates the MQTT client and connects to the broker

func NewConsumer

func NewConsumer(amqpConnDetails AMQPConnDetailsType, deliveries chan string)

NewConsumer creates a consumer and returns the delivery channel

func NewProducer

func NewProducer(amqpConnDetails AMQPConnDetailsType, deliveries *chan string)

NewProducer creates a producer

func NewRateCounter

func NewRateCounter(window time.Duration, countChannel chan bool)

NewRateCounter initiates a new counter

func RunCommandListner

func RunCommandListner(dataRateCmdGoChan chan<- int64, sensorCommandChannel chan<- string, statsCmdGoChan chan<- string)

RunCommandListner listens remote commands

func RunForwarder

func RunForwarder(windowSizeCmdGoChan <-chan int64)

RunForwarder runs all the configured forwarders

func RunForwarderWithRateLimiter

func RunForwarderWithRateLimiter(dataRateCmdGoChan <-chan (int64))

RunForwarderWithRateLimiter runs the MQTT Client and Forwards the data to AMQP broker in cloud using. This also applies rate limiter

Types

type AMQPConnDetailsType

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

AMQPConnDetailsType is the structure definition for holding connection information

type SimpleStatsData

type SimpleStatsData struct {
	IdleCPU float32
	IdleMen float32
}

SimpleStatsData stores basic stats infomation (CPU and memory)

type Stats

type Stats struct {

	// stats this process
	ProcUptime        float64 //seconds
	ProcMemUsedPct    float64
	ProcCPUAvg        systemstat.ProcCPUAverage
	LastProcCPUSample systemstat.ProcCPUSample `json:"-"`
	CurProcCPUSample  systemstat.ProcCPUSample `json:"-"`

	// stats for whole system
	LastCPUSample systemstat.CPUSample `json:"-"`
	CurCPUSample  systemstat.CPUSample `json:"-"`
	SysCPUAvg     systemstat.CPUAverage
	SysMemK       systemstat.MemSample
	LoadAverage   systemstat.LoadAvgSample
	SysUptime     systemstat.UptimeSample
	// contains filtered or unexported fields
}

Stats struct stores the stats

func (*Stats) GatherStats

func (s *Stats) GatherStats(percent bool)

GatherStats gathers stats

type StatsChannelConfig

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

StatsChannelConfig structure keeps the channel configuration

Jump to

Keyboard shortcuts

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