github.com/alibaba/ilogtail/pkg@v0.0.0-20250526110833-c53b480d046c/protocol/metric_event.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: metric_event.proto
     3  
     4  package protocol
     5  
     6  import (
     7  	encoding_binary "encoding/binary"
     8  	fmt "fmt"
     9  	proto "github.com/gogo/protobuf/proto"
    10  	io "io"
    11  	math "math"
    12  	math_bits "math/bits"
    13  )
    14  
    15  // Reference imports to suppress errors if they are not otherwise used.
    16  var _ = proto.Marshal
    17  var _ = fmt.Errorf
    18  var _ = math.Inf
    19  
    20  // This is a compile-time assertion to ensure that this generated file
    21  // is compatible with the proto package it is being compiled against.
    22  // A compilation error at this line likely means your copy of the
    23  // proto package needs to be updated.
    24  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    25  
    26  type UntypedSingleValue struct {
    27  	Value float64 `protobuf:"fixed64,1,opt,name=Value,proto3" json:"Value,omitempty"`
    28  }
    29  
    30  func (m *UntypedSingleValue) Reset()         { *m = UntypedSingleValue{} }
    31  func (m *UntypedSingleValue) String() string { return proto.CompactTextString(m) }
    32  func (*UntypedSingleValue) ProtoMessage()    {}
    33  func (*UntypedSingleValue) Descriptor() ([]byte, []int) {
    34  	return fileDescriptor_7e0c5b3c1d4100c7, []int{0}
    35  }
    36  func (m *UntypedSingleValue) XXX_Unmarshal(b []byte) error {
    37  	return m.Unmarshal(b)
    38  }
    39  func (m *UntypedSingleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    40  	if deterministic {
    41  		return xxx_messageInfo_UntypedSingleValue.Marshal(b, m, deterministic)
    42  	} else {
    43  		b = b[:cap(b)]
    44  		n, err := m.MarshalToSizedBuffer(b)
    45  		if err != nil {
    46  			return nil, err
    47  		}
    48  		return b[:n], nil
    49  	}
    50  }
    51  func (m *UntypedSingleValue) XXX_Merge(src proto.Message) {
    52  	xxx_messageInfo_UntypedSingleValue.Merge(m, src)
    53  }
    54  func (m *UntypedSingleValue) XXX_Size() int {
    55  	return m.Size()
    56  }
    57  func (m *UntypedSingleValue) XXX_DiscardUnknown() {
    58  	xxx_messageInfo_UntypedSingleValue.DiscardUnknown(m)
    59  }
    60  
    61  var xxx_messageInfo_UntypedSingleValue proto.InternalMessageInfo
    62  
    63  func (m *UntypedSingleValue) GetValue() float64 {
    64  	if m != nil {
    65  		return m.Value
    66  	}
    67  	return 0
    68  }
    69  
    70  type MetricEvent struct {
    71  	Timestamp uint64            `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
    72  	Name      []byte            `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
    73  	Tags      map[string][]byte `protobuf:"bytes,3,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    74  	// Types that are valid to be assigned to Value:
    75  	//
    76  	//	*MetricEvent_UntypedSingleValue
    77  	Value isMetricEvent_Value `protobuf_oneof:"Value"`
    78  }
    79  
    80  func (m *MetricEvent) Reset()         { *m = MetricEvent{} }
    81  func (m *MetricEvent) String() string { return proto.CompactTextString(m) }
    82  func (*MetricEvent) ProtoMessage()    {}
    83  func (*MetricEvent) Descriptor() ([]byte, []int) {
    84  	return fileDescriptor_7e0c5b3c1d4100c7, []int{1}
    85  }
    86  func (m *MetricEvent) XXX_Unmarshal(b []byte) error {
    87  	return m.Unmarshal(b)
    88  }
    89  func (m *MetricEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    90  	if deterministic {
    91  		return xxx_messageInfo_MetricEvent.Marshal(b, m, deterministic)
    92  	} else {
    93  		b = b[:cap(b)]
    94  		n, err := m.MarshalToSizedBuffer(b)
    95  		if err != nil {
    96  			return nil, err
    97  		}
    98  		return b[:n], nil
    99  	}
   100  }
   101  func (m *MetricEvent) XXX_Merge(src proto.Message) {
   102  	xxx_messageInfo_MetricEvent.Merge(m, src)
   103  }
   104  func (m *MetricEvent) XXX_Size() int {
   105  	return m.Size()
   106  }
   107  func (m *MetricEvent) XXX_DiscardUnknown() {
   108  	xxx_messageInfo_MetricEvent.DiscardUnknown(m)
   109  }
   110  
   111  var xxx_messageInfo_MetricEvent proto.InternalMessageInfo
   112  
   113  type isMetricEvent_Value interface {
   114  	isMetricEvent_Value()
   115  	MarshalTo([]byte) (int, error)
   116  	Size() int
   117  }
   118  
   119  type MetricEvent_UntypedSingleValue struct {
   120  	UntypedSingleValue *UntypedSingleValue `protobuf:"bytes,4,opt,name=UntypedSingleValue,proto3,oneof" json:"UntypedSingleValue,omitempty"`
   121  }
   122  
   123  func (*MetricEvent_UntypedSingleValue) isMetricEvent_Value() {}
   124  
   125  func (m *MetricEvent) GetValue() isMetricEvent_Value {
   126  	if m != nil {
   127  		return m.Value
   128  	}
   129  	return nil
   130  }
   131  
   132  func (m *MetricEvent) GetTimestamp() uint64 {
   133  	if m != nil {
   134  		return m.Timestamp
   135  	}
   136  	return 0
   137  }
   138  
   139  func (m *MetricEvent) GetName() []byte {
   140  	if m != nil {
   141  		return m.Name
   142  	}
   143  	return nil
   144  }
   145  
   146  func (m *MetricEvent) GetTags() map[string][]byte {
   147  	if m != nil {
   148  		return m.Tags
   149  	}
   150  	return nil
   151  }
   152  
   153  func (m *MetricEvent) GetUntypedSingleValue() *UntypedSingleValue {
   154  	if x, ok := m.GetValue().(*MetricEvent_UntypedSingleValue); ok {
   155  		return x.UntypedSingleValue
   156  	}
   157  	return nil
   158  }
   159  
   160  // XXX_OneofWrappers is for the internal use of the proto package.
   161  func (*MetricEvent) XXX_OneofWrappers() []interface{} {
   162  	return []interface{}{
   163  		(*MetricEvent_UntypedSingleValue)(nil),
   164  	}
   165  }
   166  
   167  func init() {
   168  	proto.RegisterType((*UntypedSingleValue)(nil), "logtail.models.UntypedSingleValue")
   169  	proto.RegisterType((*MetricEvent)(nil), "logtail.models.MetricEvent")
   170  	proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.MetricEvent.TagsEntry")
   171  }
   172  
   173  func init() { proto.RegisterFile("metric_event.proto", fileDescriptor_7e0c5b3c1d4100c7) }
   174  
   175  var fileDescriptor_7e0c5b3c1d4100c7 = []byte{
   176  	// 269 bytes of a gzipped FileDescriptorProto
   177  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x4d, 0x2d, 0x29,
   178  	0xca, 0x4c, 0x8e, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2,
   179  	0xcb, 0xc9, 0x4f, 0x2f, 0x49, 0xcc, 0xcc, 0xd1, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x56, 0xd2,
   180  	0xe2, 0x12, 0x0a, 0xcd, 0x2b, 0xa9, 0x2c, 0x48, 0x4d, 0x09, 0xce, 0xcc, 0x4b, 0xcf, 0x49, 0x0d,
   181  	0x4b, 0xcc, 0x29, 0x4d, 0x15, 0x12, 0xe1, 0x62, 0x05, 0x33, 0x24, 0x18, 0x15, 0x18, 0x35, 0x18,
   182  	0x83, 0x20, 0x1c, 0xa5, 0x49, 0x4c, 0x5c, 0xdc, 0xbe, 0x60, 0x23, 0x5d, 0x41, 0x26, 0x0a, 0xc9,
   183  	0x70, 0x71, 0x86, 0x64, 0xe6, 0xa6, 0x16, 0x97, 0x24, 0xe6, 0x16, 0x80, 0x55, 0xb2, 0x04, 0x21,
   184  	0x04, 0x84, 0x84, 0xb8, 0x58, 0xfc, 0x12, 0x73, 0x53, 0x25, 0x98, 0x14, 0x18, 0x35, 0x78, 0x82,
   185  	0xc0, 0x6c, 0x21, 0x4b, 0x2e, 0x96, 0x90, 0xc4, 0xf4, 0x62, 0x09, 0x66, 0x05, 0x66, 0x0d, 0x6e,
   186  	0x23, 0x55, 0x3d, 0x54, 0xc7, 0xe8, 0x21, 0x19, 0xae, 0x07, 0x52, 0xe7, 0x9a, 0x57, 0x52, 0x54,
   187  	0x19, 0x04, 0xd6, 0x22, 0x14, 0x82, 0xcd, 0xa1, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x4a,
   188  	0xe8, 0x06, 0x61, 0xaa, 0xf4, 0x60, 0x08, 0xc2, 0xa2, 0x5f, 0xca, 0x9c, 0x8b, 0x13, 0x6e, 0x91,
   189  	0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25, 0xd8, 0x27, 0x9c, 0x41, 0x20, 0x26, 0x28, 0x1c, 0xca,
   190  	0xc0, 0xf6, 0x40, 0x3c, 0x01, 0xe1, 0x58, 0x31, 0x59, 0x30, 0x3a, 0xb1, 0x43, 0x43, 0xc8, 0x49,
   191  	0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58,
   192  	0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x21, 0x6e, 0x0c,
   193  	0x08, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x8c, 0xec, 0xc0, 0x87, 0x01, 0x00, 0x00,
   194  }
   195  
   196  func (m *UntypedSingleValue) Marshal() (dAtA []byte, err error) {
   197  	size := m.Size()
   198  	dAtA = make([]byte, size)
   199  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   200  	if err != nil {
   201  		return nil, err
   202  	}
   203  	return dAtA[:n], nil
   204  }
   205  
   206  func (m *UntypedSingleValue) MarshalTo(dAtA []byte) (int, error) {
   207  	size := m.Size()
   208  	return m.MarshalToSizedBuffer(dAtA[:size])
   209  }
   210  
   211  func (m *UntypedSingleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   212  	i := len(dAtA)
   213  	_ = i
   214  	var l int
   215  	_ = l
   216  	if m.Value != 0 {
   217  		i -= 8
   218  		encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
   219  		i--
   220  		dAtA[i] = 0x9
   221  	}
   222  	return len(dAtA) - i, nil
   223  }
   224  
   225  func (m *MetricEvent) Marshal() (dAtA []byte, err error) {
   226  	size := m.Size()
   227  	dAtA = make([]byte, size)
   228  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   229  	if err != nil {
   230  		return nil, err
   231  	}
   232  	return dAtA[:n], nil
   233  }
   234  
   235  func (m *MetricEvent) MarshalTo(dAtA []byte) (int, error) {
   236  	size := m.Size()
   237  	return m.MarshalToSizedBuffer(dAtA[:size])
   238  }
   239  
   240  func (m *MetricEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   241  	i := len(dAtA)
   242  	_ = i
   243  	var l int
   244  	_ = l
   245  	if m.Value != nil {
   246  		{
   247  			size := m.Value.Size()
   248  			i -= size
   249  			if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil {
   250  				return 0, err
   251  			}
   252  		}
   253  	}
   254  	if len(m.Tags) > 0 {
   255  		for k := range m.Tags {
   256  			v := m.Tags[k]
   257  			baseI := i
   258  			if len(v) > 0 {
   259  				i -= len(v)
   260  				copy(dAtA[i:], v)
   261  				i = encodeVarintMetricEvent(dAtA, i, uint64(len(v)))
   262  				i--
   263  				dAtA[i] = 0x12
   264  			}
   265  			i -= len(k)
   266  			copy(dAtA[i:], k)
   267  			i = encodeVarintMetricEvent(dAtA, i, uint64(len(k)))
   268  			i--
   269  			dAtA[i] = 0xa
   270  			i = encodeVarintMetricEvent(dAtA, i, uint64(baseI-i))
   271  			i--
   272  			dAtA[i] = 0x1a
   273  		}
   274  	}
   275  	if len(m.Name) > 0 {
   276  		i -= len(m.Name)
   277  		copy(dAtA[i:], m.Name)
   278  		i = encodeVarintMetricEvent(dAtA, i, uint64(len(m.Name)))
   279  		i--
   280  		dAtA[i] = 0x12
   281  	}
   282  	if m.Timestamp != 0 {
   283  		i = encodeVarintMetricEvent(dAtA, i, uint64(m.Timestamp))
   284  		i--
   285  		dAtA[i] = 0x8
   286  	}
   287  	return len(dAtA) - i, nil
   288  }
   289  
   290  func (m *MetricEvent_UntypedSingleValue) MarshalTo(dAtA []byte) (int, error) {
   291  	size := m.Size()
   292  	return m.MarshalToSizedBuffer(dAtA[:size])
   293  }
   294  
   295  func (m *MetricEvent_UntypedSingleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   296  	i := len(dAtA)
   297  	if m.UntypedSingleValue != nil {
   298  		{
   299  			size, err := m.UntypedSingleValue.MarshalToSizedBuffer(dAtA[:i])
   300  			if err != nil {
   301  				return 0, err
   302  			}
   303  			i -= size
   304  			i = encodeVarintMetricEvent(dAtA, i, uint64(size))
   305  		}
   306  		i--
   307  		dAtA[i] = 0x22
   308  	}
   309  	return len(dAtA) - i, nil
   310  }
   311  func encodeVarintMetricEvent(dAtA []byte, offset int, v uint64) int {
   312  	offset -= sovMetricEvent(v)
   313  	base := offset
   314  	for v >= 1<<7 {
   315  		dAtA[offset] = uint8(v&0x7f | 0x80)
   316  		v >>= 7
   317  		offset++
   318  	}
   319  	dAtA[offset] = uint8(v)
   320  	return base
   321  }
   322  func (m *UntypedSingleValue) Size() (n int) {
   323  	if m == nil {
   324  		return 0
   325  	}
   326  	var l int
   327  	_ = l
   328  	if m.Value != 0 {
   329  		n += 9
   330  	}
   331  	return n
   332  }
   333  
   334  func (m *MetricEvent) Size() (n int) {
   335  	if m == nil {
   336  		return 0
   337  	}
   338  	var l int
   339  	_ = l
   340  	if m.Timestamp != 0 {
   341  		n += 1 + sovMetricEvent(uint64(m.Timestamp))
   342  	}
   343  	l = len(m.Name)
   344  	if l > 0 {
   345  		n += 1 + l + sovMetricEvent(uint64(l))
   346  	}
   347  	if len(m.Tags) > 0 {
   348  		for k, v := range m.Tags {
   349  			_ = k
   350  			_ = v
   351  			l = 0
   352  			if len(v) > 0 {
   353  				l = 1 + len(v) + sovMetricEvent(uint64(len(v)))
   354  			}
   355  			mapEntrySize := 1 + len(k) + sovMetricEvent(uint64(len(k))) + l
   356  			n += mapEntrySize + 1 + sovMetricEvent(uint64(mapEntrySize))
   357  		}
   358  	}
   359  	if m.Value != nil {
   360  		n += m.Value.Size()
   361  	}
   362  	return n
   363  }
   364  
   365  func (m *MetricEvent_UntypedSingleValue) Size() (n int) {
   366  	if m == nil {
   367  		return 0
   368  	}
   369  	var l int
   370  	_ = l
   371  	if m.UntypedSingleValue != nil {
   372  		l = m.UntypedSingleValue.Size()
   373  		n += 1 + l + sovMetricEvent(uint64(l))
   374  	}
   375  	return n
   376  }
   377  
   378  func sovMetricEvent(x uint64) (n int) {
   379  	return (math_bits.Len64(x|1) + 6) / 7
   380  }
   381  func sozMetricEvent(x uint64) (n int) {
   382  	return sovMetricEvent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   383  }
   384  func (m *UntypedSingleValue) Unmarshal(dAtA []byte) error {
   385  	l := len(dAtA)
   386  	iNdEx := 0
   387  	for iNdEx < l {
   388  		preIndex := iNdEx
   389  		var wire uint64
   390  		for shift := uint(0); ; shift += 7 {
   391  			if shift >= 64 {
   392  				return ErrIntOverflowMetricEvent
   393  			}
   394  			if iNdEx >= l {
   395  				return io.ErrUnexpectedEOF
   396  			}
   397  			b := dAtA[iNdEx]
   398  			iNdEx++
   399  			wire |= uint64(b&0x7F) << shift
   400  			if b < 0x80 {
   401  				break
   402  			}
   403  		}
   404  		fieldNum := int32(wire >> 3)
   405  		wireType := int(wire & 0x7)
   406  		if wireType == 4 {
   407  			return fmt.Errorf("proto: UntypedSingleValue: wiretype end group for non-group")
   408  		}
   409  		if fieldNum <= 0 {
   410  			return fmt.Errorf("proto: UntypedSingleValue: illegal tag %d (wire type %d)", fieldNum, wire)
   411  		}
   412  		switch fieldNum {
   413  		case 1:
   414  			if wireType != 1 {
   415  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
   416  			}
   417  			var v uint64
   418  			if (iNdEx + 8) > l {
   419  				return io.ErrUnexpectedEOF
   420  			}
   421  			v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
   422  			iNdEx += 8
   423  			m.Value = float64(math.Float64frombits(v))
   424  		default:
   425  			iNdEx = preIndex
   426  			skippy, err := skipMetricEvent(dAtA[iNdEx:])
   427  			if err != nil {
   428  				return err
   429  			}
   430  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   431  				return ErrInvalidLengthMetricEvent
   432  			}
   433  			if (iNdEx + skippy) > l {
   434  				return io.ErrUnexpectedEOF
   435  			}
   436  			iNdEx += skippy
   437  		}
   438  	}
   439  
   440  	if iNdEx > l {
   441  		return io.ErrUnexpectedEOF
   442  	}
   443  	return nil
   444  }
   445  func (m *MetricEvent) Unmarshal(dAtA []byte) error {
   446  	l := len(dAtA)
   447  	iNdEx := 0
   448  	for iNdEx < l {
   449  		preIndex := iNdEx
   450  		var wire uint64
   451  		for shift := uint(0); ; shift += 7 {
   452  			if shift >= 64 {
   453  				return ErrIntOverflowMetricEvent
   454  			}
   455  			if iNdEx >= l {
   456  				return io.ErrUnexpectedEOF
   457  			}
   458  			b := dAtA[iNdEx]
   459  			iNdEx++
   460  			wire |= uint64(b&0x7F) << shift
   461  			if b < 0x80 {
   462  				break
   463  			}
   464  		}
   465  		fieldNum := int32(wire >> 3)
   466  		wireType := int(wire & 0x7)
   467  		if wireType == 4 {
   468  			return fmt.Errorf("proto: MetricEvent: wiretype end group for non-group")
   469  		}
   470  		if fieldNum <= 0 {
   471  			return fmt.Errorf("proto: MetricEvent: illegal tag %d (wire type %d)", fieldNum, wire)
   472  		}
   473  		switch fieldNum {
   474  		case 1:
   475  			if wireType != 0 {
   476  				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
   477  			}
   478  			m.Timestamp = 0
   479  			for shift := uint(0); ; shift += 7 {
   480  				if shift >= 64 {
   481  					return ErrIntOverflowMetricEvent
   482  				}
   483  				if iNdEx >= l {
   484  					return io.ErrUnexpectedEOF
   485  				}
   486  				b := dAtA[iNdEx]
   487  				iNdEx++
   488  				m.Timestamp |= uint64(b&0x7F) << shift
   489  				if b < 0x80 {
   490  					break
   491  				}
   492  			}
   493  		case 2:
   494  			if wireType != 2 {
   495  				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
   496  			}
   497  			var byteLen int
   498  			for shift := uint(0); ; shift += 7 {
   499  				if shift >= 64 {
   500  					return ErrIntOverflowMetricEvent
   501  				}
   502  				if iNdEx >= l {
   503  					return io.ErrUnexpectedEOF
   504  				}
   505  				b := dAtA[iNdEx]
   506  				iNdEx++
   507  				byteLen |= int(b&0x7F) << shift
   508  				if b < 0x80 {
   509  					break
   510  				}
   511  			}
   512  			if byteLen < 0 {
   513  				return ErrInvalidLengthMetricEvent
   514  			}
   515  			postIndex := iNdEx + byteLen
   516  			if postIndex < 0 {
   517  				return ErrInvalidLengthMetricEvent
   518  			}
   519  			if postIndex > l {
   520  				return io.ErrUnexpectedEOF
   521  			}
   522  			m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
   523  			if m.Name == nil {
   524  				m.Name = []byte{}
   525  			}
   526  			iNdEx = postIndex
   527  		case 3:
   528  			if wireType != 2 {
   529  				return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType)
   530  			}
   531  			var msglen int
   532  			for shift := uint(0); ; shift += 7 {
   533  				if shift >= 64 {
   534  					return ErrIntOverflowMetricEvent
   535  				}
   536  				if iNdEx >= l {
   537  					return io.ErrUnexpectedEOF
   538  				}
   539  				b := dAtA[iNdEx]
   540  				iNdEx++
   541  				msglen |= int(b&0x7F) << shift
   542  				if b < 0x80 {
   543  					break
   544  				}
   545  			}
   546  			if msglen < 0 {
   547  				return ErrInvalidLengthMetricEvent
   548  			}
   549  			postIndex := iNdEx + msglen
   550  			if postIndex < 0 {
   551  				return ErrInvalidLengthMetricEvent
   552  			}
   553  			if postIndex > l {
   554  				return io.ErrUnexpectedEOF
   555  			}
   556  			if m.Tags == nil {
   557  				m.Tags = make(map[string][]byte)
   558  			}
   559  			var mapkey string
   560  			mapvalue := []byte{}
   561  			for iNdEx < postIndex {
   562  				entryPreIndex := iNdEx
   563  				var wire uint64
   564  				for shift := uint(0); ; shift += 7 {
   565  					if shift >= 64 {
   566  						return ErrIntOverflowMetricEvent
   567  					}
   568  					if iNdEx >= l {
   569  						return io.ErrUnexpectedEOF
   570  					}
   571  					b := dAtA[iNdEx]
   572  					iNdEx++
   573  					wire |= uint64(b&0x7F) << shift
   574  					if b < 0x80 {
   575  						break
   576  					}
   577  				}
   578  				fieldNum := int32(wire >> 3)
   579  				if fieldNum == 1 {
   580  					var stringLenmapkey uint64
   581  					for shift := uint(0); ; shift += 7 {
   582  						if shift >= 64 {
   583  							return ErrIntOverflowMetricEvent
   584  						}
   585  						if iNdEx >= l {
   586  							return io.ErrUnexpectedEOF
   587  						}
   588  						b := dAtA[iNdEx]
   589  						iNdEx++
   590  						stringLenmapkey |= uint64(b&0x7F) << shift
   591  						if b < 0x80 {
   592  							break
   593  						}
   594  					}
   595  					intStringLenmapkey := int(stringLenmapkey)
   596  					if intStringLenmapkey < 0 {
   597  						return ErrInvalidLengthMetricEvent
   598  					}
   599  					postStringIndexmapkey := iNdEx + intStringLenmapkey
   600  					if postStringIndexmapkey < 0 {
   601  						return ErrInvalidLengthMetricEvent
   602  					}
   603  					if postStringIndexmapkey > l {
   604  						return io.ErrUnexpectedEOF
   605  					}
   606  					mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
   607  					iNdEx = postStringIndexmapkey
   608  				} else if fieldNum == 2 {
   609  					var mapbyteLen uint64
   610  					for shift := uint(0); ; shift += 7 {
   611  						if shift >= 64 {
   612  							return ErrIntOverflowMetricEvent
   613  						}
   614  						if iNdEx >= l {
   615  							return io.ErrUnexpectedEOF
   616  						}
   617  						b := dAtA[iNdEx]
   618  						iNdEx++
   619  						mapbyteLen |= uint64(b&0x7F) << shift
   620  						if b < 0x80 {
   621  							break
   622  						}
   623  					}
   624  					intMapbyteLen := int(mapbyteLen)
   625  					if intMapbyteLen < 0 {
   626  						return ErrInvalidLengthMetricEvent
   627  					}
   628  					postbytesIndex := iNdEx + intMapbyteLen
   629  					if postbytesIndex < 0 {
   630  						return ErrInvalidLengthMetricEvent
   631  					}
   632  					if postbytesIndex > l {
   633  						return io.ErrUnexpectedEOF
   634  					}
   635  					mapvalue = make([]byte, mapbyteLen)
   636  					copy(mapvalue, dAtA[iNdEx:postbytesIndex])
   637  					iNdEx = postbytesIndex
   638  				} else {
   639  					iNdEx = entryPreIndex
   640  					skippy, err := skipMetricEvent(dAtA[iNdEx:])
   641  					if err != nil {
   642  						return err
   643  					}
   644  					if (skippy < 0) || (iNdEx+skippy) < 0 {
   645  						return ErrInvalidLengthMetricEvent
   646  					}
   647  					if (iNdEx + skippy) > postIndex {
   648  						return io.ErrUnexpectedEOF
   649  					}
   650  					iNdEx += skippy
   651  				}
   652  			}
   653  			m.Tags[mapkey] = mapvalue
   654  			iNdEx = postIndex
   655  		case 4:
   656  			if wireType != 2 {
   657  				return fmt.Errorf("proto: wrong wireType = %d for field UntypedSingleValue", wireType)
   658  			}
   659  			var msglen int
   660  			for shift := uint(0); ; shift += 7 {
   661  				if shift >= 64 {
   662  					return ErrIntOverflowMetricEvent
   663  				}
   664  				if iNdEx >= l {
   665  					return io.ErrUnexpectedEOF
   666  				}
   667  				b := dAtA[iNdEx]
   668  				iNdEx++
   669  				msglen |= int(b&0x7F) << shift
   670  				if b < 0x80 {
   671  					break
   672  				}
   673  			}
   674  			if msglen < 0 {
   675  				return ErrInvalidLengthMetricEvent
   676  			}
   677  			postIndex := iNdEx + msglen
   678  			if postIndex < 0 {
   679  				return ErrInvalidLengthMetricEvent
   680  			}
   681  			if postIndex > l {
   682  				return io.ErrUnexpectedEOF
   683  			}
   684  			v := &UntypedSingleValue{}
   685  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   686  				return err
   687  			}
   688  			m.Value = &MetricEvent_UntypedSingleValue{v}
   689  			iNdEx = postIndex
   690  		default:
   691  			iNdEx = preIndex
   692  			skippy, err := skipMetricEvent(dAtA[iNdEx:])
   693  			if err != nil {
   694  				return err
   695  			}
   696  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   697  				return ErrInvalidLengthMetricEvent
   698  			}
   699  			if (iNdEx + skippy) > l {
   700  				return io.ErrUnexpectedEOF
   701  			}
   702  			iNdEx += skippy
   703  		}
   704  	}
   705  
   706  	if iNdEx > l {
   707  		return io.ErrUnexpectedEOF
   708  	}
   709  	return nil
   710  }
   711  func skipMetricEvent(dAtA []byte) (n int, err error) {
   712  	l := len(dAtA)
   713  	iNdEx := 0
   714  	depth := 0
   715  	for iNdEx < l {
   716  		var wire uint64
   717  		for shift := uint(0); ; shift += 7 {
   718  			if shift >= 64 {
   719  				return 0, ErrIntOverflowMetricEvent
   720  			}
   721  			if iNdEx >= l {
   722  				return 0, io.ErrUnexpectedEOF
   723  			}
   724  			b := dAtA[iNdEx]
   725  			iNdEx++
   726  			wire |= (uint64(b) & 0x7F) << shift
   727  			if b < 0x80 {
   728  				break
   729  			}
   730  		}
   731  		wireType := int(wire & 0x7)
   732  		switch wireType {
   733  		case 0:
   734  			for shift := uint(0); ; shift += 7 {
   735  				if shift >= 64 {
   736  					return 0, ErrIntOverflowMetricEvent
   737  				}
   738  				if iNdEx >= l {
   739  					return 0, io.ErrUnexpectedEOF
   740  				}
   741  				iNdEx++
   742  				if dAtA[iNdEx-1] < 0x80 {
   743  					break
   744  				}
   745  			}
   746  		case 1:
   747  			iNdEx += 8
   748  		case 2:
   749  			var length int
   750  			for shift := uint(0); ; shift += 7 {
   751  				if shift >= 64 {
   752  					return 0, ErrIntOverflowMetricEvent
   753  				}
   754  				if iNdEx >= l {
   755  					return 0, io.ErrUnexpectedEOF
   756  				}
   757  				b := dAtA[iNdEx]
   758  				iNdEx++
   759  				length |= (int(b) & 0x7F) << shift
   760  				if b < 0x80 {
   761  					break
   762  				}
   763  			}
   764  			if length < 0 {
   765  				return 0, ErrInvalidLengthMetricEvent
   766  			}
   767  			iNdEx += length
   768  		case 3:
   769  			depth++
   770  		case 4:
   771  			if depth == 0 {
   772  				return 0, ErrUnexpectedEndOfGroupMetricEvent
   773  			}
   774  			depth--
   775  		case 5:
   776  			iNdEx += 4
   777  		default:
   778  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   779  		}
   780  		if iNdEx < 0 {
   781  			return 0, ErrInvalidLengthMetricEvent
   782  		}
   783  		if depth == 0 {
   784  			return iNdEx, nil
   785  		}
   786  	}
   787  	return 0, io.ErrUnexpectedEOF
   788  }
   789  
   790  var (
   791  	ErrInvalidLengthMetricEvent        = fmt.Errorf("proto: negative length found during unmarshaling")
   792  	ErrIntOverflowMetricEvent          = fmt.Errorf("proto: integer overflow")
   793  	ErrUnexpectedEndOfGroupMetricEvent = fmt.Errorf("proto: unexpected end of group")
   794  )