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 2
2
#define _COLLECTOR_STATS_EXPORTER_H_
3
3
4
4
#include < memory>
5
- #include < utility>
6
5
7
6
#include " CollectorConfig.h"
8
7
#include " CollectorStats.h"
@@ -14,32 +13,6 @@ namespace collector {
14
13
15
14
class CollectorStatsExporter {
16
15
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
-
43
16
CollectorStatsExporter (std::shared_ptr<prometheus::Registry> registry, const CollectorConfig* config, system_inspector::Service* si);
44
17
45
18
bool start ();
Original file line number Diff line number Diff line change 33
33
34
34
namespace collector ::system_inspector {
35
35
36
- Service::Service () = default ;
37
36
Service::~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
- }
61
37
62
38
Service::Service (const CollectorConfig& config, CollectorOutput* client)
63
39
: inspector_(std::make_unique<sinsp>(true )),
Original file line number Diff line number Diff line change @@ -24,11 +24,10 @@ namespace collector::system_inspector {
24
24
25
25
class Service : public SystemInspector {
26
26
public:
27
- Service ();
28
27
Service (const Service&) = delete ;
29
28
Service (Service&&) = delete ;
30
29
Service& operator =(const Service&) = delete ;
31
- Service& operator =(Service&&) noexcept ;
30
+ Service& operator =(Service&&) = delete ;
32
31
~Service () override ;
33
32
34
33
Service (const CollectorConfig& config, CollectorOutput* client);
You can’t perform that action at this time.
0 commit comments