Commit Request - Step 1 Restore Files
Restored files.
This commit is contained in:
+2
-40
@@ -110,36 +110,6 @@ static void GetCpuFrequency(uint64_t *freqMin, uint64_t *freqMax)
|
||||
*freqMin = fMin;
|
||||
*freqMax = fMax;
|
||||
}
|
||||
static float GetMemoryUsagePercent()
|
||||
{
|
||||
try {
|
||||
std::ifstream f("/proc/meminfo");
|
||||
if (!f.is_open()) return 0.0f;
|
||||
std::string label;
|
||||
uint64_t memTotal = 0;
|
||||
uint64_t memAvailable = 0;
|
||||
while (f >> label)
|
||||
{
|
||||
if (label == "MemTotal:")
|
||||
{
|
||||
f >> memTotal;
|
||||
} else if (label == "MemAvailable:")
|
||||
{
|
||||
f >> memAvailable;
|
||||
} else {
|
||||
std::string rest;
|
||||
std::getline(f, rest);
|
||||
}
|
||||
if (memTotal && memAvailable) break;
|
||||
}
|
||||
if (memTotal == 0) return 0.0f;
|
||||
return (float)(memTotal - memAvailable) * 100.0f / (float)memTotal;
|
||||
} catch (const std::exception &)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
static std::string GetGovernor()
|
||||
{
|
||||
return pipedal::GetCpuGovernor();
|
||||
@@ -2086,8 +2056,6 @@ public:
|
||||
virtual void UpdateServerConfiguration(const JackServerSettings &jackServerSettings,
|
||||
std::function<void(bool success, const std::string &errorMessage)> onComplete)
|
||||
{
|
||||
|
||||
|
||||
std::lock_guard guard(restart_mutex);
|
||||
RestartThread *pShutdown = new RestartThread(this, jackServerSettings, onComplete);
|
||||
restartThreads.push_back(pShutdown);
|
||||
@@ -2151,13 +2119,8 @@ public:
|
||||
|
||||
if (this->audioDriver != nullptr)
|
||||
{
|
||||
result.cpuUsage_ = audioDriver->CpuUse();
|
||||
if (!std::isfinite(result.cpuUsage_))
|
||||
{
|
||||
result.cpuUsage_ = 0.0f;
|
||||
}
|
||||
result.cpuUsage_ = audioDriver->CpuUse();
|
||||
}
|
||||
result.memoryUsage_ = GetMemoryUsagePercent();
|
||||
GetCpuFrequency(&result.cpuFreqMin_, &result.cpuFreqMax_);
|
||||
result.hasCpuGovernor_ = HasCpuGovernor();
|
||||
if (result.hasCpuGovernor_)
|
||||
@@ -2357,11 +2320,10 @@ JSON_MAP_REFERENCE(JackHostStatus, errorMessage)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, restarting)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, underruns)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, cpuUsage)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, memoryUsage)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, msSinceLastUnderrun)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, temperaturemC)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, cpuFreqMin)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, cpuFreqMax)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, hasCpuGovernor)
|
||||
JSON_MAP_REFERENCE(JackHostStatus, governor)
|
||||
JSON_MAP_END()
|
||||
JSON_MAP_END()
|
||||
|
||||
@@ -191,7 +191,6 @@ namespace pipedal
|
||||
bool restarting_;
|
||||
uint64_t underruns_;
|
||||
float cpuUsage_ = 0;
|
||||
float memoryUsage_ = 0;
|
||||
uint64_t msSinceLastUnderrun_ = 0;
|
||||
int32_t temperaturemC_ = -100000;
|
||||
uint64_t cpuFreqMax_ = 0;
|
||||
|
||||
@@ -81,21 +81,6 @@ namespace pipedal
|
||||
|
||||
bool IsValid() const { return valid_; }
|
||||
|
||||
// Legacy constructor used by tests prior to the addition of
|
||||
// separate input and output ALSA devices.
|
||||
// JackServerSettings(const std::string &device,
|
||||
// uint64_t sampleRate,
|
||||
// uint32_t bufferSize,
|
||||
// uint32_t numberOfBuffers)
|
||||
// {
|
||||
// this->valid_ = true;
|
||||
// this->rebootRequired_ = true;
|
||||
// this->alsaInputDevice_ = device;
|
||||
// this->alsaOutputDevice_ = device;
|
||||
// this->sampleRate_ = sampleRate;
|
||||
// this->bufferSize_ = bufferSize;
|
||||
// this->numberOfBuffers_ = numberOfBuffers;
|
||||
// }
|
||||
void WriteDaemonConfig(); // requires root perms.
|
||||
void SetRebootRequired(bool value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user