網路流量統計using ADB

來源:互聯網
上載者:User

標籤:tcp   操作   udp   網路流   height   strong   alt   bytes   lan   

/proc/net/xt_qtaguid/stats 基本覆蓋目前所有機型且統計流量全面

adb shell cat /proc/net/xt_qtaguid/stats | grep (uid#)

如: adb shell cat /proc/net/xt_qtaguid/stats | grep 10127

48 wlan0 0x0 10127 0 316574 2279 472562 3651 316574 2279 0 0 0 0 472562 3651 0 0 0 0

49 wlan0 0x0 10127 1 6172960 4936 415951 5215 6172960 4936 0 0 0 0 415951 5215 0 0 0 0

50 wlan0 0x3792d5b400000000 10127 0 29678 208 32168 296 29678 208 0 0 0 0 32168 296 0 0 0 0

51 wlan0 0x3792d5b400000000 10127 1 226170 222 25745 265 226170 222 0 0 0 0 25745 265 0 0 0 0

56 wlan0 0xfa1dcc4b00000000 10127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

57 wlan0 0xfa1dcc4b00000000 10127 1 3014885 2127 139857 2117 3014885 2127 0 0 0 0 139857 2117 0 0 0 0

其中第6和8列為 rx_bytes(接收資料)和tx_bytes(傳輸資料)包含tcp,udp等所有網路流量傳輸的統計。

 

具體操作方式:

1、找出pid,然後cat /proc/#PID/status | grep uid,找到對應的uid

2.cat /proc/net/xt_qtaguid/stats | grep 10082

一個UID可能對應多個進程,把資料累加起來就行

 

 

 

網路流量統計using ADB

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.