1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto 3 4/* 5Package metricspb is a generated protocol buffer package. 6 7It is generated from these files: 8 github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto 9 10It has these top-level messages: 11 MetricPoint 12 IngestRequest 13 IngestResponse 14*/ 15package metricspb // import "github.com/lightstep/lightstep-tracer-common/golang/protobuf/metricspb" 16 17import proto "github.com/golang/protobuf/proto" 18import fmt "fmt" 19import math "math" 20import lightstep_collector "github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb" 21import _ "google.golang.org/genproto/googleapis/api/annotations" 22import google_protobuf2 "github.com/golang/protobuf/ptypes/duration" 23import google_protobuf "github.com/golang/protobuf/ptypes/timestamp" 24 25import ( 26 context "golang.org/x/net/context" 27 grpc "google.golang.org/grpc" 28) 29 30// Reference imports to suppress errors if they are not otherwise used. 31var _ = proto.Marshal 32var _ = fmt.Errorf 33var _ = math.Inf 34 35// This is a compile-time assertion to ensure that this generated file 36// is compatible with the proto package it is being compiled against. 37// A compilation error at this line likely means your copy of the 38// proto package needs to be updated. 39const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 40 41// MetricKind indicates the semantics of the points (i.e. how to interpret values 42// relative to each other). 43type MetricKind int32 44 45const ( 46 // InvalidMetricKind is the default value for the MetricKind. Some languages' proto compilers 47 // (e.g. Go) return the default if no value is set. The default is marked invalid here to 48 // avoid a common mistake where a field is left unset and appears to be set to the default. 49 MetricKind_INVALID_METRIC_KIND MetricKind = 0 50 // Counter metrics measure change over an interval. 51 // When aggregated, counter metrics are usually added. 52 MetricKind_COUNTER MetricKind = 1 53 // Gauge metrics measure the value at a point in time. 54 // When aggregated, intermediate values are often dropped for the latest value. 55 MetricKind_GAUGE MetricKind = 2 56) 57 58var MetricKind_name = map[int32]string{ 59 0: "INVALID_METRIC_KIND", 60 1: "COUNTER", 61 2: "GAUGE", 62} 63var MetricKind_value = map[string]int32{ 64 "INVALID_METRIC_KIND": 0, 65 "COUNTER": 1, 66 "GAUGE": 2, 67} 68 69func (x MetricKind) String() string { 70 return proto.EnumName(MetricKind_name, int32(x)) 71} 72func (MetricKind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 73 74// MetricPoint is an update to a single measure. 75type MetricPoint struct { 76 // Kind indicates the semantics of this point. Kind should always be the same for a given metric 77 // name (e.g. "cpu.usage" should always have the same kind) 78 Kind MetricKind `protobuf:"varint,1,opt,name=kind,enum=lightstep.metrics.MetricKind" json:"kind,omitempty"` 79 // MetricName indicates the metric being emitted. 80 MetricName string `protobuf:"bytes,2,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"` 81 // Start of the interval for which the points represent. 82 // - All Counter points will be assumed to represent the entire interval. 83 // - All Gauge points will be assumed to be instantaneous at the start of the interval. 84 Start *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=start" json:"start,omitempty"` 85 // Duration of the interval for which the points represent. The end of the interval is start + duration. 86 // We expect this value to be unset or zero for Gauge points. 87 Duration *google_protobuf2.Duration `protobuf:"bytes,4,opt,name=duration" json:"duration,omitempty"` 88 // Labels contain labels specific to this point. 89 Labels []*lightstep_collector.KeyValue `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty"` 90 // Value represents the update being emitted. Values can be one of two types: uint64 or double. 91 // The type of the value should always be the same for a given metric name (e.g. "cpu.usage" 92 // should always have value type double). 93 // 94 // Types that are valid to be assigned to Value: 95 // *MetricPoint_Uint64Value 96 // *MetricPoint_DoubleValue 97 Value isMetricPoint_Value `protobuf_oneof:"value"` 98} 99 100func (m *MetricPoint) Reset() { *m = MetricPoint{} } 101func (m *MetricPoint) String() string { return proto.CompactTextString(m) } 102func (*MetricPoint) ProtoMessage() {} 103func (*MetricPoint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 104 105type isMetricPoint_Value interface { 106 isMetricPoint_Value() 107} 108 109type MetricPoint_Uint64Value struct { 110 Uint64Value uint64 `protobuf:"varint,6,opt,name=uint64_value,json=uint64Value,oneof"` 111} 112type MetricPoint_DoubleValue struct { 113 DoubleValue float64 `protobuf:"fixed64,7,opt,name=double_value,json=doubleValue,oneof"` 114} 115 116func (*MetricPoint_Uint64Value) isMetricPoint_Value() {} 117func (*MetricPoint_DoubleValue) isMetricPoint_Value() {} 118 119func (m *MetricPoint) GetValue() isMetricPoint_Value { 120 if m != nil { 121 return m.Value 122 } 123 return nil 124} 125 126func (m *MetricPoint) GetKind() MetricKind { 127 if m != nil { 128 return m.Kind 129 } 130 return MetricKind_INVALID_METRIC_KIND 131} 132 133func (m *MetricPoint) GetMetricName() string { 134 if m != nil { 135 return m.MetricName 136 } 137 return "" 138} 139 140func (m *MetricPoint) GetStart() *google_protobuf.Timestamp { 141 if m != nil { 142 return m.Start 143 } 144 return nil 145} 146 147func (m *MetricPoint) GetDuration() *google_protobuf2.Duration { 148 if m != nil { 149 return m.Duration 150 } 151 return nil 152} 153 154func (m *MetricPoint) GetLabels() []*lightstep_collector.KeyValue { 155 if m != nil { 156 return m.Labels 157 } 158 return nil 159} 160 161func (m *MetricPoint) GetUint64Value() uint64 { 162 if x, ok := m.GetValue().(*MetricPoint_Uint64Value); ok { 163 return x.Uint64Value 164 } 165 return 0 166} 167 168func (m *MetricPoint) GetDoubleValue() float64 { 169 if x, ok := m.GetValue().(*MetricPoint_DoubleValue); ok { 170 return x.DoubleValue 171 } 172 return 0 173} 174 175// XXX_OneofFuncs is for the internal use of the proto package. 176func (*MetricPoint) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 177 return _MetricPoint_OneofMarshaler, _MetricPoint_OneofUnmarshaler, _MetricPoint_OneofSizer, []interface{}{ 178 (*MetricPoint_Uint64Value)(nil), 179 (*MetricPoint_DoubleValue)(nil), 180 } 181} 182 183func _MetricPoint_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 184 m := msg.(*MetricPoint) 185 // value 186 switch x := m.Value.(type) { 187 case *MetricPoint_Uint64Value: 188 b.EncodeVarint(6<<3 | proto.WireVarint) 189 b.EncodeVarint(uint64(x.Uint64Value)) 190 case *MetricPoint_DoubleValue: 191 b.EncodeVarint(7<<3 | proto.WireFixed64) 192 b.EncodeFixed64(math.Float64bits(x.DoubleValue)) 193 case nil: 194 default: 195 return fmt.Errorf("MetricPoint.Value has unexpected type %T", x) 196 } 197 return nil 198} 199 200func _MetricPoint_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 201 m := msg.(*MetricPoint) 202 switch tag { 203 case 6: // value.uint64_value 204 if wire != proto.WireVarint { 205 return true, proto.ErrInternalBadWireType 206 } 207 x, err := b.DecodeVarint() 208 m.Value = &MetricPoint_Uint64Value{x} 209 return true, err 210 case 7: // value.double_value 211 if wire != proto.WireFixed64 { 212 return true, proto.ErrInternalBadWireType 213 } 214 x, err := b.DecodeFixed64() 215 m.Value = &MetricPoint_DoubleValue{math.Float64frombits(x)} 216 return true, err 217 default: 218 return false, nil 219 } 220} 221 222func _MetricPoint_OneofSizer(msg proto.Message) (n int) { 223 m := msg.(*MetricPoint) 224 // value 225 switch x := m.Value.(type) { 226 case *MetricPoint_Uint64Value: 227 n += proto.SizeVarint(6<<3 | proto.WireVarint) 228 n += proto.SizeVarint(uint64(x.Uint64Value)) 229 case *MetricPoint_DoubleValue: 230 n += proto.SizeVarint(7<<3 | proto.WireFixed64) 231 n += 8 232 case nil: 233 default: 234 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 235 } 236 return n 237} 238 239// IngestRequest is an update to one or more measures. 240type IngestRequest struct { 241 // IdempotencyKey is a random string that should uniquely identify this report. 242 // It should be generated once and used for all retries. The server will use it 243 // to de-duplicate requests. 244 IdempotencyKey string `protobuf:"bytes,1,opt,name=idempotency_key,json=idempotencyKey" json:"idempotency_key,omitempty"` 245 // Reporter contains information to identify the specific originator of this report. 246 Reporter *lightstep_collector.Reporter `protobuf:"bytes,2,opt,name=reporter" json:"reporter,omitempty"` 247 // Points contain the individual updates. 248 Points []*MetricPoint `protobuf:"bytes,3,rep,name=points" json:"points,omitempty"` 249} 250 251func (m *IngestRequest) Reset() { *m = IngestRequest{} } 252func (m *IngestRequest) String() string { return proto.CompactTextString(m) } 253func (*IngestRequest) ProtoMessage() {} 254func (*IngestRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 255 256func (m *IngestRequest) GetIdempotencyKey() string { 257 if m != nil { 258 return m.IdempotencyKey 259 } 260 return "" 261} 262 263func (m *IngestRequest) GetReporter() *lightstep_collector.Reporter { 264 if m != nil { 265 return m.Reporter 266 } 267 return nil 268} 269 270func (m *IngestRequest) GetPoints() []*MetricPoint { 271 if m != nil { 272 return m.Points 273 } 274 return nil 275} 276 277// IngestResponse is reserved for future use. 278type IngestResponse struct { 279} 280 281func (m *IngestResponse) Reset() { *m = IngestResponse{} } 282func (m *IngestResponse) String() string { return proto.CompactTextString(m) } 283func (*IngestResponse) ProtoMessage() {} 284func (*IngestResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 285 286func init() { 287 proto.RegisterType((*MetricPoint)(nil), "lightstep.metrics.MetricPoint") 288 proto.RegisterType((*IngestRequest)(nil), "lightstep.metrics.IngestRequest") 289 proto.RegisterType((*IngestResponse)(nil), "lightstep.metrics.IngestResponse") 290 proto.RegisterEnum("lightstep.metrics.MetricKind", MetricKind_name, MetricKind_value) 291} 292 293// Reference imports to suppress errors if they are not otherwise used. 294var _ context.Context 295var _ grpc.ClientConn 296 297// This is a compile-time assertion to ensure that this generated file 298// is compatible with the grpc package it is being compiled against. 299const _ = grpc.SupportPackageIsVersion4 300 301// Client API for MetricsService service 302 303type MetricsServiceClient interface { 304 Report(ctx context.Context, in *IngestRequest, opts ...grpc.CallOption) (*IngestResponse, error) 305} 306 307type metricsServiceClient struct { 308 cc *grpc.ClientConn 309} 310 311func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient { 312 return &metricsServiceClient{cc} 313} 314 315func (c *metricsServiceClient) Report(ctx context.Context, in *IngestRequest, opts ...grpc.CallOption) (*IngestResponse, error) { 316 out := new(IngestResponse) 317 err := grpc.Invoke(ctx, "/lightstep.metrics.MetricsService/Report", in, out, c.cc, opts...) 318 if err != nil { 319 return nil, err 320 } 321 return out, nil 322} 323 324// Server API for MetricsService service 325 326type MetricsServiceServer interface { 327 Report(context.Context, *IngestRequest) (*IngestResponse, error) 328} 329 330func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) { 331 s.RegisterService(&_MetricsService_serviceDesc, srv) 332} 333 334func _MetricsService_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 335 in := new(IngestRequest) 336 if err := dec(in); err != nil { 337 return nil, err 338 } 339 if interceptor == nil { 340 return srv.(MetricsServiceServer).Report(ctx, in) 341 } 342 info := &grpc.UnaryServerInfo{ 343 Server: srv, 344 FullMethod: "/lightstep.metrics.MetricsService/Report", 345 } 346 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 347 return srv.(MetricsServiceServer).Report(ctx, req.(*IngestRequest)) 348 } 349 return interceptor(ctx, in, info, handler) 350} 351 352var _MetricsService_serviceDesc = grpc.ServiceDesc{ 353 ServiceName: "lightstep.metrics.MetricsService", 354 HandlerType: (*MetricsServiceServer)(nil), 355 Methods: []grpc.MethodDesc{ 356 { 357 MethodName: "Report", 358 Handler: _MetricsService_Report_Handler, 359 }, 360 }, 361 Streams: []grpc.StreamDesc{}, 362 Metadata: "github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto", 363} 364 365func init() { 366 proto.RegisterFile("github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto", fileDescriptor0) 367} 368 369var fileDescriptor0 = []byte{ 370 // 579 bytes of a gzipped FileDescriptorProto 371 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xdf, 0x6e, 0xd3, 0x30, 372 0x14, 0xc6, 0x97, 0xae, 0xed, 0x56, 0x97, 0x95, 0xe2, 0x5d, 0x90, 0x55, 0xb0, 0x85, 0x72, 0x41, 373 0x34, 0x69, 0x09, 0x0c, 0x36, 0x09, 0x24, 0x2e, 0xf6, 0x4f, 0xa3, 0xea, 0x56, 0x26, 0xaf, 0x9b, 374 0x10, 0x37, 0x55, 0x92, 0x1e, 0x32, 0x6b, 0x89, 0x6d, 0x1c, 0x67, 0x52, 0x6f, 0x79, 0x05, 0xde, 375 0x80, 0x5b, 0x1e, 0x07, 0x1e, 0x81, 0x07, 0x41, 0xb5, 0xd3, 0x76, 0x63, 0x0c, 0x89, 0x3b, 0xeb, 376 0x7c, 0xbf, 0xe3, 0x7c, 0xdf, 0x39, 0x31, 0xda, 0x89, 0xa9, 0xba, 0xc8, 0x43, 0x2f, 0xe2, 0xa9, 377 0x9f, 0xd0, 0xf8, 0x42, 0x65, 0x0a, 0xc4, 0xec, 0xb4, 0xa1, 0x64, 0x10, 0x81, 0xdc, 0x88, 0x78, 378 0x9a, 0x72, 0xe6, 0xab, 0x54, 0xc4, 0xc0, 0xfc, 0x14, 0x94, 0xa4, 0x51, 0xe6, 0x09, 0xc9, 0x15, 379 0xc7, 0x0f, 0xa6, 0xb4, 0x57, 0x08, 0xad, 0x0f, 0xff, 0x75, 0x6b, 0xcc, 0x93, 0x80, 0xc5, 0xbe, 380 0xbe, 0x2d, 0xcc, 0x3f, 0xf9, 0x11, 0x4f, 0x12, 0x88, 0x14, 0x97, 0x22, 0x9c, 0x9d, 0xcd, 0xc7, 381 0x5a, 0x8f, 0x62, 0xce, 0xe3, 0x04, 0xfc, 0x40, 0x50, 0x3f, 0x60, 0x8c, 0xab, 0x40, 0x51, 0xce, 382 0x0a, 0x2b, 0xad, 0xd5, 0x42, 0x9d, 0x5e, 0x35, 0xcc, 0xa5, 0x06, 0x0a, 0x7d, 0xed, 0x4f, 0x5d, 383 0xd1, 0x14, 0x32, 0x15, 0xa4, 0xc2, 0x00, 0xed, 0x9f, 0x25, 0x54, 0x3f, 0xd6, 0x21, 0x4e, 0x38, 384 0x65, 0x0a, 0xbf, 0x40, 0xe5, 0x4b, 0xca, 0x86, 0xb6, 0xe5, 0x58, 0x6e, 0x63, 0xf3, 0xb1, 0x77, 385 0x2b, 0xaa, 0x67, 0xe8, 0x2e, 0x65, 0x43, 0xa2, 0x51, 0xbc, 0x86, 0xea, 0x46, 0x1b, 0xb0, 0x20, 386 0x05, 0xbb, 0xe4, 0x58, 0x6e, 0x8d, 0x20, 0x53, 0xea, 0x05, 0x29, 0xe0, 0xe7, 0xa8, 0x92, 0xa9, 387 0x40, 0x2a, 0x7b, 0xde, 0xb1, 0xdc, 0xfa, 0x66, 0xcb, 0x33, 0xa6, 0xbc, 0x89, 0x29, 0xaf, 0x3f, 388 0x31, 0x45, 0x0c, 0x88, 0xb7, 0xd0, 0xe2, 0x24, 0x88, 0x5d, 0xd6, 0x4d, 0x2b, 0xb7, 0x9a, 0xf6, 389 0x0b, 0x80, 0x4c, 0x51, 0xbc, 0x85, 0xaa, 0x49, 0x10, 0x42, 0x92, 0xd9, 0x15, 0x67, 0xde, 0xad, 390 0xdf, 0xb0, 0x3f, 0x9b, 0x6b, 0x17, 0x46, 0xe7, 0x41, 0x92, 0x03, 0x29, 0x60, 0xfc, 0x14, 0xdd, 391 0xcb, 0x29, 0x53, 0xdb, 0xaf, 0x06, 0x57, 0xe3, 0xba, 0x5d, 0x75, 0x2c, 0xb7, 0xfc, 0x6e, 0x8e, 392 0xd4, 0x4d, 0x55, 0xc3, 0x63, 0x68, 0xc8, 0xf3, 0x30, 0x81, 0x02, 0x5a, 0x70, 0x2c, 0xd7, 0x1a, 393 0x43, 0xa6, 0xaa, 0xa1, 0xdd, 0x05, 0x54, 0xd1, 0x6a, 0xfb, 0xbb, 0x85, 0x96, 0x3a, 0x2c, 0x86, 394 0x4c, 0x11, 0xf8, 0x9c, 0x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