Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package telemetry is a generated protocol buffer package.

It is generated from these files:

report.proto

It has these top-level messages:

Report
ClusterReport
NodeInfo
CPUInfo
HardwareInfo
OSInfo
MemInfo

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthReport = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowReport   = fmt.Errorf("proto: integer overflow")
)

Functions

func FillNodeInfo

func FillNodeInfo(ctx context.Context, info *NodeInfo) (err error)

FillNodeInfo fill HardwareInfo and Os info.

func HashReport

func HashReport(val string) string

HashReport return the hash value of val.

func NewUUID

func NewUUID() string

NewUUID return a new uuid.

func ScrubYaml

func ScrubYaml(data []byte, hashFieldNames map[string]struct{}) (scrubed []byte, err error)

ScrubYaml scrub the value. for string type, replace as "_", unless the field name is in the hashFieldNames. for any other type set as the zero value of the according type.

Types

type CPUInfo

type CPUInfo struct {
	Numcpu   int32    `protobuf:"varint,1,opt,name=numcpu,proto3" json:"numcpu,omitempty"`
	Sockets  int32    `protobuf:"varint,2,opt,name=sockets,proto3" json:"sockets,omitempty"`
	Cores    int32    `protobuf:"varint,3,opt,name=cores,proto3" json:"cores,omitempty"`
	Model    string   `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"`
	Mhz      float32  `protobuf:"fixed32,5,opt,name=mhz,proto3" json:"mhz,omitempty"`
	Features []string `protobuf:"bytes,6,rep,name=features" json:"features,omitempty"`
}

func (*CPUInfo) Descriptor

func (*CPUInfo) Descriptor() ([]byte, []int)

func (*CPUInfo) GetCores

func (m *CPUInfo) GetCores() int32

func (*CPUInfo) GetFeatures

func (m *CPUInfo) GetFeatures() []string

func (*CPUInfo) GetMhz

func (m *CPUInfo) GetMhz() float32

func (*CPUInfo) GetModel

func (m *CPUInfo) GetModel() string

func (*CPUInfo) GetNumcpu

func (m *CPUInfo) GetNumcpu() int32

func (*CPUInfo) GetSockets

func (m *CPUInfo) GetSockets() int32

func (*CPUInfo) Marshal

func (m *CPUInfo) Marshal() (dAtA []byte, err error)

func (*CPUInfo) MarshalTo

func (m *CPUInfo) MarshalTo(dAtA []byte) (int, error)

func (*CPUInfo) ProtoMessage

func (*CPUInfo) ProtoMessage()

func (*CPUInfo) Reset

func (m *CPUInfo) Reset()

func (*CPUInfo) Size

func (m *CPUInfo) Size() (n int)

func (*CPUInfo) String

func (m *CPUInfo) String() string

func (*CPUInfo) Unmarshal

func (m *CPUInfo) Unmarshal(dAtA []byte) error

type ClusterReport

type ClusterReport struct {
	UUID             string `protobuf:"bytes,1,opt,name=UUID,proto3" json:"UUID,omitempty"`
	Command          string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
	TakeMilliseconds uint64 `protobuf:"varint,3,opt,name=take_milliseconds,json=takeMilliseconds,proto3" json:"take_milliseconds,omitempty"`
	ExitCode         int32  `protobuf:"varint,4,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// only deploy and scale-out is setted:
	Topology string      `protobuf:"bytes,5,opt,name=topology,proto3" json:"topology,omitempty"`
	Nodes    []*NodeInfo `protobuf:"bytes,6,rep,name=nodes" json:"nodes,omitempty"`
}

func (*ClusterReport) Descriptor

func (*ClusterReport) Descriptor() ([]byte, []int)

func (*ClusterReport) GetCommand

func (m *ClusterReport) GetCommand() string

func (*ClusterReport) GetExitCode

func (m *ClusterReport) GetExitCode() int32

func (*ClusterReport) GetNodes

func (m *ClusterReport) GetNodes() []*NodeInfo

func (*ClusterReport) GetTakeMilliseconds

func (m *ClusterReport) GetTakeMilliseconds() uint64

func (*ClusterReport) GetTopology

func (m *ClusterReport) GetTopology() string

func (*ClusterReport) GetUUID

func (m *ClusterReport) GetUUID() string

func (*ClusterReport) Marshal

func (m *ClusterReport) Marshal() (dAtA []byte, err error)

func (*ClusterReport) MarshalTo

func (m *ClusterReport) MarshalTo(dAtA []byte) (int, error)

func (*ClusterReport) ProtoMessage

func (*ClusterReport) ProtoMessage()

func (*ClusterReport) Reset

func (m *ClusterReport) Reset()

func (*ClusterReport) Size

func (m *ClusterReport) Size() (n int)

func (*ClusterReport) String

func (m *ClusterReport) String() string

func (*ClusterReport) Unmarshal

func (m *ClusterReport) Unmarshal(dAtA []byte) error

type HardwareInfo

type HardwareInfo struct {
	Virtualization string  `protobuf:"bytes,1,opt,name=virtualization,proto3" json:"virtualization,omitempty"`
	Cpu            CPUInfo `protobuf:"bytes,2,opt,name=cpu" json:"cpu"`
	Mem            MemInfo `protobuf:"bytes,3,opt,name=mem" json:"mem"`
	Loadavg15      float32 `protobuf:"fixed32,4,opt,name=loadavg15,proto3" json:"loadavg15,omitempty"`
}

func GetHardwareInfo

func GetHardwareInfo(ctx context.Context) (info HardwareInfo, err error)

GetHardwareInfo get the HardwareInfo.

func (*HardwareInfo) Descriptor

func (*HardwareInfo) Descriptor() ([]byte, []int)

func (*HardwareInfo) GetCpu

func (m *HardwareInfo) GetCpu() CPUInfo

func (*HardwareInfo) GetLoadavg15

func (m *HardwareInfo) GetLoadavg15() float32

func (*HardwareInfo) GetMem

func (m *HardwareInfo) GetMem() MemInfo

func (*HardwareInfo) GetVirtualization

func (m *HardwareInfo) GetVirtualization() string

func (*HardwareInfo) Marshal

func (m *HardwareInfo) Marshal() (dAtA []byte, err error)

func (*HardwareInfo) MarshalTo

func (m *HardwareInfo) MarshalTo(dAtA []byte) (int, error)

func (*HardwareInfo) ProtoMessage

func (*HardwareInfo) ProtoMessage()

func (*HardwareInfo) Reset

func (m *HardwareInfo) Reset()

func (*HardwareInfo) Size

func (m *HardwareInfo) Size() (n int)

func (*HardwareInfo) String

func (m *HardwareInfo) String() string

func (*HardwareInfo) Unmarshal

func (m *HardwareInfo) Unmarshal(dAtA []byte) error

type MemInfo

type MemInfo struct {
	Total     uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Available uint64 `protobuf:"varint,2,opt,name=available,proto3" json:"available,omitempty"`
}

func (*MemInfo) Descriptor

func (*MemInfo) Descriptor() ([]byte, []int)

func (*MemInfo) GetAvailable

func (m *MemInfo) GetAvailable() uint64

func (*MemInfo) GetTotal

func (m *MemInfo) GetTotal() uint64

func (*MemInfo) Marshal

func (m *MemInfo) Marshal() (dAtA []byte, err error)

func (*MemInfo) MarshalTo

func (m *MemInfo) MarshalTo(dAtA []byte) (int, error)

func (*MemInfo) ProtoMessage

func (*MemInfo) ProtoMessage()

func (*MemInfo) Reset

func (m *MemInfo) Reset()

func (*MemInfo) Size

func (m *MemInfo) Size() (n int)

func (*MemInfo) String

func (m *MemInfo) String() string

func (*MemInfo) Unmarshal

func (m *MemInfo) Unmarshal(dAtA []byte) error

type Meta

type Meta struct {
	UUID   string `yaml:"uuid,omitempty"`
	Status Status `yaml:"status,omitempty"`
}

Meta data of telemetry.

func GetMeta added in v1.0.8

func GetMeta(env *environment.Environment) (meta *Meta, fname string, err error)

GetMeta read the telemeta from disk

func LoadFrom

func LoadFrom(fname string) (meta *Meta, err error)

LoadFrom load meta from the specify file, return a default Meta and save it if the file not exist.

func NewMeta

func NewMeta() *Meta

NewMeta create a new default Meta.

func (*Meta) SaveTo

func (m *Meta) SaveTo(fname string) error

SaveTo save to the specified file.

type NodeInfo

type NodeInfo struct {
	NodeId   string       `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
	Hardware HardwareInfo `protobuf:"bytes,6,opt,name=hardware" json:"hardware"`
	Os       OSInfo       `protobuf:"bytes,7,opt,name=os" json:"os"`
}

func (*NodeInfo) Descriptor

func (*NodeInfo) Descriptor() ([]byte, []int)

func (*NodeInfo) GetHardware

func (m *NodeInfo) GetHardware() HardwareInfo

func (*NodeInfo) GetNodeId

func (m *NodeInfo) GetNodeId() string

func (*NodeInfo) GetOs

func (m *NodeInfo) GetOs() OSInfo

func (*NodeInfo) Marshal

func (m *NodeInfo) Marshal() (dAtA []byte, err error)

func (*NodeInfo) MarshalTo

func (m *NodeInfo) MarshalTo(dAtA []byte) (int, error)

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) Reset

func (m *NodeInfo) Reset()

func (*NodeInfo) Size

func (m *NodeInfo) Size() (n int)

func (*NodeInfo) String

func (m *NodeInfo) String() string

func (*NodeInfo) Unmarshal

func (m *NodeInfo) Unmarshal(dAtA []byte) error

type OSInfo

type OSInfo struct {
	Family   string `protobuf:"bytes,1,opt,name=family,proto3" json:"family,omitempty"`
	Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"`
	Version  string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
}

func GetOSInfo

func GetOSInfo(ctx context.Context) (info OSInfo, err error)

GetOSInfo get the OSInfo.

func (*OSInfo) Descriptor

func (*OSInfo) Descriptor() ([]byte, []int)

func (*OSInfo) GetFamily

func (m *OSInfo) GetFamily() string

func (*OSInfo) GetPlatform

func (m *OSInfo) GetPlatform() string

func (*OSInfo) GetVersion

func (m *OSInfo) GetVersion() string

func (*OSInfo) Marshal

func (m *OSInfo) Marshal() (dAtA []byte, err error)

func (*OSInfo) MarshalTo

func (m *OSInfo) MarshalTo(dAtA []byte) (int, error)

func (*OSInfo) ProtoMessage

func (*OSInfo) ProtoMessage()

func (*OSInfo) Reset

func (m *OSInfo) Reset()

func (*OSInfo) Size

func (m *OSInfo) Size() (n int)

func (*OSInfo) String

func (m *OSInfo) String() string

func (*OSInfo) Unmarshal

func (m *OSInfo) Unmarshal(dAtA []byte) error

type Report

type Report struct {
	EventUUID          string `protobuf:"bytes,1,opt,name=eventUUID,proto3" json:"eventUUID,omitempty"`
	EventUnixTimestamp int64  `protobuf:"varint,2,opt,name=event_unix_timestamp,json=eventUnixTimestamp,proto3" json:"event_unix_timestamp,omitempty"`
	// Types that are valid to be assigned to EventDetail:
	//	*Report_Cluster
	EventDetail isReport_EventDetail `protobuf_oneof:"event_detail"`
}

func (*Report) Descriptor

func (*Report) Descriptor() ([]byte, []int)

func (*Report) GetCluster

func (m *Report) GetCluster() *ClusterReport

func (*Report) GetEventDetail

func (m *Report) GetEventDetail() isReport_EventDetail

func (*Report) GetEventUUID

func (m *Report) GetEventUUID() string

func (*Report) GetEventUnixTimestamp

func (m *Report) GetEventUnixTimestamp() int64

func (*Report) Marshal

func (m *Report) Marshal() (dAtA []byte, err error)

func (*Report) MarshalTo

func (m *Report) MarshalTo(dAtA []byte) (int, error)

func (*Report) ProtoMessage

func (*Report) ProtoMessage()

func (*Report) Reset

func (m *Report) Reset()

func (*Report) Size

func (m *Report) Size() (n int)

func (*Report) String

func (m *Report) String() string

func (*Report) Unmarshal

func (m *Report) Unmarshal(dAtA []byte) error

func (*Report) XXX_OneofFuncs

func (*Report) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Report_Cluster

type Report_Cluster struct {
	Cluster *ClusterReport `protobuf:"bytes,3,opt,name=cluster,oneof"`
}

func (*Report_Cluster) MarshalTo

func (m *Report_Cluster) MarshalTo(dAtA []byte) (int, error)

func (*Report_Cluster) Size

func (m *Report_Cluster) Size() (n int)

type ScrubStrategy

type ScrubStrategy int

ScrubStrategy for scrub sensible value.

type Status

type Status string

Status of telemetry.

const (
	EnableStatus  Status = "enable"
	DisableStatus Status = "disable"
)

Status of telemetry

type Telemetry

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

Telemetry control telemetry.

func NewTelemetry

func NewTelemetry() *Telemetry

NewTelemetry return a new Telemetry instance.

func (*Telemetry) Report

func (t *Telemetry) Report(ctx context.Context, msg *Report) error

Report report the msg right away.

Jump to

Keyboard shortcuts

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