From 11e0487130d20e82261fff56a0807ccb33dc471e Mon Sep 17 00:00:00 2001 From: superjom Date: Mon, 18 Dec 2017 10:37:41 +0800 Subject: [PATCH] fix service name --- visualdl/logic/im.h | 4 +++- visualdl/storage/storage.cc | 6 +++--- visualdl/storage/storage.h | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/visualdl/logic/im.h b/visualdl/logic/im.h index f32cbc21..abbbc989 100644 --- a/visualdl/logic/im.h +++ b/visualdl/logic/im.h @@ -40,7 +40,7 @@ public: void MaintainWrite(const std::string &dir, int msecs) { dynamic_cast(storage_.get()) - ->StartWriteSerice(dir, msecs, &lock_); + ->StartWriteService(dir, msecs, &lock_); } /* @@ -77,6 +77,8 @@ public: private: // read write lock for protobuf in memory + // TODO(ChunweiYan) mutex too heavy here, might change to a message queue to + // reduce the frequency of visiting disk std::mutex lock_; std::unique_ptr storage_; cc::PeriodExector executor_; diff --git a/visualdl/storage/storage.cc b/visualdl/storage/storage.cc index d5b54166..b29b0ceb 100644 --- a/visualdl/storage/storage.cc +++ b/visualdl/storage/storage.cc @@ -91,9 +91,9 @@ void MemoryStorage::StartReadService(const std::string &dir, (*executor_)(std::move(task), msecs); } -void MemoryStorage::StartWriteSerice(const std::string &dir, - int msecs, - std::mutex *handler) { +void MemoryStorage::StartWriteService(const std::string &dir, + int msecs, + std::mutex *handler) { CHECK(executor_ != nullptr); CHECK(!dir.empty()) << "dir should be set first"; storage_.set_dir(dir); diff --git a/visualdl/storage/storage.h b/visualdl/storage/storage.h index 31b9ab4c..3b59e500 100644 --- a/visualdl/storage/storage.h +++ b/visualdl/storage/storage.h @@ -105,7 +105,9 @@ public: * * msecs: how many millisecond to sync memory and disk. */ - void StartWriteSerice(const std::string &dir, int msecs, std::mutex *handler); + void StartWriteService(const std::string &dir, + int msecs, + std::mutex *handler); private: std::map tablets_; -- GitLab