File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 7
7
#include < absl/container/flat_hash_map.h>
8
8
#include < absl/strings/match.h>
9
9
#include < absl/strings/str_cat.h>
10
+ #include < absl/time/time.h>
10
11
#include < mimalloc.h>
11
12
12
- #include < chrono>
13
13
#include < numeric>
14
14
#include < variant>
15
15
@@ -323,26 +323,24 @@ thread_local vector<Connection::PipelineMessagePtr> Connection::pipeline_req_poo
323
323
class PipelineCacheSizeTracker {
324
324
public:
325
325
bool CheckAndUpdateWatermark (size_t pipeline_sz) {
326
- const auto now = Clock::now ();
326
+ const auto now = absl::Now ();
327
327
const auto elapsed = now - last_check_;
328
328
min_ = std::min (min_, pipeline_sz);
329
- if (elapsed < std::chrono::milliseconds (10 )) {
329
+ if (elapsed < absl::Milliseconds (10 )) {
330
330
return false ;
331
331
}
332
332
333
333
const bool watermark_reached = (min_ > 0 );
334
334
min_ = Limits::max ();
335
- last_check_ = Clock::now ();
335
+ last_check_ = absl::Now ();
336
336
337
337
return watermark_reached;
338
338
}
339
339
340
340
private:
341
- using Tp = std::chrono::time_point<std::chrono::system_clock>;
342
- using Clock = std::chrono::system_clock;
343
341
using Limits = std::numeric_limits<size_t >;
344
342
345
- Tp last_check_ = Clock::now ();
343
+ absl::Time last_check_ = absl::Now ();
346
344
size_t min_ = Limits::max();
347
345
};
348
346
You can’t perform that action at this time.
0 commit comments