Trace data hall id in MachineMetrics events
This commit is contained in:
parent
114eb4a3a6
commit
5a1a969343
|
@ -509,9 +509,10 @@ void skipListTest();
|
|||
Future<Void> startSystemMonitor(std::string dataFolder,
|
||||
Optional<Standalone<StringRef>> dcId,
|
||||
Optional<Standalone<StringRef>> zoneId,
|
||||
Optional<Standalone<StringRef>> machineId) {
|
||||
Optional<Standalone<StringRef>> machineId,
|
||||
Optional<Standalone<StringRef>> datahallId) {
|
||||
initializeSystemMonitorMachineState(SystemMonitorMachineState(
|
||||
dataFolder, dcId, zoneId, machineId, g_network->getLocalAddress().ip, FDB_VT_VERSION));
|
||||
dataFolder, dcId, zoneId, machineId, datahallId, g_network->getLocalAddress().ip, FDB_VT_VERSION));
|
||||
|
||||
systemMonitor();
|
||||
return recurring(&systemMonitor, SERVER_KNOBS->SYSTEM_MONITOR_FREQUENCY, TaskPriority::FlushTrace);
|
||||
|
@ -2337,14 +2338,16 @@ int main(int argc, char* argv[]) {
|
|||
} else if (role == ServerRole::Test) {
|
||||
TraceEvent("NonSimulationTest").detail("TestFile", opts.testFile);
|
||||
setupRunLoopProfiler();
|
||||
auto m = startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId);
|
||||
auto m =
|
||||
startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId, opts.localities.dataHallId());
|
||||
f = stopAfter(runTests(
|
||||
opts.connectionFile, TEST_TYPE_FROM_FILE, TEST_HERE, 1, opts.testFile, StringRef(), opts.localities));
|
||||
g_network->run();
|
||||
} else if (role == ServerRole::ConsistencyCheck) {
|
||||
setupRunLoopProfiler();
|
||||
|
||||
auto m = startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId);
|
||||
auto m =
|
||||
startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId, opts.localities.dataHallId());
|
||||
f = stopAfter(runTests(opts.connectionFile,
|
||||
TEST_TYPE_CONSISTENCY_CHECK,
|
||||
TEST_HERE,
|
||||
|
@ -2355,7 +2358,8 @@ int main(int argc, char* argv[]) {
|
|||
g_network->run();
|
||||
} else if (role == ServerRole::UnitTests) {
|
||||
setupRunLoopProfiler();
|
||||
auto m = startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId);
|
||||
auto m =
|
||||
startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId, opts.localities.dataHallId());
|
||||
f = stopAfter(runTests(opts.connectionFile,
|
||||
TEST_TYPE_UNIT_TESTS,
|
||||
TEST_HERE,
|
||||
|
@ -2400,7 +2404,8 @@ int main(int argc, char* argv[]) {
|
|||
// create the trace file with the correct process address
|
||||
openTraceFile(
|
||||
g_network->getLocalAddress(), opts.rollsize, opts.maxLogsSize, opts.logFolder, "trace", opts.logGroup);
|
||||
auto m = startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId);
|
||||
auto m =
|
||||
startSystemMonitor(opts.dataFolder, opts.dcId, opts.zoneId, opts.zoneId, opts.localities.dataHallId());
|
||||
TraceEvent(SevDebug, "StartingFlowProcess").detail("FlowProcessName", opts.flowProcessName);
|
||||
#if defined(__linux__)
|
||||
prctl(PR_SET_PDEATHSIG, SIGTERM);
|
||||
|
|
|
@ -1836,6 +1836,7 @@ ACTOR Future<Void> workerServer(Reference<IClusterConnectionRecord> connRecord,
|
|||
locality.dcId(),
|
||||
locality.zoneId(),
|
||||
locality.machineId(),
|
||||
locality.dataHallId(),
|
||||
g_network->getLocalAddress().ip,
|
||||
FDB_VT_VERSION));
|
||||
|
||||
|
|
|
@ -329,6 +329,7 @@ SystemStatistics customSystemMonitor(std::string const& eventName, StatisticsSta
|
|||
.detail("DCID", machineState.dcId)
|
||||
.detail("ZoneID", machineState.zoneId)
|
||||
.detail("MachineID", machineState.machineId)
|
||||
.detail("DatahallID", machineState.datahallId)
|
||||
.trackLatest("MachineMetrics");
|
||||
#ifdef __linux__
|
||||
for (const auto& [k, v] : linux_os::reportCGroupCpuStat()) {
|
||||
|
@ -463,4 +464,4 @@ Future<Void> startMemoryUsageMonitor(uint64_t memLimit) {
|
|||
}
|
||||
};
|
||||
return recurring(checkMemoryUsage, FLOW_KNOBS->MEMORY_USAGE_CHECK_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ struct SystemMonitorMachineState {
|
|||
Optional<Standalone<StringRef>> dcId;
|
||||
Optional<Standalone<StringRef>> zoneId;
|
||||
Optional<Standalone<StringRef>> machineId;
|
||||
Optional<Standalone<StringRef>> datahallId;
|
||||
Optional<IPAddress> ip;
|
||||
Optional<std::string> fdbVersion;
|
||||
|
||||
|
@ -41,10 +42,11 @@ struct SystemMonitorMachineState {
|
|||
Optional<Standalone<StringRef>> const& dcId,
|
||||
Optional<Standalone<StringRef>> const& zoneId,
|
||||
Optional<Standalone<StringRef>> const& machineId,
|
||||
Optional<Standalone<StringRef>> const& datahallId,
|
||||
IPAddress const& ip,
|
||||
std::string const& fdbVersion)
|
||||
: folder(folder), dcId(dcId), zoneId(zoneId), machineId(machineId), ip(ip), monitorStartTime(0),
|
||||
fdbVersion(fdbVersion) {}
|
||||
: folder(folder), dcId(dcId), zoneId(zoneId), machineId(machineId), datahallId(datahallId), ip(ip),
|
||||
monitorStartTime(0), fdbVersion(fdbVersion) {}
|
||||
};
|
||||
|
||||
void initializeSystemMonitorMachineState(SystemMonitorMachineState machineState);
|
||||
|
|
Loading…
Reference in New Issue