how to measure r2dbc response time

60 views
Skip to first unread message

coolxp

unread,
Jul 18, 2023, 6:20:33 AM7/18/23
to r2dbc
hello. i try use Flux#tap to measure response time, but i find it will run all `save` before run SignalListener#doOnNext.

```
MetricListener<Student> setListener = new MetricListener<>(summary, "set");
Flux.range(1, 10)
    .flatMap(id -> repository.save(new Student(id, "lxp")))
    .tap(() -> setListener)
    .subscribe();
```
why it run this way,and it has some way to measure? thanks

Mark Paluch

unread,
Jul 18, 2023, 9:55:24 AM7/18/23
to r2dbc
You might want to have a look at  https://github.com/r2dbc/r2dbc-proxy that allows intercepting R2DBC calls so you can measure how long each interaction lasted.
Reply all
Reply to author
Forward
0 new messages