stats

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthStats        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStats          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStats = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NewStatsEndpoints

func NewStatsEndpoints() []*apipb.Endpoint

API Endpoints for Stats service

func RegisterStatsHandler

func RegisterStatsHandler(s server.Server, hdlr StatsHandler, opts ...server.HandlerOption) error

func RegisterStatsServer

func RegisterStatsServer(s *grpc.Server, srv StatsServer)

Types

type Node

type Node struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
}

Node describes a single instance of a service.

func (*Node) Descriptor

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

func (*Node) GetAddress

func (m *Node) GetAddress() string

func (*Node) GetId

func (m *Node) GetId() string

func (*Node) Marshal

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

func (*Node) MarshalTo

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

func (*Node) MarshalToSizedBuffer

func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) Size

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

func (*Node) String

func (m *Node) String() string

func (*Node) Unmarshal

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

func (*Node) XXX_DiscardUnknown

func (m *Node) XXX_DiscardUnknown()

func (*Node) XXX_Marshal

func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Node) XXX_Merge

func (m *Node) XXX_Merge(src proto.Message)

func (*Node) XXX_Size

func (m *Node) XXX_Size() int

func (*Node) XXX_Unmarshal

func (m *Node) XXX_Unmarshal(b []byte) error

type ReadRequest

type ReadRequest struct {
	// If set, only return services matching the filter
	Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// If false, only the current snapshots will be returned.
	// If true, all historical snapshots in memory will be returned.
	Past bool `protobuf:"varint,2,opt,name=past,proto3" json:"past,omitempty"`
}

func (*ReadRequest) Descriptor

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

func (*ReadRequest) GetPast

func (m *ReadRequest) GetPast() bool

func (*ReadRequest) GetService

func (m *ReadRequest) GetService() *Service

func (*ReadRequest) Marshal

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

func (*ReadRequest) MarshalTo

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

func (*ReadRequest) MarshalToSizedBuffer

func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) Reset

func (m *ReadRequest) Reset()

func (*ReadRequest) Size

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

func (*ReadRequest) String

func (m *ReadRequest) String() string

func (*ReadRequest) Unmarshal

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

func (*ReadRequest) XXX_DiscardUnknown

func (m *ReadRequest) XXX_DiscardUnknown()

func (*ReadRequest) XXX_Marshal

func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReadRequest) XXX_Merge

func (m *ReadRequest) XXX_Merge(src proto.Message)

func (*ReadRequest) XXX_Size

func (m *ReadRequest) XXX_Size() int

func (*ReadRequest) XXX_Unmarshal

func (m *ReadRequest) XXX_Unmarshal(b []byte) error

type ReadResponse

type ReadResponse struct {
	Stats []*Snapshot `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"`
}

func (*ReadResponse) Descriptor

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

func (*ReadResponse) GetStats

func (m *ReadResponse) GetStats() []*Snapshot

func (*ReadResponse) Marshal

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

func (*ReadResponse) MarshalTo

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

func (*ReadResponse) MarshalToSizedBuffer

func (m *ReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) Reset

func (m *ReadResponse) Reset()

func (*ReadResponse) Size

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

func (*ReadResponse) String

func (m *ReadResponse) String() string

func (*ReadResponse) Unmarshal

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

func (*ReadResponse) XXX_DiscardUnknown

func (m *ReadResponse) XXX_DiscardUnknown()

func (*ReadResponse) XXX_Marshal

func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReadResponse) XXX_Merge

func (m *ReadResponse) XXX_Merge(src proto.Message)

func (*ReadResponse) XXX_Size

func (m *ReadResponse) XXX_Size() int

func (*ReadResponse) XXX_Unmarshal

func (m *ReadResponse) XXX_Unmarshal(b []byte) error

type Service

type Service struct {
	// Service name, e.g. go.vine.service.greeter
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Node    *Node  `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"`
}

Service describes a service running in the vine network.

func (*Service) Descriptor

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

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) GetNode

func (m *Service) GetNode() *Node

func (*Service) GetVersion

func (m *Service) GetVersion() string

func (*Service) Marshal

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

func (*Service) MarshalTo

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

func (*Service) MarshalToSizedBuffer

func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) Size

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

func (*Service) String

func (m *Service) String() string

func (*Service) Unmarshal

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

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Service) XXX_Merge

func (m *Service) XXX_Merge(src proto.Message)

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

func (m *Service) XXX_Unmarshal(b []byte) error

type Snapshot

type Snapshot struct {
	Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// Unix timestamp, e.g. 1575561487
	Started int64 `protobuf:"varint,2,opt,name=started,proto3" json:"started,omitempty"`
	// Uptime in seconds
	Uptime uint64 `protobuf:"varint,3,opt,name=uptime,proto3" json:"uptime,omitempty"`
	// Heap allocated in bytes (TODO: change to resident set size)
	Memory uint64 `protobuf:"varint,4,opt,name=memory,proto3" json:"memory,omitempty"`
	// Number of Goroutines
	Threads uint64 `protobuf:"varint,5,opt,name=threads,proto3" json:"threads,omitempty"`
	// GC Pause total in ns
	Gc uint64 `protobuf:"varint,6,opt,name=gc,proto3" json:"gc,omitempty"`
	// Total number of request
	Requests uint64 `protobuf:"varint,7,opt,name=requests,proto3" json:"requests,omitempty"`
	// Total number of errors
	Errors uint64 `protobuf:"varint,8,opt,name=errors,proto3" json:"errors,omitempty"`
	// Timestamp at the time of the taking of the snapshot, seconds since unix epoch
	Timestamp uint64 `protobuf:"varint,9,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
}

Snapshot is a snapshot of Debug.Stats from a particular service when called.

func (*Snapshot) Descriptor

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

func (*Snapshot) GetErrors

func (m *Snapshot) GetErrors() uint64

func (*Snapshot) GetGc

func (m *Snapshot) GetGc() uint64

func (*Snapshot) GetMemory

func (m *Snapshot) GetMemory() uint64

func (*Snapshot) GetRequests

func (m *Snapshot) GetRequests() uint64

func (*Snapshot) GetService

func (m *Snapshot) GetService() *Service

func (*Snapshot) GetStarted

func (m *Snapshot) GetStarted() int64

func (*Snapshot) GetThreads

func (m *Snapshot) GetThreads() uint64

func (*Snapshot) GetTimestamp

func (m *Snapshot) GetTimestamp() uint64

func (*Snapshot) GetUptime

func (m *Snapshot) GetUptime() uint64

func (*Snapshot) Marshal

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

func (*Snapshot) MarshalTo

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

func (*Snapshot) MarshalToSizedBuffer

func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) Size

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

func (*Snapshot) String

func (m *Snapshot) String() string

func (*Snapshot) Unmarshal

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

func (*Snapshot) XXX_DiscardUnknown

func (m *Snapshot) XXX_DiscardUnknown()

func (*Snapshot) XXX_Marshal

func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Snapshot) XXX_Merge

func (m *Snapshot) XXX_Merge(src proto.Message)

func (*Snapshot) XXX_Size

func (m *Snapshot) XXX_Size() int

func (*Snapshot) XXX_Unmarshal

func (m *Snapshot) XXX_Unmarshal(b []byte) error

type StatsClient

type StatsClient interface {
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
	Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
	Stream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (Stats_StreamClient, error)
}

StatsClient is the client API for Stats service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewStatsClient

func NewStatsClient(cc *grpc.ClientConn) StatsClient

type StatsHandler

Server API for Stats service Stats retrieves a snapshot of the Debug.Stats data for services

type StatsServer

StatsServer is the server API for Stats service.

type StatsService

type StatsService interface {
	Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
	Write(ctx context.Context, in *WriteRequest, opts ...client.CallOption) (*WriteResponse, error)
	Stream(ctx context.Context, in *StreamRequest, opts ...client.CallOption) (Stats_StreamService, error)
}

Client API for Stats service Stats retrieves a snapshot of the Debug.Stats data for services

func NewStatsService

func NewStatsService(name string, c client.Client) StatsService

type Stats_StreamClient

type Stats_StreamClient interface {
	Recv() (*StreamResponse, error)
	grpc.ClientStream
}

type Stats_StreamServer

type Stats_StreamServer interface {
	Send(*StreamResponse) error
	grpc.ServerStream
}

type Stats_StreamService

type Stats_StreamService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*StreamResponse, error)
}

type Stats_StreamStream

type Stats_StreamStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*StreamResponse) error
}

type StreamRequest

type StreamRequest struct {
	// If set, only return services matching the filter
	Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// If set, only return services matching the namespace
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
}

func (*StreamRequest) Descriptor

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

func (*StreamRequest) GetNamespace

func (m *StreamRequest) GetNamespace() string

func (*StreamRequest) GetService

func (m *StreamRequest) GetService() *Service

func (*StreamRequest) Marshal

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

func (*StreamRequest) MarshalTo

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

func (*StreamRequest) MarshalToSizedBuffer

func (m *StreamRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StreamRequest) ProtoMessage

func (*StreamRequest) ProtoMessage()

func (*StreamRequest) Reset

func (m *StreamRequest) Reset()

func (*StreamRequest) Size

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

func (*StreamRequest) String

func (m *StreamRequest) String() string

func (*StreamRequest) Unmarshal

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

func (*StreamRequest) XXX_DiscardUnknown

func (m *StreamRequest) XXX_DiscardUnknown()

func (*StreamRequest) XXX_Marshal

func (m *StreamRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StreamRequest) XXX_Merge

func (m *StreamRequest) XXX_Merge(src proto.Message)

func (*StreamRequest) XXX_Size

func (m *StreamRequest) XXX_Size() int

func (*StreamRequest) XXX_Unmarshal

func (m *StreamRequest) XXX_Unmarshal(b []byte) error

type StreamResponse

type StreamResponse struct {
	Stats []*Snapshot `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"`
}

func (*StreamResponse) Descriptor

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

func (*StreamResponse) GetStats

func (m *StreamResponse) GetStats() []*Snapshot

func (*StreamResponse) Marshal

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

func (*StreamResponse) MarshalTo

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

func (*StreamResponse) MarshalToSizedBuffer

func (m *StreamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StreamResponse) ProtoMessage

func (*StreamResponse) ProtoMessage()

func (*StreamResponse) Reset

func (m *StreamResponse) Reset()

func (*StreamResponse) Size

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

func (*StreamResponse) String

func (m *StreamResponse) String() string

func (*StreamResponse) Unmarshal

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

func (*StreamResponse) XXX_DiscardUnknown

func (m *StreamResponse) XXX_DiscardUnknown()

func (*StreamResponse) XXX_Marshal

func (m *StreamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StreamResponse) XXX_Merge

func (m *StreamResponse) XXX_Merge(src proto.Message)

func (*StreamResponse) XXX_Size

func (m *StreamResponse) XXX_Size() int

func (*StreamResponse) XXX_Unmarshal

func (m *StreamResponse) XXX_Unmarshal(b []byte) error

type UnimplementedStatsServer

type UnimplementedStatsServer struct {
}

UnimplementedStatsServer can be embedded to have forward compatible implementations.

func (*UnimplementedStatsServer) Read

func (*UnimplementedStatsServer) Stream

func (*UnimplementedStatsServer) Write

type WriteRequest

type WriteRequest struct {
	// If set, only return services matching the filter
	Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// snapshot to write
	Stats *Snapshot `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"`
}

func (*WriteRequest) Descriptor

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

func (*WriteRequest) GetService

func (m *WriteRequest) GetService() *Service

func (*WriteRequest) GetStats

func (m *WriteRequest) GetStats() *Snapshot

func (*WriteRequest) Marshal

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

func (*WriteRequest) MarshalTo

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

func (*WriteRequest) MarshalToSizedBuffer

func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WriteRequest) ProtoMessage

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) Reset

func (m *WriteRequest) Reset()

func (*WriteRequest) Size

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

func (*WriteRequest) String

func (m *WriteRequest) String() string

func (*WriteRequest) Unmarshal

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

func (*WriteRequest) XXX_DiscardUnknown

func (m *WriteRequest) XXX_DiscardUnknown()

func (*WriteRequest) XXX_Marshal

func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WriteRequest) XXX_Merge

func (m *WriteRequest) XXX_Merge(src proto.Message)

func (*WriteRequest) XXX_Size

func (m *WriteRequest) XXX_Size() int

func (*WriteRequest) XXX_Unmarshal

func (m *WriteRequest) XXX_Unmarshal(b []byte) error

type WriteResponse

type WriteResponse struct {
}

func (*WriteResponse) Descriptor

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

func (*WriteResponse) Marshal

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

func (*WriteResponse) MarshalTo

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

func (*WriteResponse) MarshalToSizedBuffer

func (m *WriteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WriteResponse) ProtoMessage

func (*WriteResponse) ProtoMessage()

func (*WriteResponse) Reset

func (m *WriteResponse) Reset()

func (*WriteResponse) Size

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

func (*WriteResponse) String

func (m *WriteResponse) String() string

func (*WriteResponse) Unmarshal

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

func (*WriteResponse) XXX_DiscardUnknown

func (m *WriteResponse) XXX_DiscardUnknown()

func (*WriteResponse) XXX_Marshal

func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WriteResponse) XXX_Merge

func (m *WriteResponse) XXX_Merge(src proto.Message)

func (*WriteResponse) XXX_Size

func (m *WriteResponse) XXX_Size() int

func (*WriteResponse) XXX_Unmarshal

func (m *WriteResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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