From f345b5ef32fb234b4afdba609ea6bb2c2c7aa8dc Mon Sep 17 00:00:00 2001 From: PengFei Li Date: Thu, 26 Dec 2024 15:09:05 +0800 Subject: [PATCH] Add io stat for StarletOutputStream Signed-off-by: PengFei Li --- be/src/fs/fs_starlet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/be/src/fs/fs_starlet.cpp b/be/src/fs/fs_starlet.cpp index c02c392fc2e42..d6e7a8c8af4f7 100644 --- a/be/src/fs/fs_starlet.cpp +++ b/be/src/fs/fs_starlet.cpp @@ -39,6 +39,7 @@ #include "io/throttled_seekable_input_stream.h" #include "service/staros_worker.h" #include "storage/olap_common.h" +#include "util/defer_op.h" #include "util/stopwatch.hpp" #include "util/string_parser.hpp" @@ -249,6 +250,9 @@ class StarletOutputStream : public starrocks::io::OutputStream { } Status close() override { + MonotonicStopWatch watch; + watch.start(); + DeferOp defer([&]() { IOProfiler::add_sync(watch.elapsed_time()); }); auto stream_st = _file_ptr->stream(); if (!stream_st.ok()) { return to_status(stream_st.status());