| 3546 | } |
| 3547 | |
| 3548 | func (m *WriteRequest) Size() (n int) { |
| 3549 | if m == nil { |
| 3550 | return 0 |
| 3551 | } |
| 3552 | var l int |
| 3553 | _ = l |
| 3554 | if len(m.Timeseries) > 0 { |
| 3555 | for _, e := range m.Timeseries { |
| 3556 | l = e.Size() |
| 3557 | n += 1 + l + sovCortex(uint64(l)) |
| 3558 | } |
| 3559 | } |
| 3560 | if m.Source != 0 { |
| 3561 | n += 1 + sovCortex(uint64(m.Source)) |
| 3562 | } |
| 3563 | if len(m.Metadata) > 0 { |
| 3564 | for _, e := range m.Metadata { |
| 3565 | l = e.Size() |
| 3566 | n += 1 + l + sovCortex(uint64(l)) |
| 3567 | } |
| 3568 | } |
| 3569 | if m.SkipLabelNameValidation { |
| 3570 | n += 3 |
| 3571 | } |
| 3572 | l = m.MessageWithBufRef.Size() |
| 3573 | n += 2 + l + sovCortex(uint64(l)) |
| 3574 | if m.DiscardOutOfOrder { |
| 3575 | n += 3 |
| 3576 | } |
| 3577 | return n |
| 3578 | } |
| 3579 | |
| 3580 | func (m *WriteRequestV2) Size() (n int) { |
| 3581 | if m == nil { |