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