You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I am faling in love with Knative Serving by modifying your code, every day, for my personal purpose. I am confusing in generating pkg/autoscaler/metrics/stat.pb.go file. Now I want to add some other field to Stat proto struct, so regenerating stat.pb.go is neccessary. Arcording to comment in this file, it was generated by protoc-gen-gogo. I tried to use protoc-gen-gogo to regenerate .pb.go file, but the file I received look like not same as original .pb.go file, it miss some methods like Marshal(), Unmarshal(), Size().
The command I used to regenerate .pb.go file:
protoc -I=./ --gogo_out=./ ./stat.proto
and here is the result:
// Code generated by protoc-gen-gogo. DO NOT EDIT.// source: pkg/autoscaler/metrics/stat.protopackage metrics
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.var_=proto.Marshalvar_=fmt.Errorfvar_=math.Inf// This is a compile-time assertion to ensure that this generated file// is compatible with the proto package it is being compiled against.// A compilation error at this line likely means your copy of the// proto package needs to be updated.const_=proto.GoGoProtoPackageIsVersion3// please upgrade the proto package// Stat defines a single measurement at a point in time.typeStatstruct {
// The unique identity of this pod. Used to count how many pods// are contributing to the metrics.PodNamestring`protobuf:"bytes,1,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"`// Average number of requests currently being handled by this pod.AverageConcurrentRequestsfloat64`protobuf:"fixed64,2,opt,name=average_concurrent_requests,json=averageConcurrentRequests,proto3" json:"average_concurrent_requests,omitempty"`// Part of AverageConcurrentRequests, for requests going through a proxy.AverageProxiedConcurrentRequestsfloat64`protobuf:"fixed64,3,opt,name=average_proxied_concurrent_requests,json=averageProxiedConcurrentRequests,proto3" json:"average_proxied_concurrent_requests,omitempty"`// Number of requests received since last Stat (approximately requests per second).RequestCountfloat64`protobuf:"fixed64,4,opt,name=request_count,json=requestCount,proto3" json:"request_count,omitempty"`// Part of RequestCount, for requests going through a proxy.ProxiedRequestCountfloat64`protobuf:"fixed64,5,opt,name=proxied_request_count,json=proxiedRequestCount,proto3" json:"proxied_request_count,omitempty"`// Process uptime in seconds.ProcessUptimefloat64`protobuf:"fixed64,6,opt,name=process_uptime,json=processUptime,proto3" json:"process_uptime,omitempty"`// Time/date that the stat was generated in seconds since// 1970-01-01 00:00:00.000 UTC.Timestampint64`protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`XXX_NoUnkeyedLiteralstruct{} `json:"-"`XXX_unrecognized []byte`json:"-"`XXX_sizecacheint32`json:"-"`
}
func (m*Stat) Reset() { *m=Stat{} }
func (m*Stat) String() string { returnproto.CompactTextString(m) }
func (*Stat) ProtoMessage() {}
func (*Stat) Descriptor() ([]byte, []int) {
returnfileDescriptor_01fabdc1b78bd68b, []int{0}
}
func (m*Stat) XXX_Unmarshal(b []byte) error {
returnxxx_messageInfo_Stat.Unmarshal(m, b)
}
func (m*Stat) XXX_Marshal(b []byte, deterministicbool) ([]byte, error) {
returnxxx_messageInfo_Stat.Marshal(b, m, deterministic)
}
func (m*Stat) XXX_Merge(src proto.Message) {
xxx_messageInfo_Stat.Merge(m, src)
}
func (m*Stat) XXX_Size() int {
returnxxx_messageInfo_Stat.Size(m)
}
func (m*Stat) XXX_DiscardUnknown() {
xxx_messageInfo_Stat.DiscardUnknown(m)
}
varxxx_messageInfo_Stat proto.InternalMessageInfofunc (m*Stat) GetPodName() string {
ifm!=nil {
returnm.PodName
}
return""
}
func (m*Stat) GetAverageConcurrentRequests() float64 {
ifm!=nil {
returnm.AverageConcurrentRequests
}
return0
}
func (m*Stat) GetAverageProxiedConcurrentRequests() float64 {
ifm!=nil {
returnm.AverageProxiedConcurrentRequests
}
return0
}
func (m*Stat) GetRequestCount() float64 {
ifm!=nil {
returnm.RequestCount
}
return0
}
func (m*Stat) GetProxiedRequestCount() float64 {
ifm!=nil {
returnm.ProxiedRequestCount
}
return0
}
func (m*Stat) GetProcessUptime() float64 {
ifm!=nil {
returnm.ProcessUptime
}
return0
}
func (m*Stat) GetTimestamp() int64 {
ifm!=nil {
returnm.Timestamp
}
return0
}
// WireStatMessage is a copy of the StatMessage Golang type, exploding the fields of// `types.NamespacedName` to make it compatible with protobufs.typeWireStatMessagestruct {
// Namespace is the namespace of the entity the stat belongs to.Namespacestring`protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`// Name is the name of the entity the stat belongs to.Namestring`protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`// Stat are the actual metrics being sent.Stat*Stat`protobuf:"bytes,3,opt,name=stat,proto3" json:"stat,omitempty"`XXX_NoUnkeyedLiteralstruct{} `json:"-"`XXX_unrecognized []byte`json:"-"`XXX_sizecacheint32`json:"-"`
}
func (m*WireStatMessage) Reset() { *m=WireStatMessage{} }
func (m*WireStatMessage) String() string { returnproto.CompactTextString(m) }
func (*WireStatMessage) ProtoMessage() {}
func (*WireStatMessage) Descriptor() ([]byte, []int) {
returnfileDescriptor_01fabdc1b78bd68b, []int{1}
}
func (m*WireStatMessage) XXX_Unmarshal(b []byte) error {
returnxxx_messageInfo_WireStatMessage.Unmarshal(m, b)
}
func (m*WireStatMessage) XXX_Marshal(b []byte, deterministicbool) ([]byte, error) {
returnxxx_messageInfo_WireStatMessage.Marshal(b, m, deterministic)
}
func (m*WireStatMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_WireStatMessage.Merge(m, src)
}
func (m*WireStatMessage) XXX_Size() int {
returnxxx_messageInfo_WireStatMessage.Size(m)
}
func (m*WireStatMessage) XXX_DiscardUnknown() {
xxx_messageInfo_WireStatMessage.DiscardUnknown(m)
}
varxxx_messageInfo_WireStatMessage proto.InternalMessageInfofunc (m*WireStatMessage) GetNamespace() string {
ifm!=nil {
returnm.Namespace
}
return""
}
func (m*WireStatMessage) GetName() string {
ifm!=nil {
returnm.Name
}
return""
}
func (m*WireStatMessage) GetStat() *Stat {
ifm!=nil {
returnm.Stat
}
returnnil
}
// WireStatMessages is a wrapper to send multiple WireStatMessages at once.typeWireStatMessagesstruct {
// Messages is a list of WireStatMessages.Messages []*WireStatMessage`protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`XXX_NoUnkeyedLiteralstruct{} `json:"-"`XXX_unrecognized []byte`json:"-"`XXX_sizecacheint32`json:"-"`
}
func (m*WireStatMessages) Reset() { *m=WireStatMessages{} }
func (m*WireStatMessages) String() string { returnproto.CompactTextString(m) }
func (*WireStatMessages) ProtoMessage() {}
func (*WireStatMessages) Descriptor() ([]byte, []int) {
returnfileDescriptor_01fabdc1b78bd68b, []int{2}
}
func (m*WireStatMessages) XXX_Unmarshal(b []byte) error {
returnxxx_messageInfo_WireStatMessages.Unmarshal(m, b)
}
func (m*WireStatMessages) XXX_Marshal(b []byte, deterministicbool) ([]byte, error) {
returnxxx_messageInfo_WireStatMessages.Marshal(b, m, deterministic)
}
func (m*WireStatMessages) XXX_Merge(src proto.Message) {
xxx_messageInfo_WireStatMessages.Merge(m, src)
}
func (m*WireStatMessages) XXX_Size() int {
returnxxx_messageInfo_WireStatMessages.Size(m)
}
func (m*WireStatMessages) XXX_DiscardUnknown() {
xxx_messageInfo_WireStatMessages.DiscardUnknown(m)
}
varxxx_messageInfo_WireStatMessages proto.InternalMessageInfofunc (m*WireStatMessages) GetMessages() []*WireStatMessage {
ifm!=nil {
returnm.Messages
}
returnnil
}
funcinit() {
proto.RegisterType((*Stat)(nil), "metrics.Stat")
proto.RegisterType((*WireStatMessage)(nil), "metrics.WireStatMessage")
proto.RegisterType((*WireStatMessages)(nil), "metrics.WireStatMessages")
}
funcinit() { proto.RegisterFile("stat.proto", fileDescriptor_01fabdc1b78bd68b) }
varfileDescriptor_01fabdc1b78bd68b= []byte{
// 313 bytes of a gzipped FileDescriptorProto0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x3f, 0x4f, 0xc3, 0x30,
0x10, 0xc5, 0x95, 0x36, 0xf4, 0xcf, 0x95, 0x02, 0x32, 0x42, 0x72, 0x05,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86, 0xe1, 0xeb, 0xbc, 0x54, 0x86, 0xf7, 0xb3, 0x24, 0xef, 0x8a, 0x9d,
0x30, 0x7d, 0x87, 0xd3, 0xd7, 0xca, 0x62, 0xe8, 0x74, 0x85, 0xce, 0xc9, 0x0d, 0x19, 0x42, 0xad,
0xce, 0xc8, 0x72, 0xdb, 0xed, 0x4e, 0x60, 0x0c, 0x52, 0x2a, 0xbd, 0x43, 0x03, 0x7a, 0xb3, 0x6b,
0x48, 0xc3, 0xb1, 0xa8, 0x92, 0xd1, 0x62, 0x3c, 0x8f, 0xd7, 0x9a, 0x87, 0x54, 0x41, 0xa3, 0xe9,
0x03, 0x9c, 0xed, 0xed, 0x71, 0xec, 0x0e, 0x06, 0x2a, 0xbe, 0x79, 0x92, 0x75, 0xf3, 0xd1, 0x82,
0xb7, 0xd6, 0x3d, 0x58, 0xb4, 0xe4, 0x5b, 0x8f, 0x7e, 0x89, 0xdb, 0x9f, 0x00, 0x00, 0x00, 0xff,
0xff, 0x9c, 0x0e, 0x15, 0x1b, 0x20, 0x02, 0x00, 0x00,
}
Can you show me the correct way to generate it?
Thanks so much! ありがとうございます
The text was updated successfully, but these errors were encountered:
Hi all, I am faling in love with Knative Serving by modifying your code, every day, for my personal purpose. I am confusing in generating
pkg/autoscaler/metrics/stat.pb.go
file. Now I want to add some other field toStat
proto struct, so regeneratingstat.pb.go
is neccessary. Arcording to comment in this file, it was generated byprotoc-gen-gogo
. I tried to useprotoc-gen-gogo
to regenerate .pb.go file, but the file I received look like not same as original .pb.go file, it miss some methods likeMarshal()
,Unmarshal()
,Size()
.The command I used to regenerate .pb.go file:
and here is the result:
Can you show me the correct way to generate it?
Thanks so much! ありがとうございます
The text was updated successfully, but these errors were encountered: