Merge pull request #4578 from dlambrig/knob

add SYSTEM_MONITOR_FREQUENCY knob.
This commit is contained in:
Dan Lambright 2021-03-26 13:52:29 -04:00 committed by GitHub
commit 244c537bc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -492,6 +492,7 @@ void ServerKnobs::initialize(bool randomize, ClientKnobs* clientKnobs, bool isSi
init( MAX_REBOOT_TIME, 5.0 ); if( longReboots ) MAX_REBOOT_TIME = 20.0; init( MAX_REBOOT_TIME, 5.0 ); if( longReboots ) MAX_REBOOT_TIME = 20.0;
init( LOG_DIRECTORY, "."); // Will be set to the command line flag. init( LOG_DIRECTORY, "."); // Will be set to the command line flag.
init( SERVER_MEM_LIMIT, 8LL << 30 ); init( SERVER_MEM_LIMIT, 8LL << 30 );
init( SYSTEM_MONITOR_FREQUENCY, 5.0 );
//Ratekeeper //Ratekeeper
bool slowRatekeeper = randomize && BUGGIFY; bool slowRatekeeper = randomize && BUGGIFY;

View File

@ -416,6 +416,7 @@ public:
double MAX_REBOOT_TIME; double MAX_REBOOT_TIME;
std::string LOG_DIRECTORY; std::string LOG_DIRECTORY;
int64_t SERVER_MEM_LIMIT; int64_t SERVER_MEM_LIMIT;
double SYSTEM_MONITOR_FREQUENCY;
// Ratekeeper // Ratekeeper
double SMOOTHING_AMOUNT; double SMOOTHING_AMOUNT;

View File

@ -464,7 +464,7 @@ Future<Void> startSystemMonitor(std::string dataFolder,
SystemMonitorMachineState(dataFolder, dcId, zoneId, machineId, g_network->getLocalAddress().ip)); SystemMonitorMachineState(dataFolder, dcId, zoneId, machineId, g_network->getLocalAddress().ip));
systemMonitor(); systemMonitor();
return recurring(&systemMonitor, 5.0, TaskPriority::FlushTrace); return recurring(&systemMonitor, SERVER_KNOBS->SYSTEM_MONITOR_FREQUENCY, TaskPriority::FlushTrace);
} }
void testIndexedSet(); void testIndexedSet();