osquery-1/osquery/main/benchmarks.cpp

55 lines
1.2 KiB
C++
Raw Normal View History

2015-07-23 23:42:46 +00:00
/*
* Copyright (c) 2014-present, Facebook, Inc.
2015-07-23 23:42:46 +00:00
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <benchmark/benchmark.h>
2016-12-03 20:36:55 +00:00
#include <osquery/flags.h>
#include <osquery/logger.h>
#include "osquery/tests/test_util.h"
2015-07-23 23:42:46 +00:00
2016-12-03 20:36:55 +00:00
namespace osquery {
class NoneLoggerPlugin : public LoggerPlugin {
public:
Status setUp() override {
return Status(0);
}
Status logString(const std::string& s) override {
return Status(0);
}
Status logStatus(const std::vector<StatusLogLine>& log) override {
return Status(0);
}
void init(const std::string& name,
const std::vector<StatusLogLine>& log) override {}
};
REGISTER(NoneLoggerPlugin, "logger", "none");
DECLARE_string(logger_plugin);
}
int main(int argc, char *argv[]) {
2016-12-03 20:36:55 +00:00
osquery::FLAGS_logger_plugin = "none";
2015-07-23 23:42:46 +00:00
osquery::initTesting();
2016-12-03 20:36:55 +00:00
// Optionally enable Goggle Logging
google::InitGoogleLogging(argv[0]);
2015-07-23 23:42:46 +00:00
::benchmark::Initialize(&argc, argv);
::benchmark::RunSpecifiedBenchmarks();
return 0;
}