提交 e21b86e4 authored 作者: José Luis Millán's avatar José Luis Millán

Score: pretify logs

上级 67698cd8
......@@ -432,14 +432,24 @@ namespace RTC
}
}
// MS_ERROR(
// "fixed values [expected:%" PRIu32 ",received:%" PRIu32 ", lost:%" PRIu32 ", repaired:%" PRIu32
// ", retransmitted:%" PRIu32,
// expected,
// received,
// lost,
// repaired,
// retransmitted);
#ifdef MS_LOG_DEV
MS_DEBUG_TAG(
score,
"[totalExpected:%" PRIu32 ", totalReceived:%zu, totalRepaired:%zu",
totalExpected,
totalReceived,
totalRepaired);
MS_DEBUG_TAG(
score,
"fixed values [expected:%" PRIu32 ", received:%" PRIu32 ", lost:%" PRIu32
", repaired:%" PRIu32 ", retransmitted:%" PRIu32,
expected,
received,
lost,
repaired,
retransmitted);
#endif
float repairedRatio = static_cast<float>(repaired) / static_cast<float>(received);
auto repairedWeight = std::pow(1 / (repairedRatio + 1), 4);
......@@ -451,32 +461,18 @@ namespace RTC
lost -= repaired * repairedWeight;
// MS_ERROR(
// "[repairedRatio:%f, repairedWeight:%f, new lost:%" PRIu32 "]",
// repairedRatio,
// repairedWeight,
// lost);
float deliveredRatio = static_cast<float>(received - lost) / static_cast<float>(received);
auto score = std::round(std::pow(deliveredRatio, 4) * 10);
// MS_ERROR("RESULT [deliveredRatio:%f, score:%f]", deliveredRatio, score);
// MS_ERROR("==========\n");
#ifdef MS_LOG_DEV
MS_DEBUG_TAG(
score,
"[totalExpected:%" PRIu32 ", totalReceived:%zu, totalRepaired:%zu, expected:%" PRIu32
", received:%" PRIu32 ", repaired:%" PRIu32 ", lossPercentage:%f, score:%" PRIu8 "]",
totalExpected,
totalReceived,
totalRepaired,
expected,
received,
repaired,
lossPercentage,
"[deliveredRatio:%f, repairedRatio:%f, repairedWeight:%f, new lost:%" PRIu32 ", score: %lf]",
deliveredRatio,
repairedRatio,
repairedWeight,
lost,
score);
#endif
......
......@@ -555,12 +555,22 @@ namespace RTC
}
}
// MS_ERROR(
// "fixed values [sent:%zu, lost:%" PRIu32 ", repaired:%" PRIu32 ", retransmitted:%" PRIu32,
// sent,
// lost,
// repaired,
// retransmitted);
#ifdef MS_LOG_DEV
MS_DEBUG_TAG(
score,
"[totalSent:%zu, totalLost:%" PRIi32 ", totalRepaired:%zu",
totalSent,
totalLost,
totalRepaired);
MS_DEBUG_TAG(
score,
"fixed values [sent:%zu, lost:%" PRIu32 ", repaired:%" PRIu32 ", retransmitted:%" PRIu32,
sent,
lost,
repaired,
retransmitted);
#endif
float repairedRatio = static_cast<float>(repaired) / static_cast<float>(sent);
auto repairedWeight = std::pow(1 / (repairedRatio + 1), 4);
......@@ -572,30 +582,18 @@ namespace RTC
lost -= repaired * repairedWeight;
// MS_ERROR(
// "[repairedRatio:%f, repairedWeight:%f, new lost:%" PRIu32 "]",
// repairedRatio,
// repairedWeight,
// lost);
float deliveredRatio = static_cast<float>(sent - lost) / static_cast<float>(sent);
auto score = std::round(std::pow(deliveredRatio, 4) * 10);
// MS_ERROR("RESULT [deliveredRatio:%f, score:%f]", deliveredRatio, score);
// MS_ERROR("++++++++++\n");
#ifdef MS_LOG_DEV
MS_DEBUG_TAG(
score,
"[totalSent:%zu, totalLost:%" PRIi32 ", totalRepaired:%zu, repaired:%" PRIu32
", lossPercentage:%f, score:%" PRIu8 "]",
totalSent,
totalLost,
totalRepaired,
repaired,
lossPercentage,
"[deliveredRatio:%f, repairedRatio:%f, repairedWeight:%f, new lost:%" PRIu32 ", score: %lf]",
deliveredRatio,
repairedRatio,
repairedWeight,
lost,
score);
report->Dump();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论