File: metrics.pb.go

package info (click to toggle)
golang-github-lightstep-lightstep-tracer-common 1.1.0%2Bgit20210210.a8dfcb8-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 428 kB
  • sloc: makefile: 68
file content (408 lines) | stat: -rw-r--r-- 15,961 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto

/*
Package metricspb is a generated protocol buffer package.

It is generated from these files:
	github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto

It has these top-level messages:
	MetricPoint
	IngestRequest
	IngestResponse
*/
package metricspb // import "github.com/lightstep/lightstep-tracer-common/golang/protobuf/metricspb"

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import lightstep_collector "github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import google_protobuf2 "github.com/golang/protobuf/ptypes/duration"
import google_protobuf "github.com/golang/protobuf/ptypes/timestamp"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// MetricKind indicates the semantics of the points (i.e. how to interpret values
// relative to each other).
type MetricKind int32

const (
	// InvalidMetricKind is the default value for the MetricKind. Some languages' proto compilers
	// (e.g. Go) return the default if no value is set. The default is marked invalid here to
	// avoid a common mistake where a field is left unset and appears to be set to the default.
	MetricKind_INVALID_METRIC_KIND MetricKind = 0
	// Counter metrics measure change over an interval.
	// When aggregated, counter metrics are usually added.
	MetricKind_COUNTER MetricKind = 1
	// Gauge metrics measure the value at a point in time.
	// When aggregated, intermediate values are often dropped for the latest value.
	MetricKind_GAUGE MetricKind = 2
)

var MetricKind_name = map[int32]string{
	0: "INVALID_METRIC_KIND",
	1: "COUNTER",
	2: "GAUGE",
}
var MetricKind_value = map[string]int32{
	"INVALID_METRIC_KIND": 0,
	"COUNTER":             1,
	"GAUGE":               2,
}

func (x MetricKind) String() string {
	return proto.EnumName(MetricKind_name, int32(x))
}
func (MetricKind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

// MetricPoint is an update to a single measure.
type MetricPoint struct {
	// Kind indicates the semantics of this point. Kind should always be the same for a given metric
	// name (e.g. "cpu.usage" should always have the same kind)
	Kind MetricKind `protobuf:"varint,1,opt,name=kind,enum=lightstep.metrics.MetricKind" json:"kind,omitempty"`
	// MetricName indicates the metric being emitted.
	MetricName string `protobuf:"bytes,2,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"`
	// Start of the interval for which the points represent.
	// - All Counter points will be assumed to represent the entire interval.
	// - All Gauge points will be assumed to be instantaneous at the start of the interval.
	Start *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=start" json:"start,omitempty"`
	// Duration of the interval for which the points represent. The end of the interval is start + duration.
	// We expect this value to be unset or zero for Gauge points.
	Duration *google_protobuf2.Duration `protobuf:"bytes,4,opt,name=duration" json:"duration,omitempty"`
	// Labels contain labels specific to this point.
	Labels []*lightstep_collector.KeyValue `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty"`
	// Value represents the update being emitted. Values can be one of two types: uint64 or double.
	// The type of the value should always be the same for a given metric name (e.g. "cpu.usage"
	// should always have value type double).
	//
	// Types that are valid to be assigned to Value:
	//	*MetricPoint_Uint64Value
	//	*MetricPoint_DoubleValue
	Value isMetricPoint_Value `protobuf_oneof:"value"`
}

func (m *MetricPoint) Reset()                    { *m = MetricPoint{} }
func (m *MetricPoint) String() string            { return proto.CompactTextString(m) }
func (*MetricPoint) ProtoMessage()               {}
func (*MetricPoint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

type isMetricPoint_Value interface {
	isMetricPoint_Value()
}

type MetricPoint_Uint64Value struct {
	Uint64Value uint64 `protobuf:"varint,6,opt,name=uint64_value,json=uint64Value,oneof"`
}
type MetricPoint_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,7,opt,name=double_value,json=doubleValue,oneof"`
}

func (*MetricPoint_Uint64Value) isMetricPoint_Value() {}
func (*MetricPoint_DoubleValue) isMetricPoint_Value() {}

func (m *MetricPoint) GetValue() isMetricPoint_Value {
	if m != nil {
		return m.Value
	}
	return nil
}

func (m *MetricPoint) GetKind() MetricKind {
	if m != nil {
		return m.Kind
	}
	return MetricKind_INVALID_METRIC_KIND
}

func (m *MetricPoint) GetMetricName() string {
	if m != nil {
		return m.MetricName
	}
	return ""
}

func (m *MetricPoint) GetStart() *google_protobuf.Timestamp {
	if m != nil {
		return m.Start
	}
	return nil
}

func (m *MetricPoint) GetDuration() *google_protobuf2.Duration {
	if m != nil {
		return m.Duration
	}
	return nil
}

func (m *MetricPoint) GetLabels() []*lightstep_collector.KeyValue {
	if m != nil {
		return m.Labels
	}
	return nil
}

func (m *MetricPoint) GetUint64Value() uint64 {
	if x, ok := m.GetValue().(*MetricPoint_Uint64Value); ok {
		return x.Uint64Value
	}
	return 0
}

func (m *MetricPoint) GetDoubleValue() float64 {
	if x, ok := m.GetValue().(*MetricPoint_DoubleValue); ok {
		return x.DoubleValue
	}
	return 0
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*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{}) {
	return _MetricPoint_OneofMarshaler, _MetricPoint_OneofUnmarshaler, _MetricPoint_OneofSizer, []interface{}{
		(*MetricPoint_Uint64Value)(nil),
		(*MetricPoint_DoubleValue)(nil),
	}
}

func _MetricPoint_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*MetricPoint)
	// value
	switch x := m.Value.(type) {
	case *MetricPoint_Uint64Value:
		b.EncodeVarint(6<<3 | proto.WireVarint)
		b.EncodeVarint(uint64(x.Uint64Value))
	case *MetricPoint_DoubleValue:
		b.EncodeVarint(7<<3 | proto.WireFixed64)
		b.EncodeFixed64(math.Float64bits(x.DoubleValue))
	case nil:
	default:
		return fmt.Errorf("MetricPoint.Value has unexpected type %T", x)
	}
	return nil
}

func _MetricPoint_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*MetricPoint)
	switch tag {
	case 6: // value.uint64_value
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.Value = &MetricPoint_Uint64Value{x}
		return true, err
	case 7: // value.double_value
		if wire != proto.WireFixed64 {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeFixed64()
		m.Value = &MetricPoint_DoubleValue{math.Float64frombits(x)}
		return true, err
	default:
		return false, nil
	}
}

func _MetricPoint_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*MetricPoint)
	// value
	switch x := m.Value.(type) {
	case *MetricPoint_Uint64Value:
		n += proto.SizeVarint(6<<3 | proto.WireVarint)
		n += proto.SizeVarint(uint64(x.Uint64Value))
	case *MetricPoint_DoubleValue:
		n += proto.SizeVarint(7<<3 | proto.WireFixed64)
		n += 8
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

// IngestRequest is an update to one or more measures.
type IngestRequest struct {
	// IdempotencyKey is a random string that should uniquely identify this report.
	// It should be generated once and used for all retries. The server will use it
	// to de-duplicate requests.
	IdempotencyKey string `protobuf:"bytes,1,opt,name=idempotency_key,json=idempotencyKey" json:"idempotency_key,omitempty"`
	// Reporter contains information to identify the specific originator of this report.
	Reporter *lightstep_collector.Reporter `protobuf:"bytes,2,opt,name=reporter" json:"reporter,omitempty"`
	// Points contain the individual updates.
	Points []*MetricPoint `protobuf:"bytes,3,rep,name=points" json:"points,omitempty"`
}

func (m *IngestRequest) Reset()                    { *m = IngestRequest{} }
func (m *IngestRequest) String() string            { return proto.CompactTextString(m) }
func (*IngestRequest) ProtoMessage()               {}
func (*IngestRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

func (m *IngestRequest) GetIdempotencyKey() string {
	if m != nil {
		return m.IdempotencyKey
	}
	return ""
}

func (m *IngestRequest) GetReporter() *lightstep_collector.Reporter {
	if m != nil {
		return m.Reporter
	}
	return nil
}

func (m *IngestRequest) GetPoints() []*MetricPoint {
	if m != nil {
		return m.Points
	}
	return nil
}

// IngestResponse is reserved for future use.
type IngestResponse struct {
}

func (m *IngestResponse) Reset()                    { *m = IngestResponse{} }
func (m *IngestResponse) String() string            { return proto.CompactTextString(m) }
func (*IngestResponse) ProtoMessage()               {}
func (*IngestResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

func init() {
	proto.RegisterType((*MetricPoint)(nil), "lightstep.metrics.MetricPoint")
	proto.RegisterType((*IngestRequest)(nil), "lightstep.metrics.IngestRequest")
	proto.RegisterType((*IngestResponse)(nil), "lightstep.metrics.IngestResponse")
	proto.RegisterEnum("lightstep.metrics.MetricKind", MetricKind_name, MetricKind_value)
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// Client API for MetricsService service

type MetricsServiceClient interface {
	Report(ctx context.Context, in *IngestRequest, opts ...grpc.CallOption) (*IngestResponse, error)
}

type metricsServiceClient struct {
	cc *grpc.ClientConn
}

func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient {
	return &metricsServiceClient{cc}
}

func (c *metricsServiceClient) Report(ctx context.Context, in *IngestRequest, opts ...grpc.CallOption) (*IngestResponse, error) {
	out := new(IngestResponse)
	err := grpc.Invoke(ctx, "/lightstep.metrics.MetricsService/Report", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for MetricsService service

type MetricsServiceServer interface {
	Report(context.Context, *IngestRequest) (*IngestResponse, error)
}

func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
	s.RegisterService(&_MetricsService_serviceDesc, srv)
}

func _MetricsService_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IngestRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MetricsServiceServer).Report(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/lightstep.metrics.MetricsService/Report",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MetricsServiceServer).Report(ctx, req.(*IngestRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _MetricsService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "lightstep.metrics.MetricsService",
	HandlerType: (*MetricsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Report",
			Handler:    _MetricsService_Report_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto",
}

func init() {
	proto.RegisterFile("github.com/lightstep/lightstep-tracer-common/tmpgen/metrics.proto", fileDescriptor0)
}

var fileDescriptor0 = []byte{
	// 579 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xdf, 0x6e, 0xd3, 0x30,
	0x14, 0xc6, 0x97, 0xae, 0xed, 0x56, 0x97, 0x95, 0xe2, 0x5d, 0x90, 0x55, 0xb0, 0x85, 0x72, 0x41,
	0x34, 0x69, 0x09, 0x0c, 0x36, 0x09, 0x24, 0x2e, 0xf6, 0x4f, 0xa3, 0xea, 0x56, 0x26, 0xaf, 0x9b,
	0x10, 0x37, 0x55, 0x92, 0x1e, 0x32, 0x6b, 0x89, 0x6d, 0x1c, 0x67, 0x52, 0x6f, 0x79, 0x05, 0xde,
	0x80, 0x5b, 0x1e, 0x07, 0x1e, 0x81, 0x07, 0x41, 0xb5, 0xd3, 0x76, 0x63, 0x0c, 0x89, 0x3b, 0xeb,
	0x7c, 0xbf, 0xe3, 0x7c, 0xdf, 0x39, 0x31, 0xda, 0x89, 0xa9, 0xba, 0xc8, 0x43, 0x2f, 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