mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
monitor number of times osquery starts (#5171)
This commit is contained in:
parent
2cfaf8aa94
commit
f903ec02bc
@ -31,6 +31,10 @@ class Killswitch : private boost::noncopyable {
|
||||
public:
|
||||
virtual ~Killswitch();
|
||||
|
||||
// Author: @guliashvili
|
||||
// Creation Time: 3/09/2018
|
||||
bool isAppStartMonitorEnabled();
|
||||
|
||||
// Author: @guliashvili
|
||||
// Creation Time: 3/09/2018
|
||||
bool isExecutingQueryMonitorEnabled();
|
||||
|
@ -699,6 +699,10 @@ void Initializer::start() const {
|
||||
FLAGS_numeric_monitoring_plugins);
|
||||
}
|
||||
|
||||
if (Killswitch::get().isAppStartMonitorEnabled()) {
|
||||
monitoring::record("osquery.start", 1, monitoring::PreAggregationType::Sum);
|
||||
}
|
||||
|
||||
// Start event threads.
|
||||
osquery::attachEvents();
|
||||
EventFactory::delay();
|
||||
|
@ -32,6 +32,10 @@ FLAG(string,
|
||||
Killswitch::Killswitch() {}
|
||||
Killswitch::~Killswitch() = default;
|
||||
|
||||
bool Killswitch::isAppStartMonitorEnabled() {
|
||||
return isNewCodeEnabled("appStartMonitorSwitch");
|
||||
}
|
||||
|
||||
bool Killswitch::isExecutingQueryMonitorEnabled() {
|
||||
return isNewCodeEnabled("executingQueryMonitorSwitch");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user