FEATURE: Add stats_tcp_retrans()#750
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
이전에 Offline에서 말씀드린 데로 현재 이전 PR과 충돌이 난 관계로
저희 쪽에서 만든 로직인 건가요? 아니면 prometheus 의 로직인가요? @jhpark816 님께서 말씀하신 대로 stats lock을 잡고 들어가기에 그리고 /proc/net/snmp 내 내용을 보면 크기가 크지 않은 것으로 보이므로 |
a0815b2 to
f161e22
Compare
prometheus에서 만든 로직입니다.
/proc/net/snmp 파일은 pseudo 파일로, Disk IO가 필요하지 않기 때문에 매핑하지 않아도 될 것 같습니다. https://unix.stackexchange.com/questions/8274/what-happens-when-i-open-and-read-from-proc
vCore 4개 기준 다음과 같은 성능을 보입니다. 149.169391 seconds for call function 1000003 times.
0.000149 seconds per function call.테스트 코드는 다음과 같으며, uint64_t loop = 1000003;
void with_gettimeofday(void) {
uint64_t i = 0;
struct timeval start, end;
gettimeofday(&start, NULL);
for (i = 0; i < loop; i++) {
stats_tcp_retrans();
}
gettimeofday(&end, NULL);
double elapsed = (end.tv_sec - start.tv_sec) + ((end.tv_usec - start.tv_usec)/1000000.0);
printf("%lf seconds for call function %lld times.\n", elapsed, loop);
printf("%lf seconds per function call.\n", elapsed / loop);
}
int main() {
with_gettimeofday();
return 0;
} |
58cd6be to
3c6329e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
본 PR에서 Conflict 외에 더 확인해야할 부분이 있을까요? |
🔗 Related Issue
⌨️ What I did
/proc/net/snmpfile에서Tcp: RetransSegs에 해당하는 값을int64_t로 변환합니다./proc/net/snmp파일 내용 예시는 아래와 같습니다.