Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Jun 7, 2024
1 parent e1f5e06 commit 8aa8fd0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 1 addition & 8 deletions include/cinatra/ylt/coro_io/io_context_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <pthread.h>
#include <sched.h>
#endif
#include "ylt/metric/counter.hpp"

namespace coro_io {

Expand Down Expand Up @@ -121,12 +120,6 @@ class io_context_pool {

total_thread_num_ += pool_size;

static auto counter =
ylt::default_metric_manger::create_metric_static<ylt::counter_t>(
"server_total_thread_num", "");
if (counter)
counter->inc(total_thread_num_);

for (std::size_t i = 0; i < pool_size; ++i) {
io_context_ptr io_context(new asio::io_context(1));
work_ptr work(new asio::io_context::work(*io_context));
Expand Down Expand Up @@ -228,7 +221,7 @@ class io_context_pool {
std::atomic<bool> has_run_or_stop_ = false;
std::once_flag flag_;
bool cpu_affinity_ = false;
inline static size_t total_thread_num_ = 0;
inline static std::atomic<size_t> total_thread_num_ = 0;
};

inline size_t get_total_thread_num() {
Expand Down
1 change: 0 additions & 1 deletion lang/how_to_use_metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ server_total_recv_bytes:server总共收到的字节数;
server_total_send_bytes:server总共发送的字节数;
server_req_latency:http 请求的延迟,从收到请求到发送响应的时间间隔
server_read_latency:http 读请求的延迟,读到完整的http数据的时间间隔
server_total_thread_num:server内置的总线程数
```

```cpp
Expand Down

0 comments on commit 8aa8fd0

Please sign in to comment.