Skip to content

zixun/ANREye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANREye

Version License Platform

Carthage compatible

Class for monitor excessive blocking on the main thread

Family

This library is derived from the GodEye project which can automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code. Just like god opened his eyes

Book & Principle

I has wrote a book named 《iOS监控编程》,each chapter records the course function of the implementation details and the way to explore.sorry for english friends,this book wrote by chineses.

Installation

CocoaPods

ANREye is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ANREye"

Carthage

Or, if you’re using Carthage, add SwViewCapture to your Cartfile:

github "zixun/ANREye"

Usage

open and add delegate

self.anrEye = ANREye()
self.anrEye.delegate = self
self.anrEye.start(with: 1)

implement the delegate

extension ViewController: ANREyeDelegate {
    
    func anrEye(anrEye:ANREye,
                catchWithThreshold threshold:Double,
                mainThreadBacktrace:String?,
                allThreadBacktrace:String?) {
        print("------------------")
        print(mainThreadBacktrace!)
        print("------------------")
        print(allThreadBacktrace!)
    }
}

test code

var s = ""
for _ in 0..<9999 {
    for _ in 0..<9999 {
        s.append("1")
    }
}
    
print("invoke")

Author

name: 陈奕龙

twitter: @zixun_

email: chenyl.exe@gmail.com

github: zixun

blog: 子循(SubCycle)

License

ANREye is available under the MIT license. See the LICENSE file for more info.

About

Class for monitor excessive blocking on the main thread and return stacktrace of all threads

Resources

License

Stars

Watchers

Forks

Packages

No packages published