File tree Expand file tree Collapse file tree 3 files changed +1
-53
lines changed
Expand file tree Collapse file tree 3 files changed +1
-53
lines changed Original file line number Diff line number Diff line change 22#define _COLLECTOR_STATS_EXPORTER_H_
33
44#include < memory>
5- #include < utility>
65
76#include " CollectorConfig.h"
87#include " CollectorStats.h"
@@ -14,32 +13,6 @@ namespace collector {
1413
1514class CollectorStatsExporter {
1615 public:
17- CollectorStatsExporter () = default ;
18- CollectorStatsExporter (const CollectorStatsExporter&) = delete ;
19- CollectorStatsExporter (CollectorStatsExporter&&) = delete ;
20- CollectorStatsExporter& operator =(const CollectorStatsExporter&) = delete ;
21- ~CollectorStatsExporter () = default ;
22-
23- CollectorStatsExporter& operator =(CollectorStatsExporter&& other) noexcept {
24- auto swap_running = other.thread_ .running ();
25-
26- if (swap_running) {
27- other.stop ();
28- }
29-
30- registry_.swap (other.registry_ );
31- std::swap (config_, other.config_ );
32- std::swap (system_inspector_, other.system_inspector_ );
33- connections_total_reporter_.swap (other.connections_total_reporter_ );
34- connections_rate_reporter_.swap (other.connections_rate_reporter_ );
35-
36- if (swap_running) {
37- start ();
38- }
39-
40- return *this ;
41- }
42-
4316 CollectorStatsExporter (std::shared_ptr<prometheus::Registry> registry, const CollectorConfig* config, system_inspector::Service* si);
4417
4518 bool start ();
Original file line number Diff line number Diff line change 3333
3434namespace collector ::system_inspector {
3535
36- Service::Service () = default ;
3736Service::~Service () = default ;
38- Service& Service::operator =(Service&& other) noexcept {
39- {
40- auto other_sinsp_lock = std::lock_guard<std::mutex>(other.libsinsp_mutex_ );
41- auto this_sinsp_lock = std::lock_guard<std::mutex>(libsinsp_mutex_);
42-
43- inspector_.swap (other.inspector_ );
44- container_metadata_inspector_.swap (other.container_metadata_inspector_ );
45- default_formatter_.swap (other.default_formatter_ );
46- }
47-
48- signal_handlers_.swap (other.signal_handlers_ );
49-
50- userspace_stats_ = other.userspace_stats_ ;
51- global_event_filter_ = other.global_event_filter_ ;
52-
53- {
54- auto other_running_lock = std::lock_guard<std::mutex>(other.running_mutex_ );
55- auto this_running_lock = std::lock_guard<std::mutex>(running_mutex_);
56- std::swap (running_, other.running_ );
57- }
58-
59- return *this ;
60- }
6137
6238Service::Service (const CollectorConfig& config, CollectorOutput* client)
6339 : inspector_(std::make_unique<sinsp>(true )),
Original file line number Diff line number Diff line change @@ -24,11 +24,10 @@ namespace collector::system_inspector {
2424
2525class Service : public SystemInspector {
2626 public:
27- Service ();
2827 Service (const Service&) = delete ;
2928 Service (Service&&) = delete ;
3029 Service& operator =(const Service&) = delete ;
31- Service& operator =(Service&&) noexcept ;
30+ Service& operator =(Service&&) = delete ;
3231 ~Service () override ;
3332
3433 Service (const CollectorConfig& config, CollectorOutput* client);
You can’t perform that action at this time.
0 commit comments