{"id":1340,"url":"https://github.com/wojteklu/Watchdog","last_synced_at":"2025-08-06T14:31:11.339Z","repository":{"id":52239874,"uuid":"42328231","full_name":"wojteklu/Watchdog","owner":"wojteklu","description":"Class for logging excessive blocking on the main thread","archived":false,"fork":false,"pushed_at":"2024-06-14T22:54:44.000Z","size":538,"stargazers_count":1856,"open_issues_count":1,"forks_count":95,"subscribers_count":41,"default_branch":"master","last_synced_at":"2024-07-22T13:34:39.536Z","etag":null,"topics":["debugging","ios","macos","mainthread","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/wojteklu.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":"2015-09-11T19:30:28.000Z","updated_at":"2024-06-25T16:17:26.000Z","dependencies_parsed_at":"2022-08-21T05:50:46.684Z","dependency_job_id":null,"html_url":"https://github.com/wojteklu/Watchdog","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojteklu%2FWatchdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojteklu%2FWatchdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojteklu%2FWatchdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojteklu%2FWatchdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wojteklu","download_url":"https://codeload.github.com/wojteklu/Watchdog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215780272,"owners_count":15929791,"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":["debugging","ios","macos","mainthread","swift"],"created_at":"2024-01-05T20:15:44.188Z","updated_at":"2024-08-17T16:31:02.552Z","avatar_url":"https://github.com/wojteklu.png","language":"Swift","readme":"# Watchdog\n\n[![Language](https://img.shields.io/badge/swift-4.2-orange.svg)](http://swift.org)\n[![Build Status](https://img.shields.io/travis/wojteklu/Watchdog/master.svg?style=flat-square)](https://travis-ci.org/wojteklu/Watchdog) [![Platform support](https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20tvOS-lightgrey.svg?style=flat-square)](https://github.com/wojteklu/Watchdog/blob/master/LICENSE)  [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Watchdog.svg?style=flat-square)](https://cocoapods.org/pods/Watchdog)  [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)  [![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/wojteklu/Watchdog/blob/master/LICENSE)\n\nClass for logging excessive blocking on the main thread. It watches the main thread and checks if it doesn’t get blocked for more than defined threshold.\n\n```\n👮 Main thread was blocked for 1.25s 👮\n```\n\nYou can also inspect which part of your code is blocking the main thread.\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"Example/example.png\" width=\"200px style='border:1px solid #000000'\"/\u003e\n\u003c/p\u003e\n\n## Usage\n\nSimply, just instantiate Watchdog with number of seconds that must pass to consider the main thread blocked. Additionally you can enable `strictMode` that stops the execution whenever the threshold is reached. This way, you can inspect which part of your code is blocking the main thread.\n\n```Swift\nlet watchdog = Watchdog(threshold: 0.4, strictMode: true)\n```\n\nDon't forget to retain Watchdog somewhere or it will get released when it goes out of scope.\n\n## Requirements\n\n* iOS 8.0+, tvOS 9.0+ or macOS 10.9+\n* Swift 5.0\n\n## Installation\n\n### [Carthage]\n\n[Carthage]: https://github.com/Carthage/Carthage\n\nAdd the following to your Cartfile:\n\n```\ngithub \"wojteklu/Watchdog\"\n```\n\nThen run `carthage update`.\n\nFollow the current instructions in [Carthage's README][carthage-installation]\nfor up to date installation instructions.\n\n[carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application\n\n### [CocoaPods]\n\n[CocoaPods]: http://cocoapods.org\n\nAdd the following to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html):\n\n```ruby\npod 'Watchdog'\n```\n\nYou will also need to make sure you're opting into using frameworks:\n\n```ruby\nuse_frameworks!\n```\n\n### Manually\n\nManually add the file into your Xcode project. Slightly simpler, but updates are also manual.\n\n## Author\n\nWojtek Lukaszuk [@wojteklu](http://twitter.com/wojteklu)\n\n## License\n\nWatchdog is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Logging","Libs","HarmonyOS","Swift","Logging [🔝](#readme)"],"sub_categories":["Other Hardware","Logging","Other free courses","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojteklu%2FWatchdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwojteklu%2FWatchdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojteklu%2FWatchdog/lists"}