{"id":3137,"url":"https://github.com/tapwork/WatchdogInspector","last_synced_at":"2025-08-06T14:31:10.911Z","repository":{"id":3666650,"uuid":"50462806","full_name":"tapwork/WatchdogInspector","owner":"tapwork","description":"Shows your current framerate (fps) in the status bar of your iOS app","archived":false,"fork":false,"pushed_at":"2022-04-27T16:32:57.000Z","size":1210,"stargazers_count":517,"open_issues_count":2,"forks_count":22,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-17T01:16:36.073Z","etag":null,"topics":["carthage","cocoapods","fps","frame-rate","frames","frames-counter","ios","monitoring","performance","performance-analysis","performance-monitoring","performance-visualization","stalling-exceptions","thread","thread-exceptions","thread-timer","uikit","watchdog"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tapwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-26T22:07:42.000Z","updated_at":"2024-11-06T02:34:59.000Z","dependencies_parsed_at":"2022-08-06T14:01:21.637Z","dependency_job_id":null,"html_url":"https://github.com/tapwork/WatchdogInspector","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapwork%2FWatchdogInspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapwork%2FWatchdogInspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapwork%2FWatchdogInspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapwork%2FWatchdogInspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tapwork","download_url":"https://codeload.github.com/tapwork/WatchdogInspector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905525,"owners_count":17989779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","fps","frame-rate","frames","frames-counter","ios","monitoring","performance","performance-analysis","performance-monitoring","performance-visualization","stalling-exceptions","thread","thread-exceptions","thread-timer","uikit","watchdog"],"created_at":"2024-01-05T20:16:32.449Z","updated_at":"2024-12-09T14:31:11.187Z","avatar_url":"https://github.com/tapwork.png","language":"Objective-C","readme":"# WatchdogInspector\n#### Shows your current framerate (fps) in the status bar of your iOS app\n##### Be a good citizen! Don't block your main thread!\n[![Build Status](https://api.travis-ci.org/tapwork/WatchdogInspector.svg?style=flat)](https://travis-ci.org/tapwork/WatchdogInspector)\n[![Cocoapods Version](http://img.shields.io/cocoapods/v/WatchdogInspector.svg?style=flat)](https://github.com/tapwork/WatchdogInspector/blob/master/WatchdogInspector.podspec)\n[![](http://img.shields.io/cocoapods/l/WatchdogInspector.svg?style=flat)](https://github.com/tapwork/WatchdogInspector/blob/master/LICENSE)\n[![CocoaPods Platform](http://img.shields.io/cocoapods/p/WatchdogInspector.svg?style=flat)]()\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Twitter](https://img.shields.io/badge/twitter-@cmenschel-blue.svg?style=flat)](http://twitter.com/cmenschel)\n\nWatchdogInspector counts your app's framerate and displays the fps in the status bar.\nThe coloured status bar lets you know when your framerate drops below 60 fps.\nIf everything is fine your status bar gets happy and will stay green.\nTo detect unwanted main thread stalls you can set a custom watchdog timeout.\n\n## Features\n* Status bar displays the current framerate in fps (measured every 2 seconds)\n* Colours the status bar from green (good fps) to red (bad fps)\n* Custom watchdog timeout: Exception when main thread stalls for a defined time\n\n![screencast](screencast.gif)\n\n## Install\n#### CocoaPods\n```ruby\npod \"WatchdogInspector\"\n```\nand run `pod install`\nYou can see the example project how to setup and run `WatchdogInspector`\nMake sure that you **don't** use `WatchdogInspector` in production.\n\n#### Carthage \nYou can use [Carthage](https://github.com/Carthage/Carthage). \nSpecify in Cartfile:\n\n```ruby\ngithub \"tapwork/WatchdogInspector\"\n```\n\n## Usage\n##### [Objective-C](README_objc.md)  |  Swift\n#### Start \nAfter launch or whenever you want.\n```Swift\nimport WatchdogInspector\nfunc application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -\u003e Bool {\n        TWWatchdogInspector.start()\n        return true\n}\n```\n#### Stop\nTo stop it just call\n```Swift\nTWWatchdogInspector.stop()\n```\n#### Main Thread Stalling Exceptions\nYou can set a custom watchdog timeout for stalling exceptions (Default: 3 seconds)\n```Swift\nTWWatchdogInspector.setStallingThreshhold(10.0)\n```\nYou could also disable the Main Thread exceptions\n```Swift\nTWWatchdogInspector.setEnableMainthreadStallingException(false)\n```\n#### Logging\nTo log all measured framerates you can log them in the console by calling (Default: on)\n```Swift\nTWWatchdogInspector.setUseLogs(true)\n```\n\n## How it works\nThere are basically two timers running to measure the framerate.\n\n1. The background thread timer fires every 2 seconds to count how many frames were set by the main thread. Ideally the result would be 120 frames in 2 seconds to get 60 fps. The background timer resets the frames counter every event. He also sends the measured fps to the status bar on the main thread.\n\n2. The main thread timer should fire every 1/60 second (60 fps is optimum for a smooth animation) to increment the frames counter. If the main thread is blocked and can't run every 1/60 second the framerate will drop the 60 fps.\n\nThere is also a run loop observer running to detect main thread stalls for a defined timeout. If the timeout has been reached an exception will be thrown.\n\n## Related projects\n* [HeapInspector](https://github.com/tapwork/HeapInspector-for-iOS)\nFind memory issues \u0026 leaks in your iOS app\n\n## Author\n* [Christian Menschel](http://github.com/tapwork) ([@cmenschel](https://twitter.com/cmenschel))\n\n## License\n[MIT](LICENSE)\n","funding_links":[],"categories":["Tools","Libs","Objective-C","WebSocket","Logging [🔝](#readme)"],"sub_categories":["Web View","Logging","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapwork%2FWatchdogInspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftapwork%2FWatchdogInspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapwork%2FWatchdogInspector/lists"}