-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkinesis_test.go
92 lines (84 loc) · 2.02 KB
/
kinesis_test.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
package kinesis
import (
"log"
"os"
"testing"
"github.com/jaegertracing/jaeger/model"
"go.uber.org/zap"
)
var exp *Exporter
var spans []*model.Span
func setup() error {
options := &Options{
Name: "test",
StreamName: "in_dev_test_tenant",
AWSKinesisEndpoint: "http://0.0.0.0:4567",
AWSRegion: "us-west-2",
ListFlushInterval: 1,
MaxListSize: 1,
/*
QueueSize int
NumWorkers int
MaxListSize int
ListFlushInterval int
KPLAggregateBatchCount int
KPLAggregateBatchSize int
KPLBatchSize int
KPLBatchCount int
KPLBacklogCount int
KPLFlushIntervalSeconds int
KPLMaxConnections int
KPLMaxRetries int
KPLMaxBackoffSeconds int
MaxAllowedSizePerSpan int
*/
}
logger := zap.NewNop()
e, err := NewExporter(options, logger)
if err == nil {
exp = e
}
spans = generateSpans()
return err
}
func TestMain(m *testing.M) {
err := setup()
if err != nil {
log.Fatal(err.Error())
}
code := m.Run()
os.Exit(code)
}
func BenchmarkPuts(b *testing.B) {
span := spans[0]
b.ResetTimer()
for i := 0; i < b.N; i++ {
exp.ExportSpan(span)
}
}
/*
func BenchmarkCompress(b *testing.B) {
pr := producer.New(&producer.Config{
StreamName: "in_dev_test_tenant",
AggregateBatchSize: 1,
AggregateBatchCount: 1,
BatchSize: 1,
BatchCount: 1,
BacklogCount: 1,
MaxConnections: 24,
FlushInterval: time.Second * time.Duration(1),
MaxRetries: 20,
MaxBackoffTime: time.Second * time.Duration(10),
Client: client,
Verbose: false,
}, hooks)
producers = append(producers, &shardProducer{
pr: pr,
shard: shard,
hooks: newKinesisHooksNoop(o.Name, o.StreamName),
maxSize: uint64(o.MaxListSize),
flushInterval: time.Duration(o.ListFlushInterval) * time.Second,
partitionKey: shard.startingHashKey.String(),
})
}
*/