0
点赞
收藏
分享

微信扫一扫

awk计算丢包率

爱薇Ivy趣闻 2023-03-05 阅读 95


    1.  #author souroot
    2. : souroot@163.com
    3. formular: (all the send packets in agents layer)
    4. #-(all the recieve packets in agents layer) as all the lost packets
    5. {
    6. send;
    7. ;
    8. }
    9. {
    10. if(($1)=="s" && ($4)=="AGT")
    11. send++;
    12. if(($1)=="r" && ($4)=="AGT")
    13. ++;
    14. }
    15. {
    16. "send is %d, recv is %d\n",send,recv;
    17. "drop rate is %4f\n",(send-recv)/send;
    18. }



    $1代表第一列,$4代表第四列。BEGIN表示循环开始,END表示循环结束



    举报

    相关推荐

    0 条评论