Documentation ¶
Index ¶
- Variables
- type Session
- func (session *Session) AddSampledValue(samples []types.SampledValue)
- func (session *Session) CalculateAvgPower() float64
- func (session *Session) CalculateEnergyConsumption() float64
- func (session *Session) CalculateEnergyConsumptionWithAvgPower() float64
- func (session *Session) EndSession()
- func (session *Session) StartSession(transactionId string, tagId string) error
- type SessionInterface
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { IsActive bool TransactionId string TagId string Started string Consumption []types.MeterValue }
func NewEmptySession ¶
func NewEmptySession() *Session
func (*Session) AddSampledValue ¶
func (session *Session) AddSampledValue(samples []types.SampledValue)
AddSampledValue Add all the samples taken to the Session.
func (*Session) CalculateAvgPower ¶
CalculateAvgPower calculate the average power for a session based on sampled values
func (*Session) CalculateEnergyConsumption ¶
CalculateEnergyConsumption calculate the total energy consumption for a session that was active only with energy measurments
func (*Session) CalculateEnergyConsumptionWithAvgPower ¶
CalculateEnergyConsumptionWithAvgPower calculate the total energy consumption for a session that was active, if it had any measurements
func (*Session) EndSession ¶
func (session *Session) EndSession()
EndSession End the Session if one is active. Reset the attributes, except the measurands.
type SessionInterface ¶
Click to show internal directories.
Click to hide internal directories.