Commit 4c353c25 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Also expose two-part sensors as three-part sensors in ksysguardd

ksystemstats expects sensors to consist of at least three parts:
subsystem, object, property. Sensors like "system/processors" break this
assumption, causing them to not be properly readable. Rather than trying
to come up with an elaborate way to handle this in ksystemstats, simply
expose them also as a three-part sensor so the mapping doesn't need to
change. These sensors are not very dynamic anyway so duplicating them
does not do much harm. The two-part version is kept around for backward
compatibility with the ksysguard UI.
parent c47eb9ba
......@@ -76,7 +76,9 @@ initCpuInfo(struct SensorModul* sm)
/* Core/process count */
registerMonitor("system/processors", "integer", printNumCpus, printNumCpusInfo, sm);
registerMonitor("system/processors/processors", "integer", printNumCpus, printNumCpusInfo, sm);
registerMonitor("system/cores", "integer", printNumCores, printNumCoresInfo, sm);
registerMonitor("system/cores/cores", "integer", printNumCores, printNumCoresInfo, sm);
/*
* CPU Loads
......
......@@ -28,10 +28,12 @@
void initUptime( struct SensorModul* sm ) {
registerMonitor( "system/uptime", "float", printUptime, printUptimeInfo, sm );
registerMonitor( "system/uptime/uptime", "float", printUptime, printUptimeInfo, sm );
}
void exitUptime( void ) {
removeMonitor("system/uptime");
removeMonitor("system/uptime/uptime");
}
void printUptime( const char* cmd ) {
......
......@@ -157,10 +157,10 @@ void initCpuInfo( struct SensorModul* sm )
if ( updateCpuInfo() < 0 )
return;
registerMonitor( "system/processors", "integer", printNumCpus, printNumCpusInfo,
CpuInfoSM );
registerMonitor( "system/cores", "integer", printNumCores, printNumCoresInfo,
CpuInfoSM );
registerMonitor( "system/processors", "integer", printNumCpus, printNumCpusInfo, CpuInfoSM );
registerMonitor( "system/processors/processors", "integer", printNumCpus, printNumCpusInfo, CpuInfoSM );
registerMonitor( "system/cores", "integer", printNumCores, printNumCoresInfo, CpuInfoSM );
registerMonitor( "system/cores/cores", "integer", printNumCores, printNumCoresInfo, CpuInfoSM );
processCpuInfo();
......
......@@ -61,6 +61,7 @@ void initUptime( struct SensorModul* sm ) {
if (sscanf(uptimeBufP, format, buf) == 1) {
buf[sizeof(buf) - 1] = '\0';
registerMonitor( "system/uptime", "float", printUptime, printUptimeInfo, StatSM );
registerMonitor( "system/uptime/uptime", "float", printUptime, printUptimeInfo, StatSM );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment