Skip to content

Stats Go-API

import "givc/modules/api/stats"

const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

const (
StatsService_GetStats_FullMethodName = "/stats.StatsService/GetStats"
)

This is a compile-time assertion to ensure that this generated file is compatible with the grpc package it is being compiled against. Requires gRPC-Go v1.64.0 or later.

const _ = grpc.SupportPackageIsVersion9

const file_stats_stats_proto_rawDesc = "" +
"\n" +
"\x11stats/stats.proto\x12\x05stats\"\x0e\n" +
"\fStatsRequest\"g\n" +
"\vProcessStat\x12\x12\n" +
"\x04Name\x18\x01 \x01(\tR\x04Name\x12\x12\n" +
"\x04User\x18\x02 \x01(\x02R\x04User\x12\x10\n" +
"\x03Sys\x18\x03 \x01(\x02R\x03Sys\x12\x1e\n" +
"\n" +
"ResSetSize\x18\x04 \x01(\x04R\n" +
"ResSetSize\"\x8e\x02\n" +
"\fProcessStats\x126\n" +
"\fCpuProcesses\x18\x01 \x03(\v2\x12.stats.ProcessStatR\fCpuProcesses\x126\n" +
"\fMemProcesses\x18\x02 \x03(\v2\x12.stats.ProcessStatR\fMemProcesses\x12\x14\n" +
"\x05Total\x18\x03 \x01(\x04R\x05Total\x12\x18\n" +
"\aRunning\x18\x04 \x01(\x04R\aRunning\x12\x1e\n" +
"\n" +
"UserCycles\x18\x05 \x01(\x04R\n" +
"UserCycles\x12\x1c\n" +
"\tSysCycles\x18\x06 \x01(\x04R\tSysCycles\x12 \n" +
"\vTotalCycles\x18\a \x01(\x04R\vTotalCycles\"a\n" +
"\tLoadStats\x12\x1a\n" +
"\bLoad1Min\x18\x01 \x01(\x02R\bLoad1Min\x12\x1a\n" +
"\bLoad5Min\x18\x02 \x01(\x02R\bLoad5Min\x12\x1c\n" +
"\tLoad15Min\x18\x03 \x01(\x02R\tLoad15Min\"m\n" +
"\vMemoryStats\x12\x14\n" +
"\x05Total\x18\x01 \x01(\x04R\x05Total\x12\x12\n" +
"\x04Free\x18\x02 \x01(\x04R\x04Free\x12\x1c\n" +
"\tAvailable\x18\x03 \x01(\x04R\tAvailable\x12\x16\n" +
"\x06Cached\x18\x04 \x01(\x04R\x06Cached\"\x90\x01\n" +
"\rStatsResponse\x12*\n" +
"\x06Memory\x18\x01 \x01(\v2\x12.stats.MemoryStatsR\x06Memory\x12$\n" +
"\x04Load\x18\x02 \x01(\v2\x10.stats.LoadStatsR\x04Load\x12-\n" +
"\aProcess\x18\x03 \x01(\v2\x13.stats.ProcessStatsR\aProcess2G\n" +
"\fStatsService\x127\n" +
"\bGetStats\x12\x13.stats.StatsRequest\x1a\x14.stats.StatsResponse\"\x00B\x18Z\x16givc/modules/api/statsb\x06proto3"

var (
file_stats_stats_proto_rawDescOnce sync.Once
file_stats_stats_proto_rawDescData []byte
)

var File_stats_stats_proto protoreflect.FileDescriptor

StatsService_ServiceDesc is the grpc.ServiceDesc for StatsService service. It’s only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

var StatsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stats.StatsService",
HandlerType: (*StatsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetStats",
Handler: _StatsService_GetStats_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stats/stats.proto",
}

var file_stats_stats_proto_depIdxs = []int32{
1,
1,
4,
3,
2,
0,
5,
6,
5,
5,
5,
0,
}

var file_stats_stats_proto_goTypes = []any{
(*StatsRequest)(nil),
(*ProcessStat)(nil),
(*ProcessStats)(nil),
(*LoadStats)(nil),
(*MemoryStats)(nil),
(*StatsResponse)(nil),
}

var file_stats_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 6)

func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer)

func _StatsService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func file_stats_stats_proto_init()

func file_stats_stats_proto_rawDescGZIP() []byte

func init()

type LoadStats struct {
state protoimpl.MessageState `protogen:"open.v1"`
Load1Min float32 `protobuf:"fixed32,1,opt,name=Load1Min,proto3" json:"Load1Min,omitempty"`
Load5Min float32 `protobuf:"fixed32,2,opt,name=Load5Min,proto3" json:"Load5Min,omitempty"`
Load15Min float32 `protobuf:"fixed32,3,opt,name=Load15Min,proto3" json:"Load15Min,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use LoadStats.ProtoReflect.Descriptor instead.

func (x *LoadStats) GetLoad15Min() float32

func (x *LoadStats) GetLoad1Min() float32

func (x *LoadStats) GetLoad5Min() float32

func (*LoadStats) ProtoMessage()

func (x *LoadStats) ProtoReflect() protoreflect.Message

func (x *LoadStats) Reset()

func (x *LoadStats) String() string

type MemoryStats struct {
state protoimpl.MessageState `protogen:"open.v1"`
Total uint64 `protobuf:"varint,1,opt,name=Total,proto3" json:"Total,omitempty"`
Free uint64 `protobuf:"varint,2,opt,name=Free,proto3" json:"Free,omitempty"`
Available uint64 `protobuf:"varint,3,opt,name=Available,proto3" json:"Available,omitempty"`
Cached uint64 `protobuf:"varint,4,opt,name=Cached,proto3" json:"Cached,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use MemoryStats.ProtoReflect.Descriptor instead.

func (x *MemoryStats) GetAvailable() uint64

func (x *MemoryStats) GetCached() uint64

func (x *MemoryStats) GetFree() uint64

func (x *MemoryStats) GetTotal() uint64

func (*MemoryStats) ProtoMessage()

func (x *MemoryStats) ProtoReflect() protoreflect.Message

func (x *MemoryStats) Reset()

func (x *MemoryStats) String() string

type ProcessStat struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
User float32 `protobuf:"fixed32,2,opt,name=User,proto3" json:"User,omitempty"`
Sys float32 `protobuf:"fixed32,3,opt,name=Sys,proto3" json:"Sys,omitempty"`
ResSetSize uint64 `protobuf:"varint,4,opt,name=ResSetSize,proto3" json:"ResSetSize,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use ProcessStat.ProtoReflect.Descriptor instead.

func (x *ProcessStat) GetName() string

func (x *ProcessStat) GetResSetSize() uint64

func (x *ProcessStat) GetSys() float32

func (x *ProcessStat) GetUser() float32

func (*ProcessStat) ProtoMessage()

func (x *ProcessStat) ProtoReflect() protoreflect.Message

func (x *ProcessStat) Reset()

func (x *ProcessStat) String() string

type ProcessStats struct {
state protoimpl.MessageState `protogen:"open.v1"`
CpuProcesses []*ProcessStat `protobuf:"bytes,1,rep,name=CpuProcesses,proto3" json:"CpuProcesses,omitempty"`
MemProcesses []*ProcessStat `protobuf:"bytes,2,rep,name=MemProcesses,proto3" json:"MemProcesses,omitempty"`
Total uint64 `protobuf:"varint,3,opt,name=Total,proto3" json:"Total,omitempty"`
Running uint64 `protobuf:"varint,4,opt,name=Running,proto3" json:"Running,omitempty"`
UserCycles uint64 `protobuf:"varint,5,opt,name=UserCycles,proto3" json:"UserCycles,omitempty"`
SysCycles uint64 `protobuf:"varint,6,opt,name=SysCycles,proto3" json:"SysCycles,omitempty"`
TotalCycles uint64 `protobuf:"varint,7,opt,name=TotalCycles,proto3" json:"TotalCycles,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use ProcessStats.ProtoReflect.Descriptor instead.

func (x *ProcessStats) GetCpuProcesses() []*ProcessStat

func (x *ProcessStats) GetMemProcesses() []*ProcessStat

func (x *ProcessStats) GetRunning() uint64

func (x *ProcessStats) GetSysCycles() uint64

func (x *ProcessStats) GetTotal() uint64

func (x *ProcessStats) GetTotalCycles() uint64

func (x *ProcessStats) GetUserCycles() uint64

func (*ProcessStats) ProtoMessage()

func (x *ProcessStats) ProtoReflect() protoreflect.Message

func (x *ProcessStats) Reset()

func (x *ProcessStats) String() string

type StatsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use StatsRequest.ProtoReflect.Descriptor instead.

func (*StatsRequest) ProtoMessage()

func (x *StatsRequest) ProtoReflect() protoreflect.Message

func (x *StatsRequest) Reset()

func (x *StatsRequest) String() string

type StatsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Memory *MemoryStats `protobuf:"bytes,1,opt,name=Memory,proto3" json:"Memory,omitempty"`
Load *LoadStats `protobuf:"bytes,2,opt,name=Load,proto3" json:"Load,omitempty"`
Process *ProcessStats `protobuf:"bytes,3,opt,name=Process,proto3" json:"Process,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use StatsResponse.ProtoReflect.Descriptor instead.

func (x *StatsResponse) GetLoad() *LoadStats

func (x *StatsResponse) GetMemory() *MemoryStats

func (x *StatsResponse) GetProcess() *ProcessStats

func (*StatsResponse) ProtoMessage()

func (x *StatsResponse) ProtoReflect() protoreflect.Message

func (x *StatsResponse) Reset()

func (x *StatsResponse) String() string

StatsServiceClient is the client API for StatsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type StatsServiceClient interface {
GetStats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error)
}

func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClient

StatsServiceServer is the server API for StatsService service. All implementations must embed UnimplementedStatsServiceServer for forward compatibility.

type StatsServiceServer interface {
GetStats(context.Context, *StatsRequest) (*StatsResponse, error)
mustEmbedUnimplementedStatsServiceServer()
}

UnimplementedStatsServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

type UnimplementedStatsServiceServer struct{}

func (UnimplementedStatsServiceServer) GetStats

Section titled “func (UnimplementedStatsServiceServer) GetStats”
func (UnimplementedStatsServiceServer) GetStats(context.Context, *StatsRequest) (*StatsResponse, error)

func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer

Section titled “func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer”
func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer()

func (UnimplementedStatsServiceServer) testEmbeddedByValue

Section titled “func (UnimplementedStatsServiceServer) testEmbeddedByValue”
func (UnimplementedStatsServiceServer) testEmbeddedByValue()

UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatsServiceServer will result in compilation errors.

type UnsafeStatsServiceServer interface {
mustEmbedUnimplementedStatsServiceServer()
}

type statsServiceClient struct {
cc grpc.ClientConnInterface
}

func (c *statsServiceClient) GetStats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error)

Generated by gomarkdoc