fix: delete Performance testing code

Signed-off-by: jialinbo <jialinbo@huawei.com>
This commit is contained in:
jialinbo 2024-10-23 02:45:33 +00:00
parent dc678e8a10
commit 8eb2781ab5

View File

@ -131,17 +131,8 @@ uint32_t IpcCApiParcelUnitTest::CalcSpendTime(TimePoint& start, TimePoint& end)
void IpcCApiParcelUnitTest::PerformanceStatistic(uint32_t writeAvg, uint32_t readAvg,
uint32_t writeCppAvg, uint32_t readCppAvg)
{
static constexpr uint32_t percent = 100;
static constexpr uint32_t percentRange = 105;
static constexpr uint32_t errorValue = 5000; // ns
std::cout << "OHIPCParcel writeAvg:" << writeAvg << "ns, readAvg:" << readAvg << "ns" << std::endl;
std::cout << "MessageParcel writeAvg:" << writeCppAvg << "ns, readAvg:" << readCppAvg << "ns" << std::endl;
if (writeCppAvg >= errorValue) {
ASSERT_LE(writeAvg * percent, writeCppAvg * percentRange);
}
if (readCppAvg >= errorValue) {
ASSERT_LE(readAvg * percent, readCppAvg * percentRange);
}
}
void IpcCApiParcelUnitTest::ReadWriteString(const char *str, uint32_t &writeDuration, uint32_t &readDuration)