File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ fn criterion_benchmark(c: &mut Criterion) {
10
10
let server = TestLoglogd :: new ( ) . unwrap ( ) ;
11
11
12
12
let entries = [
13
- [ 1u8 , 2u8 , 3u8 ] . as_slice ( ) ,
14
- [ 1u8 ; 10000 ] . as_slice ( ) ,
15
- [ 1u8 ; 100000 ] . as_slice ( ) ,
13
+ [ 1u8 ] . as_slice ( ) ,
14
+ [ 2u8 ; 1000 ] . as_slice ( ) ,
15
+ [ 3u8 ; 100000 ] . as_slice ( ) ,
16
16
] ;
17
17
18
18
let mut client = server. new_client ( ) . unwrap ( ) ;
@@ -41,6 +41,8 @@ fn criterion_benchmark(c: &mut Criterion) {
41
41
write_commit. finish ( ) ;
42
42
}
43
43
{
44
+ // new client to ignore the previous entries
45
+ let mut client = server. new_client ( ) . unwrap ( ) ;
44
46
let mut roundtrip = c. benchmark_group ( "roundtrip" ) ;
45
47
for entry in entries {
46
48
roundtrip. throughput ( criterion:: Throughput :: Bytes ( u64:: expect_from ( entry. len ( ) ) ) ) ;
@@ -50,7 +52,8 @@ fn criterion_benchmark(c: &mut Criterion) {
50
52
|b, entry| {
51
53
b. iter ( || {
52
54
client. append_nocommit ( entry) . unwrap ( ) ;
53
- client. read ( ) . unwrap ( ) ;
55
+ let read = client. read ( ) . unwrap ( ) ;
56
+ assert_eq ! ( entry. len( ) , read. len( ) ) ;
54
57
} )
55
58
} ,
56
59
) ;
You can’t perform that action at this time.
0 commit comments