-
Notifications
You must be signed in to change notification settings - Fork 417
/
payload.go
84 lines (74 loc) · 2.54 KB
/
payload.go
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
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
//go:generate msgp -unexported -marshal=false -o=payload_msgp.go -tests=false
package datastreams
// StatsPayload stores client computed stats.
type StatsPayload struct {
// Env specifies the env. of the application, as defined by the user.
Env string
// Service is the service of the application
Service string
// Stats holds all stats buckets computed within this payload.
Stats []StatsBucket
// TracerVersion is the version of the tracer
TracerVersion string
// Lang is the language of the tracer
Lang string
// Version is the version of the service
Version string
}
type ProduceOffset struct {
Topic string
Partition int32
Offset int64
}
type CommitOffset struct {
ConsumerGroup string
Topic string
Partition int32
Offset int64
}
// Backlog represents the size of a queue that hasn't been yet read by the consumer.
type Backlog struct {
// Tags that identify the backlog
Tags []string
// Value of the backlog
Value int64
}
// StatsBucket specifies a set of stats computed over a duration.
type StatsBucket struct {
// Start specifies the beginning of this bucket in unix nanoseconds.
Start uint64
// Duration specifies the duration of this bucket in nanoseconds.
Duration uint64
// Stats contains a set of statistics computed for the duration of this bucket.
Stats []StatsPoint
// Backlogs store information used to compute queue backlog
Backlogs []Backlog
}
// TimestampType can be either current or origin.
type TimestampType string
const (
// TimestampTypeCurrent is for when the recorded timestamp is based on the
// timestamp of the current StatsPoint.
TimestampTypeCurrent TimestampType = "current"
// TimestampTypeOrigin is for when the recorded timestamp is based on the
// time that the first StatsPoint in the pathway is sent out.
TimestampTypeOrigin TimestampType = "origin"
)
// StatsPoint contains a set of statistics grouped under various aggregation keys.
type StatsPoint struct {
// These fields indicate the properties under which the stats were aggregated.
Service string // deprecated
EdgeTags []string
Hash uint64
ParentHash uint64
// These fields specify the stats for the above aggregation.
// those are distributions of latency in seconds.
PathwayLatency []byte
EdgeLatency []byte
PayloadSize []byte
TimestampType TimestampType
}