2016-02-09 23:12:00 +00:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2015-06-02 09:07:58 +00:00
|
|
|
// 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.
|
2017-04-28 00:50:56 +00:00
|
|
|
// This source code is also licensed under the GPLv2 license found in the
|
|
|
|
// COPYING file in the root directory of this source tree.
|
2015-06-02 09:07:58 +00:00
|
|
|
//
|
|
|
|
|
2016-06-01 16:07:09 +00:00
|
|
|
#include <assert.h>
|
2015-06-02 09:07:58 +00:00
|
|
|
#include <sstream>
|
2017-04-06 02:02:00 +00:00
|
|
|
#include "monitoring/perf_level_imp.h"
|
2015-07-01 23:13:49 +00:00
|
|
|
#include "port/port.h"
|
2015-06-02 09:07:58 +00:00
|
|
|
|
|
|
|
namespace rocksdb {
|
|
|
|
|
|
|
|
#if defined(IOS_CROSS_COMPILE)
|
|
|
|
PerfLevel perf_level = kEnableCount;
|
|
|
|
#else
|
|
|
|
__thread PerfLevel perf_level = kEnableCount;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void SetPerfLevel(PerfLevel level) {
|
2016-06-01 16:07:09 +00:00
|
|
|
assert(level > kUninitialized);
|
|
|
|
assert(level < kOutOfBounds);
|
2015-06-02 09:07:58 +00:00
|
|
|
perf_level = level;
|
|
|
|
}
|
|
|
|
|
|
|
|
PerfLevel GetPerfLevel() {
|
|
|
|
return perf_level;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace rocksdb
|