metrics

package
v0.4.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const ZitiSession = "zt-session"

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(cfg *AgentConfig, str *store.Store, ifxCfg *InfluxConfig) (*Agent, error)

func (*Agent) AddUsageSink

func (a *Agent) AddUsageSink(snk UsageSink)

func (*Agent) Start

func (a *Agent) Start() error

func (*Agent) Stop

func (a *Agent) Stop()

type AgentConfig

type AgentConfig struct {
	Source interface{}
}

type AmqpSinkConfig

type AmqpSinkConfig struct {
	Url       string `cf:"+secret"`
	QueueName string
}

type AmqpSourceConfig

type AmqpSourceConfig struct {
	Url       string `cf:"+secret"`
	QueueName string
}

type Bridge

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

func NewBridge

func NewBridge(cfg *BridgeConfig) (*Bridge, error)

func (*Bridge) Start

func (b *Bridge) Start() (join chan struct{}, err error)

func (*Bridge) Stop

func (b *Bridge) Stop()

type BridgeConfig

type BridgeConfig struct {
	Source interface{}
	Sink   interface{}
}

type Config

type Config struct {
	Influx *InfluxConfig
	Agent  *AgentConfig
}

type FileSourceConfig

type FileSourceConfig struct {
	Path        string
	PointerPath string
}

type InfluxConfig

type InfluxConfig struct {
	Url    string
	Bucket string
	Org    string
	Token  string `cf:"+secret"`
}

type Usage

type Usage struct {
	ProcessedStamp time.Time
	IntervalStart  time.Time
	ZitiServiceId  string
	ZitiCircuitId  string
	ShareToken     string
	EnvironmentId  int64
	AccountId      int64
	FrontendTx     int64
	FrontendRx     int64
	BackendTx      int64
	BackendRx      int64
}

func Ingest

func Ingest(event ZitiEventJson) (*Usage, error)

func (Usage) String

func (u Usage) String() string

type UsageSink

type UsageSink interface {
	Handle(u *Usage) error
}

type WebsocketSourceConfig

type WebsocketSourceConfig struct {
	WebsocketEndpoint string // wss://127.0.0.1:1280/fabric/v1/ws-api
	ApiEndpoint       string // https://127.0.0.1:1280
	Username          string
	Password          string `cf:"+secret"`
}

type ZitiEventAMQP

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

func (*ZitiEventAMQP) Ack

func (e *ZitiEventAMQP) Ack() error

func (*ZitiEventAMQP) Data

func (e *ZitiEventAMQP) Data() ZitiEventJson

type ZitiEventJson

type ZitiEventJson string

type ZitiEventJsonMsg

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

func (*ZitiEventJsonMsg) Ack

func (e *ZitiEventJsonMsg) Ack() error

func (*ZitiEventJsonMsg) Data

func (e *ZitiEventJsonMsg) Data() ZitiEventJson

type ZitiEventJsonSink

type ZitiEventJsonSink interface {
	Handle(event ZitiEventJson) error
}

type ZitiEventJsonSource

type ZitiEventJsonSource interface {
	Start(chan ZitiEventMsg) (join chan struct{}, err error)
	Stop()
}

type ZitiEventMsg

type ZitiEventMsg interface {
	Data() ZitiEventJson
	Ack() error
}

Jump to

Keyboard shortcuts

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