Skip to content

An iOS library for network tracking.It can be used to evaluate performance or capture packets.

Notifications You must be signed in to change notification settings

didiaodanding/NetworkTracker

 
 

Repository files navigation

NetworkTracker

实现原理

An iOS library for network tracking.It can be used to evaluate performance or capture packets.

Supports HTTP/WebView/TCP.

Dependency

Fishhook

AAChartKit(Used for sample project)

Compatibility

iOS SDK NSURLConnetion NSURLSession UIWebView WKWebView CocoaAyncSocket
8.4 YES YES via TCP via TCP YES
9.3 YES YES YES YES YES
10.3 YES YES YES YES YES
11.3 YES YES YES YES YES

performance

HTTP

NSURLSession library has NSURLSessionTaskMetrics API for those higher than iOS 10.0. So we can evaluate HTTP network performance by domainLookupTime or secureConnectionTime.

For NSURLConnetion or NSURLSession lower than iOS 10.0, we can only use BSD Socket APIs to collect part of data.

WebView

Either UIWebView or WKWebView implements Performance.timing API above iOS 9. For those lower than iOS 10.0, we also use BSD Socket APIs to collect part of data.

Installation

Drag and use.

目前的问题

部分数据根据部分机型和SDK会导致无法收集完全。 DNSTracker.m可能会导致崩溃,该类可以完全注释掉不影响使用

精力有限停止维护

About

An iOS library for network tracking.It can be used to evaluate performance or capture packets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 90.8%
  • HTML 5.3%
  • C 3.9%