-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathevent_publishers_config.h
More file actions
54 lines (41 loc) · 1.83 KB
/
Copy pathevent_publishers_config.h
File metadata and controls
54 lines (41 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <cstddef>
#include "kv_cache_manager/common/jsonizable.h"
namespace kv_cache_manager {
class LogEventPublisherConfig : public Jsonizable {
public:
bool FromRapidValue(const rapidjson::Value &rapid_value) override;
void ToRapidWriter(rapidjson::Writer<rapidjson::StringBuffer> &writer) const noexcept override;
bool enable() const { return enable_; }
std::size_t queue_size() const { return queue_size_; }
private:
bool enable_ = true;
std::size_t queue_size_ = 10000;
};
class OptimizerEventPublisherConfig : public Jsonizable {
public:
bool FromRapidValue(const rapidjson::Value &rapid_value) override;
void ToRapidWriter(rapidjson::Writer<rapidjson::StringBuffer> &writer) const noexcept override;
bool enable() const { return enable_; }
std::size_t queue_size() const { return queue_size_; }
std::size_t max_subscribers() const { return max_subscribers_; }
std::size_t subscriber_queue_size() const { return subscriber_queue_size_; }
private:
bool enable_ = false;
std::size_t queue_size_ = 100000;
std::size_t max_subscribers_ = 4;
std::size_t subscriber_queue_size_ = 10000;
};
class EventPublishersConfig : public Jsonizable {
public:
bool FromRapidValue(const rapidjson::Value &rapid_value) override;
void ToRapidWriter(rapidjson::Writer<rapidjson::StringBuffer> &writer) const noexcept override;
bool enable_log_event_publisher() const { return log_.enable(); }
const LogEventPublisherConfig &log_event_publisher_config() const { return log_; }
bool enable_optimizer_event_publisher() const { return optimizer_.enable(); }
const OptimizerEventPublisherConfig &optimizer_event_publisher_config() const { return optimizer_; }
private:
LogEventPublisherConfig log_;
OptimizerEventPublisherConfig optimizer_;
};
} // namespace kv_cache_manager