Commit 4bcc11ab authored by Arjen Hiemstra's avatar Arjen Hiemstra

Convert nvidia plugin sensor IDs to GPU plugin sensor IDs

The nvidia plugin has been replaced by a more generic GPU plugin, so
take care of the sensor IDs that changed.
parent 1c0a168a
......@@ -164,6 +164,26 @@ private Q_SLOTS:
QStringLiteral("memory/swap/free"),
QStringLiteral("memory/swap/used"),
};
QTest::addRow("gpu")
<< QJsonArray {
QStringLiteral("nvidia/gpu1/temperature"),
QStringLiteral("nvidia/gpu2/memory"),
QStringLiteral("nvidia/gpu3/sharedMemory"),
QStringLiteral("nvidia/gpu4/memoryClock"),
QStringLiteral("nvidia/gpu5/processorClock"),
QStringLiteral("nvidia/gpu6/encoderUsage"),
QStringLiteral("nvidia/gpu7/decoderUsage"),
}
<< QJsonArray {
QStringLiteral("gpu/gpu1/temperature"),
QStringLiteral("gpu/gpu2/usedVram"),
QStringLiteral("gpu/gpu3/usedVram"),
QStringLiteral("gpu/gpu4/memoryFrequency"),
QStringLiteral("gpu/gpu5/coreFrequency"),
QStringLiteral("gpu/gpu6/usage"),
QStringLiteral("gpu/gpu7/usage"),
};
}
void testSensorIdConversion()
......
......@@ -173,6 +173,11 @@ SensorFaceControllerPrivate::SensorFaceControllerPrivate()
{ QRegularExpression(QStringLiteral("mem/physical/buf")), QStringLiteral("memory/physical/buffer")},
{ QRegularExpression(QStringLiteral("mem/physical/cached")), QStringLiteral("memory/physical/cache")},
{ QRegularExpression(QStringLiteral("^mem/(.*)")), QStringLiteral("memory/\\1")},
{ QRegularExpression(QStringLiteral("nvidia/(.*)/temperature$")), QStringLiteral("gpu/\\1/temperature")},
{ QRegularExpression(QStringLiteral("nvidia/(.*)/memoryClock$")), QStringLiteral("gpu/\\1/memoryFrequency")},
{ QRegularExpression(QStringLiteral("nvidia/(.*)/processorClock$")), QStringLiteral("gpu/\\1/coreFrequency")},
{ QRegularExpression(QStringLiteral("nvidia/(.*)/(memory|sharedMemory)$")), QStringLiteral("gpu/\\1/usedVram")},
{ QRegularExpression(QStringLiteral("nvidia/(.*)/(encoderUsage|decoderUsage)$")), QStringLiteral("gpu/\\1/usage")},
};
}
}
......
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