Documentation ¶
Index ¶
Constants ¶
const (
ConnectionEventType = "nimona.io/telemetry/connection"
)
const (
ObjectEventType = "nimona.io/telemetry/object"
)
Variables ¶
var DefaultClient *metrics
var ErrStorageInit = errors.New("Error initializing storage")
ErrStorageInit is returned when a storage backend fails to initialize
Functions ¶
func NewTelemetry ¶
func NewTelemetry(exchange Exchanger, localPeer *crypto.PrivateKey, statsAddress string) error
Types ¶
type Collectable ¶
type Collectable interface { Collection() string Measurements() map[string]interface{} ToObject() *object.Object }
Collectable for metric events
type Collector ¶
type Collector interface {
Collect(Collectable) error
}
Collector interface for collecting metrics
var DefaultCollector Collector
DefaultCollector for holding a global collector
type ConnectionEvent ¶
type ConnectionEvent struct { // Event attributes Direction string `json:"direction"` }
ConnectionEvent for reporting connection info
func (*ConnectionEvent) Collection ¶
func (ce *ConnectionEvent) Collection() string
Collection returns the string representation of the structure
func (*ConnectionEvent) FromObject ¶
func (s *ConnectionEvent) FromObject(o *object.Object) error
FromObject populates the struct from a f12n object
func (ConnectionEvent) GetType ¶
func (s ConnectionEvent) GetType() string
GetType returns the object's type
func (*ConnectionEvent) Measurements ¶
func (ce *ConnectionEvent) Measurements() map[string]interface{}
Measurements returns a map with all the metrics for the event
func (ConnectionEvent) ToObject ¶
func (s ConnectionEvent) ToObject() *object.Object
ToObject returns a f12n object
type ObjectEvent ¶
type ObjectEvent struct { // Event attributes Direction string `json:"direction"` ContentType string `json:"contentType"` ObjectSize int `json:"size"` }
ObjectEvent for reporting object metrics
func (*ObjectEvent) Collection ¶
func (ee *ObjectEvent) Collection() string
Collection returns the string representation of the structure
func (*ObjectEvent) FromObject ¶
func (s *ObjectEvent) FromObject(o *object.Object) error
FromObject populates the struct from a f12n object
func (ObjectEvent) GetType ¶
func (s ObjectEvent) GetType() string
GetType returns the object's type
func (*ObjectEvent) Measurements ¶
func (ee *ObjectEvent) Measurements() map[string]interface{}
Measurements returns a map with all the metrics for the event
func (ObjectEvent) ToObject ¶
func (s ObjectEvent) ToObject() *object.Object
ToObject returns a f12n object