github.com/matrixorigin/matrixone@v1.2.0/pkg/pb/metric/metric.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: metric.proto 3 4 package metric 5 6 import ( 7 encoding_binary "encoding/binary" 8 fmt "fmt" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 13 proto "github.com/gogo/protobuf/proto" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the proto package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // proto package needs to be updated. 25 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 26 27 type MetricType int32 28 29 const ( 30 MetricType_COUNTER MetricType = 0 31 MetricType_GAUGE MetricType = 1 32 MetricType_RAWHIST MetricType = 2 33 ) 34 35 var MetricType_name = map[int32]string{ 36 0: "COUNTER", 37 1: "GAUGE", 38 2: "RAWHIST", 39 } 40 41 var MetricType_value = map[string]int32{ 42 "COUNTER": 0, 43 "GAUGE": 1, 44 "RAWHIST": 2, 45 } 46 47 func (x MetricType) String() string { 48 return proto.EnumName(MetricType_name, int32(x)) 49 } 50 51 func (MetricType) EnumDescriptor() ([]byte, []int) { 52 return fileDescriptor_da41641f55bff5df, []int{0} 53 } 54 55 type LabelPair struct { 56 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 57 Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 58 XXX_NoUnkeyedLiteral struct{} `json:"-"` 59 XXX_unrecognized []byte `json:"-"` 60 XXX_sizecache int32 `json:"-"` 61 } 62 63 func (m *LabelPair) Reset() { *m = LabelPair{} } 64 func (m *LabelPair) String() string { return proto.CompactTextString(m) } 65 func (*LabelPair) ProtoMessage() {} 66 func (*LabelPair) Descriptor() ([]byte, []int) { 67 return fileDescriptor_da41641f55bff5df, []int{0} 68 } 69 func (m *LabelPair) XXX_Unmarshal(b []byte) error { 70 return m.Unmarshal(b) 71 } 72 func (m *LabelPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 73 if deterministic { 74 return xxx_messageInfo_LabelPair.Marshal(b, m, deterministic) 75 } else { 76 b = b[:cap(b)] 77 n, err := m.MarshalToSizedBuffer(b) 78 if err != nil { 79 return nil, err 80 } 81 return b[:n], nil 82 } 83 } 84 func (m *LabelPair) XXX_Merge(src proto.Message) { 85 xxx_messageInfo_LabelPair.Merge(m, src) 86 } 87 func (m *LabelPair) XXX_Size() int { 88 return m.Size() 89 } 90 func (m *LabelPair) XXX_DiscardUnknown() { 91 xxx_messageInfo_LabelPair.DiscardUnknown(m) 92 } 93 94 var xxx_messageInfo_LabelPair proto.InternalMessageInfo 95 96 func (m *LabelPair) GetName() string { 97 if m != nil { 98 return m.Name 99 } 100 return "" 101 } 102 103 func (m *LabelPair) GetValue() string { 104 if m != nil { 105 return m.Value 106 } 107 return "" 108 } 109 110 type Gauge struct { 111 Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` 112 XXX_NoUnkeyedLiteral struct{} `json:"-"` 113 XXX_unrecognized []byte `json:"-"` 114 XXX_sizecache int32 `json:"-"` 115 } 116 117 func (m *Gauge) Reset() { *m = Gauge{} } 118 func (m *Gauge) String() string { return proto.CompactTextString(m) } 119 func (*Gauge) ProtoMessage() {} 120 func (*Gauge) Descriptor() ([]byte, []int) { 121 return fileDescriptor_da41641f55bff5df, []int{1} 122 } 123 func (m *Gauge) XXX_Unmarshal(b []byte) error { 124 return m.Unmarshal(b) 125 } 126 func (m *Gauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 127 if deterministic { 128 return xxx_messageInfo_Gauge.Marshal(b, m, deterministic) 129 } else { 130 b = b[:cap(b)] 131 n, err := m.MarshalToSizedBuffer(b) 132 if err != nil { 133 return nil, err 134 } 135 return b[:n], nil 136 } 137 } 138 func (m *Gauge) XXX_Merge(src proto.Message) { 139 xxx_messageInfo_Gauge.Merge(m, src) 140 } 141 func (m *Gauge) XXX_Size() int { 142 return m.Size() 143 } 144 func (m *Gauge) XXX_DiscardUnknown() { 145 xxx_messageInfo_Gauge.DiscardUnknown(m) 146 } 147 148 var xxx_messageInfo_Gauge proto.InternalMessageInfo 149 150 func (m *Gauge) GetValue() float64 { 151 if m != nil { 152 return m.Value 153 } 154 return 0 155 } 156 157 type Counter struct { 158 Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` 159 XXX_NoUnkeyedLiteral struct{} `json:"-"` 160 XXX_unrecognized []byte `json:"-"` 161 XXX_sizecache int32 `json:"-"` 162 } 163 164 func (m *Counter) Reset() { *m = Counter{} } 165 func (m *Counter) String() string { return proto.CompactTextString(m) } 166 func (*Counter) ProtoMessage() {} 167 func (*Counter) Descriptor() ([]byte, []int) { 168 return fileDescriptor_da41641f55bff5df, []int{2} 169 } 170 func (m *Counter) XXX_Unmarshal(b []byte) error { 171 return m.Unmarshal(b) 172 } 173 func (m *Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 174 if deterministic { 175 return xxx_messageInfo_Counter.Marshal(b, m, deterministic) 176 } else { 177 b = b[:cap(b)] 178 n, err := m.MarshalToSizedBuffer(b) 179 if err != nil { 180 return nil, err 181 } 182 return b[:n], nil 183 } 184 } 185 func (m *Counter) XXX_Merge(src proto.Message) { 186 xxx_messageInfo_Counter.Merge(m, src) 187 } 188 func (m *Counter) XXX_Size() int { 189 return m.Size() 190 } 191 func (m *Counter) XXX_DiscardUnknown() { 192 xxx_messageInfo_Counter.DiscardUnknown(m) 193 } 194 195 var xxx_messageInfo_Counter proto.InternalMessageInfo 196 197 func (m *Counter) GetValue() float64 { 198 if m != nil { 199 return m.Value 200 } 201 return 0 202 } 203 204 type Sample struct { 205 Datetime int64 `protobuf:"varint,1,opt,name=datetime,proto3" json:"datetime,omitempty"` 206 Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` 207 XXX_NoUnkeyedLiteral struct{} `json:"-"` 208 XXX_unrecognized []byte `json:"-"` 209 XXX_sizecache int32 `json:"-"` 210 } 211 212 func (m *Sample) Reset() { *m = Sample{} } 213 func (m *Sample) String() string { return proto.CompactTextString(m) } 214 func (*Sample) ProtoMessage() {} 215 func (*Sample) Descriptor() ([]byte, []int) { 216 return fileDescriptor_da41641f55bff5df, []int{3} 217 } 218 func (m *Sample) XXX_Unmarshal(b []byte) error { 219 return m.Unmarshal(b) 220 } 221 func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 222 if deterministic { 223 return xxx_messageInfo_Sample.Marshal(b, m, deterministic) 224 } else { 225 b = b[:cap(b)] 226 n, err := m.MarshalToSizedBuffer(b) 227 if err != nil { 228 return nil, err 229 } 230 return b[:n], nil 231 } 232 } 233 func (m *Sample) XXX_Merge(src proto.Message) { 234 xxx_messageInfo_Sample.Merge(m, src) 235 } 236 func (m *Sample) XXX_Size() int { 237 return m.Size() 238 } 239 func (m *Sample) XXX_DiscardUnknown() { 240 xxx_messageInfo_Sample.DiscardUnknown(m) 241 } 242 243 var xxx_messageInfo_Sample proto.InternalMessageInfo 244 245 func (m *Sample) GetDatetime() int64 { 246 if m != nil { 247 return m.Datetime 248 } 249 return 0 250 } 251 252 func (m *Sample) GetValue() float64 { 253 if m != nil { 254 return m.Value 255 } 256 return 0 257 } 258 259 type RawHist struct { 260 Samples []*Sample `protobuf:"bytes,1,rep,name=samples,proto3" json:"samples,omitempty"` 261 XXX_NoUnkeyedLiteral struct{} `json:"-"` 262 XXX_unrecognized []byte `json:"-"` 263 XXX_sizecache int32 `json:"-"` 264 } 265 266 func (m *RawHist) Reset() { *m = RawHist{} } 267 func (m *RawHist) String() string { return proto.CompactTextString(m) } 268 func (*RawHist) ProtoMessage() {} 269 func (*RawHist) Descriptor() ([]byte, []int) { 270 return fileDescriptor_da41641f55bff5df, []int{4} 271 } 272 func (m *RawHist) XXX_Unmarshal(b []byte) error { 273 return m.Unmarshal(b) 274 } 275 func (m *RawHist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 276 if deterministic { 277 return xxx_messageInfo_RawHist.Marshal(b, m, deterministic) 278 } else { 279 b = b[:cap(b)] 280 n, err := m.MarshalToSizedBuffer(b) 281 if err != nil { 282 return nil, err 283 } 284 return b[:n], nil 285 } 286 } 287 func (m *RawHist) XXX_Merge(src proto.Message) { 288 xxx_messageInfo_RawHist.Merge(m, src) 289 } 290 func (m *RawHist) XXX_Size() int { 291 return m.Size() 292 } 293 func (m *RawHist) XXX_DiscardUnknown() { 294 xxx_messageInfo_RawHist.DiscardUnknown(m) 295 } 296 297 var xxx_messageInfo_RawHist proto.InternalMessageInfo 298 299 func (m *RawHist) GetSamples() []*Sample { 300 if m != nil { 301 return m.Samples 302 } 303 return nil 304 } 305 306 type Metric struct { 307 Label []*LabelPair `protobuf:"bytes,1,rep,name=label,proto3" json:"label,omitempty"` 308 Gauge *Gauge `protobuf:"bytes,2,opt,name=gauge,proto3" json:"gauge,omitempty"` 309 Counter *Counter `protobuf:"bytes,3,opt,name=counter,proto3" json:"counter,omitempty"` 310 RawHist *RawHist `protobuf:"bytes,4,opt,name=rawHist,proto3" json:"rawHist,omitempty"` 311 Collecttime int64 `protobuf:"varint,5,opt,name=collecttime,proto3" json:"collecttime,omitempty"` 312 XXX_NoUnkeyedLiteral struct{} `json:"-"` 313 XXX_unrecognized []byte `json:"-"` 314 XXX_sizecache int32 `json:"-"` 315 } 316 317 func (m *Metric) Reset() { *m = Metric{} } 318 func (m *Metric) String() string { return proto.CompactTextString(m) } 319 func (*Metric) ProtoMessage() {} 320 func (*Metric) Descriptor() ([]byte, []int) { 321 return fileDescriptor_da41641f55bff5df, []int{5} 322 } 323 func (m *Metric) XXX_Unmarshal(b []byte) error { 324 return m.Unmarshal(b) 325 } 326 func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 327 if deterministic { 328 return xxx_messageInfo_Metric.Marshal(b, m, deterministic) 329 } else { 330 b = b[:cap(b)] 331 n, err := m.MarshalToSizedBuffer(b) 332 if err != nil { 333 return nil, err 334 } 335 return b[:n], nil 336 } 337 } 338 func (m *Metric) XXX_Merge(src proto.Message) { 339 xxx_messageInfo_Metric.Merge(m, src) 340 } 341 func (m *Metric) XXX_Size() int { 342 return m.Size() 343 } 344 func (m *Metric) XXX_DiscardUnknown() { 345 xxx_messageInfo_Metric.DiscardUnknown(m) 346 } 347 348 var xxx_messageInfo_Metric proto.InternalMessageInfo 349 350 func (m *Metric) GetLabel() []*LabelPair { 351 if m != nil { 352 return m.Label 353 } 354 return nil 355 } 356 357 func (m *Metric) GetGauge() *Gauge { 358 if m != nil { 359 return m.Gauge 360 } 361 return nil 362 } 363 364 func (m *Metric) GetCounter() *Counter { 365 if m != nil { 366 return m.Counter 367 } 368 return nil 369 } 370 371 func (m *Metric) GetRawHist() *RawHist { 372 if m != nil { 373 return m.RawHist 374 } 375 return nil 376 } 377 378 func (m *Metric) GetCollecttime() int64 { 379 if m != nil { 380 return m.Collecttime 381 } 382 return 0 383 } 384 385 type MetricFamily struct { 386 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 387 Help string `protobuf:"bytes,2,opt,name=help,proto3" json:"help,omitempty"` 388 Type MetricType `protobuf:"varint,3,opt,name=type,proto3,enum=metric.MetricType" json:"type,omitempty"` 389 Metric []*Metric `protobuf:"bytes,4,rep,name=metric,proto3" json:"metric,omitempty"` 390 Node string `protobuf:"bytes,5,opt,name=node,proto3" json:"node,omitempty"` 391 Role string `protobuf:"bytes,6,opt,name=role,proto3" json:"role,omitempty"` 392 XXX_NoUnkeyedLiteral struct{} `json:"-"` 393 XXX_unrecognized []byte `json:"-"` 394 XXX_sizecache int32 `json:"-"` 395 } 396 397 func (m *MetricFamily) Reset() { *m = MetricFamily{} } 398 func (m *MetricFamily) String() string { return proto.CompactTextString(m) } 399 func (*MetricFamily) ProtoMessage() {} 400 func (*MetricFamily) Descriptor() ([]byte, []int) { 401 return fileDescriptor_da41641f55bff5df, []int{6} 402 } 403 func (m *MetricFamily) XXX_Unmarshal(b []byte) error { 404 return m.Unmarshal(b) 405 } 406 func (m *MetricFamily) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 407 if deterministic { 408 return xxx_messageInfo_MetricFamily.Marshal(b, m, deterministic) 409 } else { 410 b = b[:cap(b)] 411 n, err := m.MarshalToSizedBuffer(b) 412 if err != nil { 413 return nil, err 414 } 415 return b[:n], nil 416 } 417 } 418 func (m *MetricFamily) XXX_Merge(src proto.Message) { 419 xxx_messageInfo_MetricFamily.Merge(m, src) 420 } 421 func (m *MetricFamily) XXX_Size() int { 422 return m.Size() 423 } 424 func (m *MetricFamily) XXX_DiscardUnknown() { 425 xxx_messageInfo_MetricFamily.DiscardUnknown(m) 426 } 427 428 var xxx_messageInfo_MetricFamily proto.InternalMessageInfo 429 430 func (m *MetricFamily) GetName() string { 431 if m != nil { 432 return m.Name 433 } 434 return "" 435 } 436 437 func (m *MetricFamily) GetHelp() string { 438 if m != nil { 439 return m.Help 440 } 441 return "" 442 } 443 444 func (m *MetricFamily) GetType() MetricType { 445 if m != nil { 446 return m.Type 447 } 448 return MetricType_COUNTER 449 } 450 451 func (m *MetricFamily) GetMetric() []*Metric { 452 if m != nil { 453 return m.Metric 454 } 455 return nil 456 } 457 458 func (m *MetricFamily) GetNode() string { 459 if m != nil { 460 return m.Node 461 } 462 return "" 463 } 464 465 func (m *MetricFamily) GetRole() string { 466 if m != nil { 467 return m.Role 468 } 469 return "" 470 } 471 472 func init() { 473 proto.RegisterEnum("metric.MetricType", MetricType_name, MetricType_value) 474 proto.RegisterType((*LabelPair)(nil), "metric.LabelPair") 475 proto.RegisterType((*Gauge)(nil), "metric.Gauge") 476 proto.RegisterType((*Counter)(nil), "metric.Counter") 477 proto.RegisterType((*Sample)(nil), "metric.Sample") 478 proto.RegisterType((*RawHist)(nil), "metric.RawHist") 479 proto.RegisterType((*Metric)(nil), "metric.Metric") 480 proto.RegisterType((*MetricFamily)(nil), "metric.MetricFamily") 481 } 482 483 func init() { proto.RegisterFile("metric.proto", fileDescriptor_da41641f55bff5df) } 484 485 var fileDescriptor_da41641f55bff5df = []byte{ 486 // 439 bytes of a gzipped FileDescriptorProto 487 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0x8a, 0x13, 0x41, 488 0x10, 0xb6, 0x37, 0xf3, 0x63, 0x2a, 0xeb, 0x1a, 0x0b, 0x0f, 0x83, 0x60, 0x0c, 0x11, 0xd6, 0xe8, 489 0x21, 0x83, 0x59, 0xbc, 0x08, 0x1e, 0xd6, 0x65, 0xcd, 0x0a, 0xfe, 0xd1, 0x9b, 0x45, 0xf0, 0xd6, 490 0x99, 0x34, 0xb3, 0x8d, 0x3d, 0xe9, 0xa1, 0xd3, 0x51, 0xf3, 0x52, 0x3e, 0x87, 0x27, 0xf1, 0x11, 491 0x24, 0x4f, 0x22, 0xd3, 0x3f, 0x31, 0x01, 0xbd, 0x55, 0xd5, 0xf7, 0x55, 0x7d, 0xf5, 0x55, 0x37, 492 0x1c, 0x56, 0xdc, 0x68, 0x51, 0x8c, 0x6a, 0xad, 0x8c, 0xc2, 0xc4, 0x65, 0x83, 0x67, 0xd0, 0x7e, 493 0xc3, 0x66, 0x5c, 0x7e, 0x60, 0x42, 0x23, 0x42, 0xb4, 0x60, 0x15, 0xcf, 0x48, 0x9f, 0x0c, 0xdb, 494 0xd4, 0xc6, 0x78, 0x17, 0xe2, 0x2f, 0x4c, 0xae, 0x78, 0x76, 0x60, 0x8b, 0x2e, 0x19, 0xdc, 0x87, 495 0x78, 0xc2, 0x56, 0xe5, 0x0e, 0xdc, 0xf4, 0x90, 0x00, 0x3f, 0x80, 0xf4, 0x4c, 0xad, 0x16, 0x86, 496 0xeb, 0xff, 0x10, 0x9e, 0x43, 0x72, 0xc9, 0xaa, 0x5a, 0x72, 0xbc, 0x07, 0x37, 0xe7, 0xcc, 0x70, 497 0x23, 0xbc, 0x6e, 0x8b, 0x6e, 0xf3, 0x7d, 0xed, 0x6d, 0xef, 0x09, 0xa4, 0x94, 0x7d, 0xbd, 0x10, 498 0x4b, 0x83, 0x43, 0x48, 0x97, 0x76, 0xcc, 0x32, 0x23, 0xfd, 0xd6, 0xb0, 0x33, 0x3e, 0x1a, 0x79, 499 0x97, 0x6e, 0x3a, 0x0d, 0xf0, 0xe0, 0x27, 0x81, 0xe4, 0xad, 0x85, 0xf0, 0x11, 0xc4, 0xb2, 0xb1, 500 0xec, 0x5b, 0xee, 0x84, 0x96, 0xed, 0x1d, 0xa8, 0xc3, 0xf1, 0x21, 0xc4, 0x65, 0x63, 0xd2, 0xca, 501 0x77, 0xc6, 0xb7, 0x02, 0xd1, 0x3a, 0xa7, 0x0e, 0xc3, 0xc7, 0x90, 0x16, 0xce, 0x6a, 0xd6, 0xb2, 502 0xb4, 0xdb, 0x81, 0xe6, 0x2f, 0x40, 0x03, 0xde, 0x50, 0xb5, 0x5b, 0x3c, 0x8b, 0xf6, 0xa9, 0xde, 503 0x0f, 0x0d, 0x38, 0xf6, 0xa1, 0x53, 0x28, 0x29, 0x79, 0x61, 0xec, 0x61, 0x62, 0x7b, 0x98, 0xdd, 504 0xd2, 0xe0, 0x3b, 0x81, 0x43, 0x67, 0xe8, 0x15, 0xab, 0x84, 0x5c, 0xff, 0xf3, 0xf1, 0x10, 0xa2, 505 0x6b, 0x2e, 0x6b, 0xff, 0x76, 0x36, 0xc6, 0x63, 0x88, 0xcc, 0xba, 0xe6, 0x76, 0xdb, 0xa3, 0x31, 506 0x86, 0x15, 0xdc, 0xac, 0xe9, 0xba, 0xe6, 0xd4, 0xe2, 0x78, 0x0c, 0xfe, 0x8f, 0x64, 0xd1, 0xfe, 507 0x69, 0x1d, 0x93, 0x7a, 0xd4, 0xea, 0xaa, 0xb9, 0xdb, 0xb1, 0xd1, 0x55, 0x73, 0xab, 0xab, 0x95, 508 0xe4, 0x59, 0xe2, 0x6a, 0x4d, 0xfc, 0xe4, 0x29, 0xc0, 0x5f, 0x0d, 0xec, 0x40, 0x7a, 0xf6, 0xfe, 509 0xea, 0xdd, 0xf4, 0x9c, 0x76, 0x6f, 0x60, 0x1b, 0xe2, 0xc9, 0xe9, 0xd5, 0xe4, 0xbc, 0x4b, 0x9a, 510 0x3a, 0x3d, 0xfd, 0x78, 0xf1, 0xfa, 0x72, 0xda, 0x3d, 0x78, 0xf9, 0xe2, 0xc7, 0xa6, 0x47, 0x7e, 511 0x6d, 0x7a, 0xe4, 0xf7, 0xa6, 0x47, 0x3e, 0xe5, 0xa5, 0x30, 0xd7, 0xab, 0xd9, 0xa8, 0x50, 0x55, 512 0x5e, 0x31, 0xa3, 0xc5, 0x37, 0xa5, 0x45, 0x29, 0x16, 0x21, 0x59, 0xf0, 0xbc, 0xfe, 0x5c, 0xe6, 513 0xf5, 0x2c, 0x77, 0x9b, 0xcd, 0x12, 0xfb, 0xd5, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfc, 514 0x04, 0x32, 0xdd, 0xfa, 0x02, 0x00, 0x00, 515 } 516 517 func (m *LabelPair) Marshal() (dAtA []byte, err error) { 518 size := m.Size() 519 dAtA = make([]byte, size) 520 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 521 if err != nil { 522 return nil, err 523 } 524 return dAtA[:n], nil 525 } 526 527 func (m *LabelPair) MarshalTo(dAtA []byte) (int, error) { 528 size := m.Size() 529 return m.MarshalToSizedBuffer(dAtA[:size]) 530 } 531 532 func (m *LabelPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { 533 i := len(dAtA) 534 _ = i 535 var l int 536 _ = l 537 if m.XXX_unrecognized != nil { 538 i -= len(m.XXX_unrecognized) 539 copy(dAtA[i:], m.XXX_unrecognized) 540 } 541 if len(m.Value) > 0 { 542 i -= len(m.Value) 543 copy(dAtA[i:], m.Value) 544 i = encodeVarintMetric(dAtA, i, uint64(len(m.Value))) 545 i-- 546 dAtA[i] = 0x12 547 } 548 if len(m.Name) > 0 { 549 i -= len(m.Name) 550 copy(dAtA[i:], m.Name) 551 i = encodeVarintMetric(dAtA, i, uint64(len(m.Name))) 552 i-- 553 dAtA[i] = 0xa 554 } 555 return len(dAtA) - i, nil 556 } 557 558 func (m *Gauge) Marshal() (dAtA []byte, err error) { 559 size := m.Size() 560 dAtA = make([]byte, size) 561 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 562 if err != nil { 563 return nil, err 564 } 565 return dAtA[:n], nil 566 } 567 568 func (m *Gauge) MarshalTo(dAtA []byte) (int, error) { 569 size := m.Size() 570 return m.MarshalToSizedBuffer(dAtA[:size]) 571 } 572 573 func (m *Gauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { 574 i := len(dAtA) 575 _ = i 576 var l int 577 _ = l 578 if m.XXX_unrecognized != nil { 579 i -= len(m.XXX_unrecognized) 580 copy(dAtA[i:], m.XXX_unrecognized) 581 } 582 if m.Value != 0 { 583 i -= 8 584 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) 585 i-- 586 dAtA[i] = 0x9 587 } 588 return len(dAtA) - i, nil 589 } 590 591 func (m *Counter) Marshal() (dAtA []byte, err error) { 592 size := m.Size() 593 dAtA = make([]byte, size) 594 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 595 if err != nil { 596 return nil, err 597 } 598 return dAtA[:n], nil 599 } 600 601 func (m *Counter) MarshalTo(dAtA []byte) (int, error) { 602 size := m.Size() 603 return m.MarshalToSizedBuffer(dAtA[:size]) 604 } 605 606 func (m *Counter) MarshalToSizedBuffer(dAtA []byte) (int, error) { 607 i := len(dAtA) 608 _ = i 609 var l int 610 _ = l 611 if m.XXX_unrecognized != nil { 612 i -= len(m.XXX_unrecognized) 613 copy(dAtA[i:], m.XXX_unrecognized) 614 } 615 if m.Value != 0 { 616 i -= 8 617 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) 618 i-- 619 dAtA[i] = 0x9 620 } 621 return len(dAtA) - i, nil 622 } 623 624 func (m *Sample) Marshal() (dAtA []byte, err error) { 625 size := m.Size() 626 dAtA = make([]byte, size) 627 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 628 if err != nil { 629 return nil, err 630 } 631 return dAtA[:n], nil 632 } 633 634 func (m *Sample) MarshalTo(dAtA []byte) (int, error) { 635 size := m.Size() 636 return m.MarshalToSizedBuffer(dAtA[:size]) 637 } 638 639 func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { 640 i := len(dAtA) 641 _ = i 642 var l int 643 _ = l 644 if m.XXX_unrecognized != nil { 645 i -= len(m.XXX_unrecognized) 646 copy(dAtA[i:], m.XXX_unrecognized) 647 } 648 if m.Value != 0 { 649 i -= 8 650 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) 651 i-- 652 dAtA[i] = 0x11 653 } 654 if m.Datetime != 0 { 655 i = encodeVarintMetric(dAtA, i, uint64(m.Datetime)) 656 i-- 657 dAtA[i] = 0x8 658 } 659 return len(dAtA) - i, nil 660 } 661 662 func (m *RawHist) Marshal() (dAtA []byte, err error) { 663 size := m.Size() 664 dAtA = make([]byte, size) 665 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 666 if err != nil { 667 return nil, err 668 } 669 return dAtA[:n], nil 670 } 671 672 func (m *RawHist) MarshalTo(dAtA []byte) (int, error) { 673 size := m.Size() 674 return m.MarshalToSizedBuffer(dAtA[:size]) 675 } 676 677 func (m *RawHist) MarshalToSizedBuffer(dAtA []byte) (int, error) { 678 i := len(dAtA) 679 _ = i 680 var l int 681 _ = l 682 if m.XXX_unrecognized != nil { 683 i -= len(m.XXX_unrecognized) 684 copy(dAtA[i:], m.XXX_unrecognized) 685 } 686 if len(m.Samples) > 0 { 687 for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { 688 { 689 size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 690 if err != nil { 691 return 0, err 692 } 693 i -= size 694 i = encodeVarintMetric(dAtA, i, uint64(size)) 695 } 696 i-- 697 dAtA[i] = 0xa 698 } 699 } 700 return len(dAtA) - i, nil 701 } 702 703 func (m *Metric) Marshal() (dAtA []byte, err error) { 704 size := m.Size() 705 dAtA = make([]byte, size) 706 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 707 if err != nil { 708 return nil, err 709 } 710 return dAtA[:n], nil 711 } 712 713 func (m *Metric) MarshalTo(dAtA []byte) (int, error) { 714 size := m.Size() 715 return m.MarshalToSizedBuffer(dAtA[:size]) 716 } 717 718 func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) { 719 i := len(dAtA) 720 _ = i 721 var l int 722 _ = l 723 if m.XXX_unrecognized != nil { 724 i -= len(m.XXX_unrecognized) 725 copy(dAtA[i:], m.XXX_unrecognized) 726 } 727 if m.Collecttime != 0 { 728 i = encodeVarintMetric(dAtA, i, uint64(m.Collecttime)) 729 i-- 730 dAtA[i] = 0x28 731 } 732 if m.RawHist != nil { 733 { 734 size, err := m.RawHist.MarshalToSizedBuffer(dAtA[:i]) 735 if err != nil { 736 return 0, err 737 } 738 i -= size 739 i = encodeVarintMetric(dAtA, i, uint64(size)) 740 } 741 i-- 742 dAtA[i] = 0x22 743 } 744 if m.Counter != nil { 745 { 746 size, err := m.Counter.MarshalToSizedBuffer(dAtA[:i]) 747 if err != nil { 748 return 0, err 749 } 750 i -= size 751 i = encodeVarintMetric(dAtA, i, uint64(size)) 752 } 753 i-- 754 dAtA[i] = 0x1a 755 } 756 if m.Gauge != nil { 757 { 758 size, err := m.Gauge.MarshalToSizedBuffer(dAtA[:i]) 759 if err != nil { 760 return 0, err 761 } 762 i -= size 763 i = encodeVarintMetric(dAtA, i, uint64(size)) 764 } 765 i-- 766 dAtA[i] = 0x12 767 } 768 if len(m.Label) > 0 { 769 for iNdEx := len(m.Label) - 1; iNdEx >= 0; iNdEx-- { 770 { 771 size, err := m.Label[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 772 if err != nil { 773 return 0, err 774 } 775 i -= size 776 i = encodeVarintMetric(dAtA, i, uint64(size)) 777 } 778 i-- 779 dAtA[i] = 0xa 780 } 781 } 782 return len(dAtA) - i, nil 783 } 784 785 func (m *MetricFamily) Marshal() (dAtA []byte, err error) { 786 size := m.Size() 787 dAtA = make([]byte, size) 788 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 789 if err != nil { 790 return nil, err 791 } 792 return dAtA[:n], nil 793 } 794 795 func (m *MetricFamily) MarshalTo(dAtA []byte) (int, error) { 796 size := m.Size() 797 return m.MarshalToSizedBuffer(dAtA[:size]) 798 } 799 800 func (m *MetricFamily) MarshalToSizedBuffer(dAtA []byte) (int, error) { 801 i := len(dAtA) 802 _ = i 803 var l int 804 _ = l 805 if m.XXX_unrecognized != nil { 806 i -= len(m.XXX_unrecognized) 807 copy(dAtA[i:], m.XXX_unrecognized) 808 } 809 if len(m.Role) > 0 { 810 i -= len(m.Role) 811 copy(dAtA[i:], m.Role) 812 i = encodeVarintMetric(dAtA, i, uint64(len(m.Role))) 813 i-- 814 dAtA[i] = 0x32 815 } 816 if len(m.Node) > 0 { 817 i -= len(m.Node) 818 copy(dAtA[i:], m.Node) 819 i = encodeVarintMetric(dAtA, i, uint64(len(m.Node))) 820 i-- 821 dAtA[i] = 0x2a 822 } 823 if len(m.Metric) > 0 { 824 for iNdEx := len(m.Metric) - 1; iNdEx >= 0; iNdEx-- { 825 { 826 size, err := m.Metric[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 827 if err != nil { 828 return 0, err 829 } 830 i -= size 831 i = encodeVarintMetric(dAtA, i, uint64(size)) 832 } 833 i-- 834 dAtA[i] = 0x22 835 } 836 } 837 if m.Type != 0 { 838 i = encodeVarintMetric(dAtA, i, uint64(m.Type)) 839 i-- 840 dAtA[i] = 0x18 841 } 842 if len(m.Help) > 0 { 843 i -= len(m.Help) 844 copy(dAtA[i:], m.Help) 845 i = encodeVarintMetric(dAtA, i, uint64(len(m.Help))) 846 i-- 847 dAtA[i] = 0x12 848 } 849 if len(m.Name) > 0 { 850 i -= len(m.Name) 851 copy(dAtA[i:], m.Name) 852 i = encodeVarintMetric(dAtA, i, uint64(len(m.Name))) 853 i-- 854 dAtA[i] = 0xa 855 } 856 return len(dAtA) - i, nil 857 } 858 859 func encodeVarintMetric(dAtA []byte, offset int, v uint64) int { 860 offset -= sovMetric(v) 861 base := offset 862 for v >= 1<<7 { 863 dAtA[offset] = uint8(v&0x7f | 0x80) 864 v >>= 7 865 offset++ 866 } 867 dAtA[offset] = uint8(v) 868 return base 869 } 870 func (m *LabelPair) Size() (n int) { 871 if m == nil { 872 return 0 873 } 874 var l int 875 _ = l 876 l = len(m.Name) 877 if l > 0 { 878 n += 1 + l + sovMetric(uint64(l)) 879 } 880 l = len(m.Value) 881 if l > 0 { 882 n += 1 + l + sovMetric(uint64(l)) 883 } 884 if m.XXX_unrecognized != nil { 885 n += len(m.XXX_unrecognized) 886 } 887 return n 888 } 889 890 func (m *Gauge) Size() (n int) { 891 if m == nil { 892 return 0 893 } 894 var l int 895 _ = l 896 if m.Value != 0 { 897 n += 9 898 } 899 if m.XXX_unrecognized != nil { 900 n += len(m.XXX_unrecognized) 901 } 902 return n 903 } 904 905 func (m *Counter) Size() (n int) { 906 if m == nil { 907 return 0 908 } 909 var l int 910 _ = l 911 if m.Value != 0 { 912 n += 9 913 } 914 if m.XXX_unrecognized != nil { 915 n += len(m.XXX_unrecognized) 916 } 917 return n 918 } 919 920 func (m *Sample) Size() (n int) { 921 if m == nil { 922 return 0 923 } 924 var l int 925 _ = l 926 if m.Datetime != 0 { 927 n += 1 + sovMetric(uint64(m.Datetime)) 928 } 929 if m.Value != 0 { 930 n += 9 931 } 932 if m.XXX_unrecognized != nil { 933 n += len(m.XXX_unrecognized) 934 } 935 return n 936 } 937 938 func (m *RawHist) Size() (n int) { 939 if m == nil { 940 return 0 941 } 942 var l int 943 _ = l 944 if len(m.Samples) > 0 { 945 for _, e := range m.Samples { 946 l = e.Size() 947 n += 1 + l + sovMetric(uint64(l)) 948 } 949 } 950 if m.XXX_unrecognized != nil { 951 n += len(m.XXX_unrecognized) 952 } 953 return n 954 } 955 956 func (m *Metric) Size() (n int) { 957 if m == nil { 958 return 0 959 } 960 var l int 961 _ = l 962 if len(m.Label) > 0 { 963 for _, e := range m.Label { 964 l = e.Size() 965 n += 1 + l + sovMetric(uint64(l)) 966 } 967 } 968 if m.Gauge != nil { 969 l = m.Gauge.Size() 970 n += 1 + l + sovMetric(uint64(l)) 971 } 972 if m.Counter != nil { 973 l = m.Counter.Size() 974 n += 1 + l + sovMetric(uint64(l)) 975 } 976 if m.RawHist != nil { 977 l = m.RawHist.Size() 978 n += 1 + l + sovMetric(uint64(l)) 979 } 980 if m.Collecttime != 0 { 981 n += 1 + sovMetric(uint64(m.Collecttime)) 982 } 983 if m.XXX_unrecognized != nil { 984 n += len(m.XXX_unrecognized) 985 } 986 return n 987 } 988 989 func (m *MetricFamily) Size() (n int) { 990 if m == nil { 991 return 0 992 } 993 var l int 994 _ = l 995 l = len(m.Name) 996 if l > 0 { 997 n += 1 + l + sovMetric(uint64(l)) 998 } 999 l = len(m.Help) 1000 if l > 0 { 1001 n += 1 + l + sovMetric(uint64(l)) 1002 } 1003 if m.Type != 0 { 1004 n += 1 + sovMetric(uint64(m.Type)) 1005 } 1006 if len(m.Metric) > 0 { 1007 for _, e := range m.Metric { 1008 l = e.Size() 1009 n += 1 + l + sovMetric(uint64(l)) 1010 } 1011 } 1012 l = len(m.Node) 1013 if l > 0 { 1014 n += 1 + l + sovMetric(uint64(l)) 1015 } 1016 l = len(m.Role) 1017 if l > 0 { 1018 n += 1 + l + sovMetric(uint64(l)) 1019 } 1020 if m.XXX_unrecognized != nil { 1021 n += len(m.XXX_unrecognized) 1022 } 1023 return n 1024 } 1025 1026 func sovMetric(x uint64) (n int) { 1027 return (math_bits.Len64(x|1) + 6) / 7 1028 } 1029 func sozMetric(x uint64) (n int) { 1030 return sovMetric(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1031 } 1032 func (m *LabelPair) Unmarshal(dAtA []byte) error { 1033 l := len(dAtA) 1034 iNdEx := 0 1035 for iNdEx < l { 1036 preIndex := iNdEx 1037 var wire uint64 1038 for shift := uint(0); ; shift += 7 { 1039 if shift >= 64 { 1040 return ErrIntOverflowMetric 1041 } 1042 if iNdEx >= l { 1043 return io.ErrUnexpectedEOF 1044 } 1045 b := dAtA[iNdEx] 1046 iNdEx++ 1047 wire |= uint64(b&0x7F) << shift 1048 if b < 0x80 { 1049 break 1050 } 1051 } 1052 fieldNum := int32(wire >> 3) 1053 wireType := int(wire & 0x7) 1054 if wireType == 4 { 1055 return fmt.Errorf("proto: LabelPair: wiretype end group for non-group") 1056 } 1057 if fieldNum <= 0 { 1058 return fmt.Errorf("proto: LabelPair: illegal tag %d (wire type %d)", fieldNum, wire) 1059 } 1060 switch fieldNum { 1061 case 1: 1062 if wireType != 2 { 1063 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 1064 } 1065 var stringLen uint64 1066 for shift := uint(0); ; shift += 7 { 1067 if shift >= 64 { 1068 return ErrIntOverflowMetric 1069 } 1070 if iNdEx >= l { 1071 return io.ErrUnexpectedEOF 1072 } 1073 b := dAtA[iNdEx] 1074 iNdEx++ 1075 stringLen |= uint64(b&0x7F) << shift 1076 if b < 0x80 { 1077 break 1078 } 1079 } 1080 intStringLen := int(stringLen) 1081 if intStringLen < 0 { 1082 return ErrInvalidLengthMetric 1083 } 1084 postIndex := iNdEx + intStringLen 1085 if postIndex < 0 { 1086 return ErrInvalidLengthMetric 1087 } 1088 if postIndex > l { 1089 return io.ErrUnexpectedEOF 1090 } 1091 m.Name = string(dAtA[iNdEx:postIndex]) 1092 iNdEx = postIndex 1093 case 2: 1094 if wireType != 2 { 1095 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 1096 } 1097 var stringLen uint64 1098 for shift := uint(0); ; shift += 7 { 1099 if shift >= 64 { 1100 return ErrIntOverflowMetric 1101 } 1102 if iNdEx >= l { 1103 return io.ErrUnexpectedEOF 1104 } 1105 b := dAtA[iNdEx] 1106 iNdEx++ 1107 stringLen |= uint64(b&0x7F) << shift 1108 if b < 0x80 { 1109 break 1110 } 1111 } 1112 intStringLen := int(stringLen) 1113 if intStringLen < 0 { 1114 return ErrInvalidLengthMetric 1115 } 1116 postIndex := iNdEx + intStringLen 1117 if postIndex < 0 { 1118 return ErrInvalidLengthMetric 1119 } 1120 if postIndex > l { 1121 return io.ErrUnexpectedEOF 1122 } 1123 m.Value = string(dAtA[iNdEx:postIndex]) 1124 iNdEx = postIndex 1125 default: 1126 iNdEx = preIndex 1127 skippy, err := skipMetric(dAtA[iNdEx:]) 1128 if err != nil { 1129 return err 1130 } 1131 if (skippy < 0) || (iNdEx+skippy) < 0 { 1132 return ErrInvalidLengthMetric 1133 } 1134 if (iNdEx + skippy) > l { 1135 return io.ErrUnexpectedEOF 1136 } 1137 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1138 iNdEx += skippy 1139 } 1140 } 1141 1142 if iNdEx > l { 1143 return io.ErrUnexpectedEOF 1144 } 1145 return nil 1146 } 1147 func (m *Gauge) Unmarshal(dAtA []byte) error { 1148 l := len(dAtA) 1149 iNdEx := 0 1150 for iNdEx < l { 1151 preIndex := iNdEx 1152 var wire uint64 1153 for shift := uint(0); ; shift += 7 { 1154 if shift >= 64 { 1155 return ErrIntOverflowMetric 1156 } 1157 if iNdEx >= l { 1158 return io.ErrUnexpectedEOF 1159 } 1160 b := dAtA[iNdEx] 1161 iNdEx++ 1162 wire |= uint64(b&0x7F) << shift 1163 if b < 0x80 { 1164 break 1165 } 1166 } 1167 fieldNum := int32(wire >> 3) 1168 wireType := int(wire & 0x7) 1169 if wireType == 4 { 1170 return fmt.Errorf("proto: Gauge: wiretype end group for non-group") 1171 } 1172 if fieldNum <= 0 { 1173 return fmt.Errorf("proto: Gauge: illegal tag %d (wire type %d)", fieldNum, wire) 1174 } 1175 switch fieldNum { 1176 case 1: 1177 if wireType != 1 { 1178 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 1179 } 1180 var v uint64 1181 if (iNdEx + 8) > l { 1182 return io.ErrUnexpectedEOF 1183 } 1184 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 1185 iNdEx += 8 1186 m.Value = float64(math.Float64frombits(v)) 1187 default: 1188 iNdEx = preIndex 1189 skippy, err := skipMetric(dAtA[iNdEx:]) 1190 if err != nil { 1191 return err 1192 } 1193 if (skippy < 0) || (iNdEx+skippy) < 0 { 1194 return ErrInvalidLengthMetric 1195 } 1196 if (iNdEx + skippy) > l { 1197 return io.ErrUnexpectedEOF 1198 } 1199 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1200 iNdEx += skippy 1201 } 1202 } 1203 1204 if iNdEx > l { 1205 return io.ErrUnexpectedEOF 1206 } 1207 return nil 1208 } 1209 func (m *Counter) Unmarshal(dAtA []byte) error { 1210 l := len(dAtA) 1211 iNdEx := 0 1212 for iNdEx < l { 1213 preIndex := iNdEx 1214 var wire uint64 1215 for shift := uint(0); ; shift += 7 { 1216 if shift >= 64 { 1217 return ErrIntOverflowMetric 1218 } 1219 if iNdEx >= l { 1220 return io.ErrUnexpectedEOF 1221 } 1222 b := dAtA[iNdEx] 1223 iNdEx++ 1224 wire |= uint64(b&0x7F) << shift 1225 if b < 0x80 { 1226 break 1227 } 1228 } 1229 fieldNum := int32(wire >> 3) 1230 wireType := int(wire & 0x7) 1231 if wireType == 4 { 1232 return fmt.Errorf("proto: Counter: wiretype end group for non-group") 1233 } 1234 if fieldNum <= 0 { 1235 return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire) 1236 } 1237 switch fieldNum { 1238 case 1: 1239 if wireType != 1 { 1240 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 1241 } 1242 var v uint64 1243 if (iNdEx + 8) > l { 1244 return io.ErrUnexpectedEOF 1245 } 1246 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 1247 iNdEx += 8 1248 m.Value = float64(math.Float64frombits(v)) 1249 default: 1250 iNdEx = preIndex 1251 skippy, err := skipMetric(dAtA[iNdEx:]) 1252 if err != nil { 1253 return err 1254 } 1255 if (skippy < 0) || (iNdEx+skippy) < 0 { 1256 return ErrInvalidLengthMetric 1257 } 1258 if (iNdEx + skippy) > l { 1259 return io.ErrUnexpectedEOF 1260 } 1261 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1262 iNdEx += skippy 1263 } 1264 } 1265 1266 if iNdEx > l { 1267 return io.ErrUnexpectedEOF 1268 } 1269 return nil 1270 } 1271 func (m *Sample) Unmarshal(dAtA []byte) error { 1272 l := len(dAtA) 1273 iNdEx := 0 1274 for iNdEx < l { 1275 preIndex := iNdEx 1276 var wire uint64 1277 for shift := uint(0); ; shift += 7 { 1278 if shift >= 64 { 1279 return ErrIntOverflowMetric 1280 } 1281 if iNdEx >= l { 1282 return io.ErrUnexpectedEOF 1283 } 1284 b := dAtA[iNdEx] 1285 iNdEx++ 1286 wire |= uint64(b&0x7F) << shift 1287 if b < 0x80 { 1288 break 1289 } 1290 } 1291 fieldNum := int32(wire >> 3) 1292 wireType := int(wire & 0x7) 1293 if wireType == 4 { 1294 return fmt.Errorf("proto: Sample: wiretype end group for non-group") 1295 } 1296 if fieldNum <= 0 { 1297 return fmt.Errorf("proto: Sample: illegal tag %d (wire type %d)", fieldNum, wire) 1298 } 1299 switch fieldNum { 1300 case 1: 1301 if wireType != 0 { 1302 return fmt.Errorf("proto: wrong wireType = %d for field Datetime", wireType) 1303 } 1304 m.Datetime = 0 1305 for shift := uint(0); ; shift += 7 { 1306 if shift >= 64 { 1307 return ErrIntOverflowMetric 1308 } 1309 if iNdEx >= l { 1310 return io.ErrUnexpectedEOF 1311 } 1312 b := dAtA[iNdEx] 1313 iNdEx++ 1314 m.Datetime |= int64(b&0x7F) << shift 1315 if b < 0x80 { 1316 break 1317 } 1318 } 1319 case 2: 1320 if wireType != 1 { 1321 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 1322 } 1323 var v uint64 1324 if (iNdEx + 8) > l { 1325 return io.ErrUnexpectedEOF 1326 } 1327 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 1328 iNdEx += 8 1329 m.Value = float64(math.Float64frombits(v)) 1330 default: 1331 iNdEx = preIndex 1332 skippy, err := skipMetric(dAtA[iNdEx:]) 1333 if err != nil { 1334 return err 1335 } 1336 if (skippy < 0) || (iNdEx+skippy) < 0 { 1337 return ErrInvalidLengthMetric 1338 } 1339 if (iNdEx + skippy) > l { 1340 return io.ErrUnexpectedEOF 1341 } 1342 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1343 iNdEx += skippy 1344 } 1345 } 1346 1347 if iNdEx > l { 1348 return io.ErrUnexpectedEOF 1349 } 1350 return nil 1351 } 1352 func (m *RawHist) Unmarshal(dAtA []byte) error { 1353 l := len(dAtA) 1354 iNdEx := 0 1355 for iNdEx < l { 1356 preIndex := iNdEx 1357 var wire uint64 1358 for shift := uint(0); ; shift += 7 { 1359 if shift >= 64 { 1360 return ErrIntOverflowMetric 1361 } 1362 if iNdEx >= l { 1363 return io.ErrUnexpectedEOF 1364 } 1365 b := dAtA[iNdEx] 1366 iNdEx++ 1367 wire |= uint64(b&0x7F) << shift 1368 if b < 0x80 { 1369 break 1370 } 1371 } 1372 fieldNum := int32(wire >> 3) 1373 wireType := int(wire & 0x7) 1374 if wireType == 4 { 1375 return fmt.Errorf("proto: RawHist: wiretype end group for non-group") 1376 } 1377 if fieldNum <= 0 { 1378 return fmt.Errorf("proto: RawHist: illegal tag %d (wire type %d)", fieldNum, wire) 1379 } 1380 switch fieldNum { 1381 case 1: 1382 if wireType != 2 { 1383 return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) 1384 } 1385 var msglen int 1386 for shift := uint(0); ; shift += 7 { 1387 if shift >= 64 { 1388 return ErrIntOverflowMetric 1389 } 1390 if iNdEx >= l { 1391 return io.ErrUnexpectedEOF 1392 } 1393 b := dAtA[iNdEx] 1394 iNdEx++ 1395 msglen |= int(b&0x7F) << shift 1396 if b < 0x80 { 1397 break 1398 } 1399 } 1400 if msglen < 0 { 1401 return ErrInvalidLengthMetric 1402 } 1403 postIndex := iNdEx + msglen 1404 if postIndex < 0 { 1405 return ErrInvalidLengthMetric 1406 } 1407 if postIndex > l { 1408 return io.ErrUnexpectedEOF 1409 } 1410 m.Samples = append(m.Samples, &Sample{}) 1411 if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1412 return err 1413 } 1414 iNdEx = postIndex 1415 default: 1416 iNdEx = preIndex 1417 skippy, err := skipMetric(dAtA[iNdEx:]) 1418 if err != nil { 1419 return err 1420 } 1421 if (skippy < 0) || (iNdEx+skippy) < 0 { 1422 return ErrInvalidLengthMetric 1423 } 1424 if (iNdEx + skippy) > l { 1425 return io.ErrUnexpectedEOF 1426 } 1427 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1428 iNdEx += skippy 1429 } 1430 } 1431 1432 if iNdEx > l { 1433 return io.ErrUnexpectedEOF 1434 } 1435 return nil 1436 } 1437 func (m *Metric) Unmarshal(dAtA []byte) error { 1438 l := len(dAtA) 1439 iNdEx := 0 1440 for iNdEx < l { 1441 preIndex := iNdEx 1442 var wire uint64 1443 for shift := uint(0); ; shift += 7 { 1444 if shift >= 64 { 1445 return ErrIntOverflowMetric 1446 } 1447 if iNdEx >= l { 1448 return io.ErrUnexpectedEOF 1449 } 1450 b := dAtA[iNdEx] 1451 iNdEx++ 1452 wire |= uint64(b&0x7F) << shift 1453 if b < 0x80 { 1454 break 1455 } 1456 } 1457 fieldNum := int32(wire >> 3) 1458 wireType := int(wire & 0x7) 1459 if wireType == 4 { 1460 return fmt.Errorf("proto: Metric: wiretype end group for non-group") 1461 } 1462 if fieldNum <= 0 { 1463 return fmt.Errorf("proto: Metric: illegal tag %d (wire type %d)", fieldNum, wire) 1464 } 1465 switch fieldNum { 1466 case 1: 1467 if wireType != 2 { 1468 return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) 1469 } 1470 var msglen int 1471 for shift := uint(0); ; shift += 7 { 1472 if shift >= 64 { 1473 return ErrIntOverflowMetric 1474 } 1475 if iNdEx >= l { 1476 return io.ErrUnexpectedEOF 1477 } 1478 b := dAtA[iNdEx] 1479 iNdEx++ 1480 msglen |= int(b&0x7F) << shift 1481 if b < 0x80 { 1482 break 1483 } 1484 } 1485 if msglen < 0 { 1486 return ErrInvalidLengthMetric 1487 } 1488 postIndex := iNdEx + msglen 1489 if postIndex < 0 { 1490 return ErrInvalidLengthMetric 1491 } 1492 if postIndex > l { 1493 return io.ErrUnexpectedEOF 1494 } 1495 m.Label = append(m.Label, &LabelPair{}) 1496 if err := m.Label[len(m.Label)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1497 return err 1498 } 1499 iNdEx = postIndex 1500 case 2: 1501 if wireType != 2 { 1502 return fmt.Errorf("proto: wrong wireType = %d for field Gauge", wireType) 1503 } 1504 var msglen int 1505 for shift := uint(0); ; shift += 7 { 1506 if shift >= 64 { 1507 return ErrIntOverflowMetric 1508 } 1509 if iNdEx >= l { 1510 return io.ErrUnexpectedEOF 1511 } 1512 b := dAtA[iNdEx] 1513 iNdEx++ 1514 msglen |= int(b&0x7F) << shift 1515 if b < 0x80 { 1516 break 1517 } 1518 } 1519 if msglen < 0 { 1520 return ErrInvalidLengthMetric 1521 } 1522 postIndex := iNdEx + msglen 1523 if postIndex < 0 { 1524 return ErrInvalidLengthMetric 1525 } 1526 if postIndex > l { 1527 return io.ErrUnexpectedEOF 1528 } 1529 if m.Gauge == nil { 1530 m.Gauge = &Gauge{} 1531 } 1532 if err := m.Gauge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1533 return err 1534 } 1535 iNdEx = postIndex 1536 case 3: 1537 if wireType != 2 { 1538 return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) 1539 } 1540 var msglen int 1541 for shift := uint(0); ; shift += 7 { 1542 if shift >= 64 { 1543 return ErrIntOverflowMetric 1544 } 1545 if iNdEx >= l { 1546 return io.ErrUnexpectedEOF 1547 } 1548 b := dAtA[iNdEx] 1549 iNdEx++ 1550 msglen |= int(b&0x7F) << shift 1551 if b < 0x80 { 1552 break 1553 } 1554 } 1555 if msglen < 0 { 1556 return ErrInvalidLengthMetric 1557 } 1558 postIndex := iNdEx + msglen 1559 if postIndex < 0 { 1560 return ErrInvalidLengthMetric 1561 } 1562 if postIndex > l { 1563 return io.ErrUnexpectedEOF 1564 } 1565 if m.Counter == nil { 1566 m.Counter = &Counter{} 1567 } 1568 if err := m.Counter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1569 return err 1570 } 1571 iNdEx = postIndex 1572 case 4: 1573 if wireType != 2 { 1574 return fmt.Errorf("proto: wrong wireType = %d for field RawHist", wireType) 1575 } 1576 var msglen int 1577 for shift := uint(0); ; shift += 7 { 1578 if shift >= 64 { 1579 return ErrIntOverflowMetric 1580 } 1581 if iNdEx >= l { 1582 return io.ErrUnexpectedEOF 1583 } 1584 b := dAtA[iNdEx] 1585 iNdEx++ 1586 msglen |= int(b&0x7F) << shift 1587 if b < 0x80 { 1588 break 1589 } 1590 } 1591 if msglen < 0 { 1592 return ErrInvalidLengthMetric 1593 } 1594 postIndex := iNdEx + msglen 1595 if postIndex < 0 { 1596 return ErrInvalidLengthMetric 1597 } 1598 if postIndex > l { 1599 return io.ErrUnexpectedEOF 1600 } 1601 if m.RawHist == nil { 1602 m.RawHist = &RawHist{} 1603 } 1604 if err := m.RawHist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1605 return err 1606 } 1607 iNdEx = postIndex 1608 case 5: 1609 if wireType != 0 { 1610 return fmt.Errorf("proto: wrong wireType = %d for field Collecttime", wireType) 1611 } 1612 m.Collecttime = 0 1613 for shift := uint(0); ; shift += 7 { 1614 if shift >= 64 { 1615 return ErrIntOverflowMetric 1616 } 1617 if iNdEx >= l { 1618 return io.ErrUnexpectedEOF 1619 } 1620 b := dAtA[iNdEx] 1621 iNdEx++ 1622 m.Collecttime |= int64(b&0x7F) << shift 1623 if b < 0x80 { 1624 break 1625 } 1626 } 1627 default: 1628 iNdEx = preIndex 1629 skippy, err := skipMetric(dAtA[iNdEx:]) 1630 if err != nil { 1631 return err 1632 } 1633 if (skippy < 0) || (iNdEx+skippy) < 0 { 1634 return ErrInvalidLengthMetric 1635 } 1636 if (iNdEx + skippy) > l { 1637 return io.ErrUnexpectedEOF 1638 } 1639 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1640 iNdEx += skippy 1641 } 1642 } 1643 1644 if iNdEx > l { 1645 return io.ErrUnexpectedEOF 1646 } 1647 return nil 1648 } 1649 func (m *MetricFamily) Unmarshal(dAtA []byte) error { 1650 l := len(dAtA) 1651 iNdEx := 0 1652 for iNdEx < l { 1653 preIndex := iNdEx 1654 var wire uint64 1655 for shift := uint(0); ; shift += 7 { 1656 if shift >= 64 { 1657 return ErrIntOverflowMetric 1658 } 1659 if iNdEx >= l { 1660 return io.ErrUnexpectedEOF 1661 } 1662 b := dAtA[iNdEx] 1663 iNdEx++ 1664 wire |= uint64(b&0x7F) << shift 1665 if b < 0x80 { 1666 break 1667 } 1668 } 1669 fieldNum := int32(wire >> 3) 1670 wireType := int(wire & 0x7) 1671 if wireType == 4 { 1672 return fmt.Errorf("proto: MetricFamily: wiretype end group for non-group") 1673 } 1674 if fieldNum <= 0 { 1675 return fmt.Errorf("proto: MetricFamily: illegal tag %d (wire type %d)", fieldNum, wire) 1676 } 1677 switch fieldNum { 1678 case 1: 1679 if wireType != 2 { 1680 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 1681 } 1682 var stringLen uint64 1683 for shift := uint(0); ; shift += 7 { 1684 if shift >= 64 { 1685 return ErrIntOverflowMetric 1686 } 1687 if iNdEx >= l { 1688 return io.ErrUnexpectedEOF 1689 } 1690 b := dAtA[iNdEx] 1691 iNdEx++ 1692 stringLen |= uint64(b&0x7F) << shift 1693 if b < 0x80 { 1694 break 1695 } 1696 } 1697 intStringLen := int(stringLen) 1698 if intStringLen < 0 { 1699 return ErrInvalidLengthMetric 1700 } 1701 postIndex := iNdEx + intStringLen 1702 if postIndex < 0 { 1703 return ErrInvalidLengthMetric 1704 } 1705 if postIndex > l { 1706 return io.ErrUnexpectedEOF 1707 } 1708 m.Name = string(dAtA[iNdEx:postIndex]) 1709 iNdEx = postIndex 1710 case 2: 1711 if wireType != 2 { 1712 return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) 1713 } 1714 var stringLen uint64 1715 for shift := uint(0); ; shift += 7 { 1716 if shift >= 64 { 1717 return ErrIntOverflowMetric 1718 } 1719 if iNdEx >= l { 1720 return io.ErrUnexpectedEOF 1721 } 1722 b := dAtA[iNdEx] 1723 iNdEx++ 1724 stringLen |= uint64(b&0x7F) << shift 1725 if b < 0x80 { 1726 break 1727 } 1728 } 1729 intStringLen := int(stringLen) 1730 if intStringLen < 0 { 1731 return ErrInvalidLengthMetric 1732 } 1733 postIndex := iNdEx + intStringLen 1734 if postIndex < 0 { 1735 return ErrInvalidLengthMetric 1736 } 1737 if postIndex > l { 1738 return io.ErrUnexpectedEOF 1739 } 1740 m.Help = string(dAtA[iNdEx:postIndex]) 1741 iNdEx = postIndex 1742 case 3: 1743 if wireType != 0 { 1744 return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) 1745 } 1746 m.Type = 0 1747 for shift := uint(0); ; shift += 7 { 1748 if shift >= 64 { 1749 return ErrIntOverflowMetric 1750 } 1751 if iNdEx >= l { 1752 return io.ErrUnexpectedEOF 1753 } 1754 b := dAtA[iNdEx] 1755 iNdEx++ 1756 m.Type |= MetricType(b&0x7F) << shift 1757 if b < 0x80 { 1758 break 1759 } 1760 } 1761 case 4: 1762 if wireType != 2 { 1763 return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType) 1764 } 1765 var msglen int 1766 for shift := uint(0); ; shift += 7 { 1767 if shift >= 64 { 1768 return ErrIntOverflowMetric 1769 } 1770 if iNdEx >= l { 1771 return io.ErrUnexpectedEOF 1772 } 1773 b := dAtA[iNdEx] 1774 iNdEx++ 1775 msglen |= int(b&0x7F) << shift 1776 if b < 0x80 { 1777 break 1778 } 1779 } 1780 if msglen < 0 { 1781 return ErrInvalidLengthMetric 1782 } 1783 postIndex := iNdEx + msglen 1784 if postIndex < 0 { 1785 return ErrInvalidLengthMetric 1786 } 1787 if postIndex > l { 1788 return io.ErrUnexpectedEOF 1789 } 1790 m.Metric = append(m.Metric, &Metric{}) 1791 if err := m.Metric[len(m.Metric)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1792 return err 1793 } 1794 iNdEx = postIndex 1795 case 5: 1796 if wireType != 2 { 1797 return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) 1798 } 1799 var stringLen uint64 1800 for shift := uint(0); ; shift += 7 { 1801 if shift >= 64 { 1802 return ErrIntOverflowMetric 1803 } 1804 if iNdEx >= l { 1805 return io.ErrUnexpectedEOF 1806 } 1807 b := dAtA[iNdEx] 1808 iNdEx++ 1809 stringLen |= uint64(b&0x7F) << shift 1810 if b < 0x80 { 1811 break 1812 } 1813 } 1814 intStringLen := int(stringLen) 1815 if intStringLen < 0 { 1816 return ErrInvalidLengthMetric 1817 } 1818 postIndex := iNdEx + intStringLen 1819 if postIndex < 0 { 1820 return ErrInvalidLengthMetric 1821 } 1822 if postIndex > l { 1823 return io.ErrUnexpectedEOF 1824 } 1825 m.Node = string(dAtA[iNdEx:postIndex]) 1826 iNdEx = postIndex 1827 case 6: 1828 if wireType != 2 { 1829 return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) 1830 } 1831 var stringLen uint64 1832 for shift := uint(0); ; shift += 7 { 1833 if shift >= 64 { 1834 return ErrIntOverflowMetric 1835 } 1836 if iNdEx >= l { 1837 return io.ErrUnexpectedEOF 1838 } 1839 b := dAtA[iNdEx] 1840 iNdEx++ 1841 stringLen |= uint64(b&0x7F) << shift 1842 if b < 0x80 { 1843 break 1844 } 1845 } 1846 intStringLen := int(stringLen) 1847 if intStringLen < 0 { 1848 return ErrInvalidLengthMetric 1849 } 1850 postIndex := iNdEx + intStringLen 1851 if postIndex < 0 { 1852 return ErrInvalidLengthMetric 1853 } 1854 if postIndex > l { 1855 return io.ErrUnexpectedEOF 1856 } 1857 m.Role = string(dAtA[iNdEx:postIndex]) 1858 iNdEx = postIndex 1859 default: 1860 iNdEx = preIndex 1861 skippy, err := skipMetric(dAtA[iNdEx:]) 1862 if err != nil { 1863 return err 1864 } 1865 if (skippy < 0) || (iNdEx+skippy) < 0 { 1866 return ErrInvalidLengthMetric 1867 } 1868 if (iNdEx + skippy) > l { 1869 return io.ErrUnexpectedEOF 1870 } 1871 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1872 iNdEx += skippy 1873 } 1874 } 1875 1876 if iNdEx > l { 1877 return io.ErrUnexpectedEOF 1878 } 1879 return nil 1880 } 1881 func skipMetric(dAtA []byte) (n int, err error) { 1882 l := len(dAtA) 1883 iNdEx := 0 1884 depth := 0 1885 for iNdEx < l { 1886 var wire uint64 1887 for shift := uint(0); ; shift += 7 { 1888 if shift >= 64 { 1889 return 0, ErrIntOverflowMetric 1890 } 1891 if iNdEx >= l { 1892 return 0, io.ErrUnexpectedEOF 1893 } 1894 b := dAtA[iNdEx] 1895 iNdEx++ 1896 wire |= (uint64(b) & 0x7F) << shift 1897 if b < 0x80 { 1898 break 1899 } 1900 } 1901 wireType := int(wire & 0x7) 1902 switch wireType { 1903 case 0: 1904 for shift := uint(0); ; shift += 7 { 1905 if shift >= 64 { 1906 return 0, ErrIntOverflowMetric 1907 } 1908 if iNdEx >= l { 1909 return 0, io.ErrUnexpectedEOF 1910 } 1911 iNdEx++ 1912 if dAtA[iNdEx-1] < 0x80 { 1913 break 1914 } 1915 } 1916 case 1: 1917 iNdEx += 8 1918 case 2: 1919 var length int 1920 for shift := uint(0); ; shift += 7 { 1921 if shift >= 64 { 1922 return 0, ErrIntOverflowMetric 1923 } 1924 if iNdEx >= l { 1925 return 0, io.ErrUnexpectedEOF 1926 } 1927 b := dAtA[iNdEx] 1928 iNdEx++ 1929 length |= (int(b) & 0x7F) << shift 1930 if b < 0x80 { 1931 break 1932 } 1933 } 1934 if length < 0 { 1935 return 0, ErrInvalidLengthMetric 1936 } 1937 iNdEx += length 1938 case 3: 1939 depth++ 1940 case 4: 1941 if depth == 0 { 1942 return 0, ErrUnexpectedEndOfGroupMetric 1943 } 1944 depth-- 1945 case 5: 1946 iNdEx += 4 1947 default: 1948 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1949 } 1950 if iNdEx < 0 { 1951 return 0, ErrInvalidLengthMetric 1952 } 1953 if depth == 0 { 1954 return iNdEx, nil 1955 } 1956 } 1957 return 0, io.ErrUnexpectedEOF 1958 } 1959 1960 var ( 1961 ErrInvalidLengthMetric = fmt.Errorf("proto: negative length found during unmarshaling") 1962 ErrIntOverflowMetric = fmt.Errorf("proto: integer overflow") 1963 ErrUnexpectedEndOfGroupMetric = fmt.Errorf("proto: unexpected end of group") 1964 )