-
Notifications
You must be signed in to change notification settings - Fork 12
/
docs.go
168 lines (167 loc) · 5.13 KB
/
docs.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
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
//nolint:gofmt,goimports
//
// Package poplar provides a set of tools for running and managing
// results for benchmarks in go.
//
//
// Tools and Infrastructure
//
// The Report type defines infrastructure that any project can use to
// create and upload test results to a cedar data service regardless
// of the execution model without needing to write client code that
// interacts with cedars RPC protocol.
//
// Additionally, poplar defines some-local only RPC interfaces on top
// of the github.com/mongodb/ftdc and github.com/mongodb/ftdc/events
// packages to support generating data payloads in real time.
//
//
// Report
//
// A Report structure structure, in YAML, would generally resemble the
// following:
//
// project: <evergreen-project>
// version: <evergreen-version>
// variant: <evergreen-buildvariant>
// task_name: <short evergreen task display name>
// task_id: <unique evergreen task_id>
// execution_number: <evergreen execution number>
//
// bucket:
// api_key: <aws api key>
// api_secret: <aws api secret>
// api_tokent: <aws api token>
// region: <aws-region>
//
// name: <bucket name>
// prefix: <key prefix>
//
// tests:
// - info:
// test_name: <local test name>
// trial: <integer for repeated execution>
// tags: [ "canary", <arbitrary>, <string>, <metadata> ]
// arguments:
// count: 1
// iterations: 1000
// # arbitrary test settings
// create_at: <timestamp>
// completed_at: <timestamp>
// artifacts:
// - bucket: <name>
// path: <test>/local_data/client_data.ftdc
// tags: [ "combined", "client" ]
// is_ftdc: true
// events_raw: true
// created_at: <timestamp>
// local_file: path/to/client_data.ftdc
// - bucket: <name>
// path: <test>/local_data/client_data.ftdc
// tags: [ "combined", "server" ]
// is_ftdc: true
// created_at: <timestamp>
// local_file: path/to/server_data.ftdc
// test: [] # subtests with the same test structure
//
// See the documentation of the Report, Test, TestInfo, TestArtifact
// and TestMetrics format for more information.
//
//
// Benchmarks
//
// Poplar contains a toolkit for running benchmark tests and
// collecting rich intra-run data from those tests. Consider the
// following example:
//
// suite := BenchmarkSuite{
// {
// CaseName: "HelloWorld",
// Bench: func(ctx context.Context, r events.Recorder, count int) error {
// out := []string{}
// for i := 0; i < count; i++ {
// startAt := time.Now()
// r.Begin()
// val := "Hello World"
// out = append(out, val)
// r.End(time.Since(startAt))
// r.IncOps(1)
// r.IncSize(len(val))
// }
// return nil
// },
// MinRuntime: 5 * time.Second,
// MaxRuntime: time.Minute,
// MinIterations: 1000000,
// Count: 1000,
// Recorder: poplar.RecorderPerf,
// },
// }
//
// results := suite.Run(ctx, "poplar_raw")
// grip.Info(results.Composer()) // log results.
//
// // Optionally send results to cedar
//
// report := &Report{
// Project: "poplar test",
// Version: "<evg-version>",
// Variant: "arch-linux",
// TaskName: "perf",
// TaskID: "<evg task>",
// BucketConf: BucketConfiguration{
// APIKey: "<key>",
// APISecret: "<secret>",
// APIToken: "token",
// Bucket: "poplarresults",
// Prefix: "perf",
// },
// Tests: results.Export(),
// }
//
//
// var cc *grpc.ClientConn // set up service connection to cedar
// err := rpc.Upload(ctx, report, cc)
// if err != nil {
// grip.EmergencyFatal(err) // exit
// }
//
// You can also run a benchmark suite using go's standard library, as
// in:
//
// registry := NewRegistry() // create recorder recorder infrastructure
//
// func BenchmarkHelloWorldSuite(b *testing.B) {
// suite.Standard(registry)(b)
// }
//
// Each test in the suite is reported as a separate sub-benchmark.
//
//
// Workloads
//
// In addition to suites, workloads provide a way to define
// concurrent and parallel workloads that execute multiple instances
// of a single test at a time. Workloads function like an extended
// case of suites.
//
// workload := &BenchmarkWorkload{
// Name: "HelloWorld",
// Instances: 10,
// Recorder: poplar.RecorderPerf,
// Case: &BenchmarkCase{},
// }
//
// You must specify either a single case or a list of
// sub-workloads. The executors for workloads run the groups of these
// tests in parallel, with the degree of parallelism controlled by the
// Instances value. When you specify a list of sub-workloads, poplar
// will execute a group of these workloads in parallel, but the
// workloads themselves are run sequentially, potentially with their
// own parallelism.
//
// Benchmark suites and workloads both report data in the same
// format. You can also execute workloads using the Standard method,
// as with suites, using default Go methods for running benchmarks.
package poplar
// This file is intentionally documentation only.