File tree Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ go 1.24.2
5
5
toolchain go1.24.4
6
6
7
7
require (
8
- github.com/kelindar/async v1.3.0
8
+ github.com/kelindar/async v1.3.1
9
9
github.com/kelindar/s3 v0.0.3
10
10
github.com/klauspost/compress v1.18.0
11
11
github.com/stretchr/testify v1.10.0
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ github.com/RoaringBitmap/roaring v0.6.1 h1:O36Tdaj1Fi/zyr25shTHwlQPGdq53+u4WkM08
2
2
github.com/RoaringBitmap/roaring v0.6.1 /go.mod h1:WZ83fjBF/7uBHi6QoFyfGL4+xuV4Qn+xFkm4+vSzrhE =
3
3
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
4
4
github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
5
- github.com/kelindar/async v1.3.0 h1:mPBTJ/eXCKE+HHKfY1r68Wjo1KjSyArajlsipcSajEY =
6
- github.com/kelindar/async v1.3.0 /go.mod h1:gaCq2zl7zDKjlPY05R45l/0hHgVkJxsfjR3X7sxxvDg =
5
+ github.com/kelindar/async v1.3.1 h1:UL+s/40S/ikNxBkAiqLmtfgcrHxVdk2mvzYneJxc7Xg =
6
+ github.com/kelindar/async v1.3.1 /go.mod h1:gaCq2zl7zDKjlPY05R45l/0hHgVkJxsfjR3X7sxxvDg =
7
7
github.com/kelindar/s3 v0.0.3 h1:izXVdKkH7faO1vM+qQ1zSA9Y6L/8C8p2CkF/FIrnUa0 =
8
8
github.com/kelindar/s3 v0.0.3 /go.mod h1:O2/uN3efPfCUVNmNPHNBY242Bm7LIu+RHQ7bDU5iUXs =
9
9
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo =
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ type Service struct {
52
52
metaLRU * cache.LRU [string , * codec.Metadata ]
53
53
commands chan command
54
54
jobs chan async.Task [iter.Seq [codec.LogEntry ]]
55
- consumer async.Task [iter. Seq [codec. LogEntry ]]
55
+ consumer async.Awaiter
56
56
wg sync.WaitGroup
57
57
cancel context.CancelFunc
58
58
closed int32 // atomic flag
@@ -161,7 +161,7 @@ func (l *Service) Close() error {
161
161
162
162
// Stop worker pool
163
163
close (l .jobs )
164
- l .consumer .Outcome ()
164
+ l .consumer .Wait ()
165
165
166
166
// Signal the run loop to exit and wait for it to finish
167
167
close (l .commands )
Original file line number Diff line number Diff line change @@ -27,18 +27,16 @@ func BenchmarkLog(b *testing.B) {
27
27
28
28
count := 0
29
29
start := time .Now ()
30
- for time .Now (). Sub (start ) < time .Second {
30
+ for time .Since (start ) < time .Second {
31
31
const interval = 50 * time .Millisecond
32
- for i := time .Now (); time .Now (). Sub (i ) < interval ; {
32
+ for i := time .Now (); time .Since (i ) < interval ; {
33
33
logger .Log ("hello world" , 1 )
34
34
count ++
35
35
}
36
36
37
37
logger .flush ()
38
38
}
39
-
40
- b .N = count
41
- b .ReportMetric (float64 (count )/ time .Now ().Sub (start ).Seconds (), "tps" )
39
+ b .ReportMetric (float64 (count )/ time .Since (start ).Seconds (), "tps" )
42
40
}
43
41
44
42
/*
@@ -60,18 +58,17 @@ func BenchmarkQuery(b *testing.B) {
60
58
b .ResetTimer ()
61
59
count := 0
62
60
start := time .Now ()
63
- for time .Now (). Sub (start ) < time .Second {
61
+ for time .Since (start ) < time .Second {
64
62
const interval = 50 * time .Millisecond
65
- for i := time .Now (); time .Now (). Sub (i ) < interval ; {
63
+ for i := time .Now (); time .Since (i ) < interval ; {
66
64
for range logger .Query (time .Now ().Add (- 1 * time .Hour ), time .Now ().Add (1 * time .Hour ), 1 ) {
67
65
// Consume the iterator
68
66
}
69
67
count ++
70
68
}
71
69
}
72
70
73
- b .N = count
74
- b .ReportMetric (float64 (count )/ time .Now ().Sub (start ).Seconds (), "qps" )
71
+ b .ReportMetric (float64 (count )/ time .Since (start ).Seconds (), "qps" )
75
72
}
76
73
77
74
func TestIntegration (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments