{"id":19054411,"url":"https://github.com/datadog/react-native-performance-limiter","last_synced_at":"2025-03-11T12:13:04.993Z","repository":{"id":64863018,"uuid":"576319285","full_name":"DataDog/react-native-performance-limiter","owner":"DataDog","description":"## Auto-archived due to inactivity. ## A package for deliberately limiting the performance of React Native applications","archived":false,"fork":false,"pushed_at":"2023-07-12T16:50:35.000Z","size":1733,"stargazers_count":18,"open_issues_count":2,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-01-18T02:14:18.440Z","etag":null,"topics":["performance","react-native"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-12-09T14:45:28.000Z","updated_at":"2025-01-17T09:55:16.000Z","dependencies_parsed_at":"2023-02-08T18:46:09.801Z","dependency_job_id":null,"html_url":"https://github.com/DataDog/react-native-performance-limiter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Freact-native-performance-limiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Freact-native-performance-limiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Freact-native-performance-limiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Freact-native-performance-limiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/react-native-performance-limiter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243030817,"owners_count":20224666,"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":["performance","react-native"],"created_at":"2024-11-08T23:38:16.596Z","updated_at":"2025-03-11T12:13:04.966Z","avatar_url":"https://github.com/DataDog.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-performance-limiter\n\nA package for intentionally lowering performance and generating crashes on React Native applications.\n\nUse `blockJavascriptThread` and `blockNativeMainThread` to test your implementation of performance monitoring tools, `crashJavascriptThread` and `crashNativeMainThread` to test your implementation of crash reporting tools.\n\n## Installation\n\n```sh\nnpm install react-native-performance-limiter\n```\n\n```sh\nyarn add react-native-performance-limiter\n```\n\nThen re-install your pods:\n\n```sh\n(cd ios \u0026\u0026 pod install)\n```\n\n## Usage\n\n### Block the javascript thread\n\n```js\nimport { blockJavascriptThread } from 'react-native-performance-limiter';\n\nblockJavascriptThread(1000); // blocks javascript thread for 1 second\n```\n\n### Block the native main thread\n\n```js\nimport { blockNativeMainThread } from 'react-native-performance-limiter';\n\nblockNativeMainThread(1000); // blocks native main thread for 1 second\n```\n\nInside functions you can `await` for the block to be finised:\n\n```js\nconst myfun = async () =\u003e {\n  await blockNativeMainThread(1000);\n  // do something else afterwards\n};\n```\n\n### Crash the app from the javascript thread\n\n```js\nimport { crashJavascriptThread } from 'react-native-performance-limiter';\n\ncrashJavascriptThread('custom error message');\n```\n\n### Crash the app from the native main thread\n\n```js\nimport { crashNativeMainThread } from 'react-native-performance-limiter';\n\ncrashNativeMainThread('custom error message');\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Freact-native-performance-limiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Freact-native-performance-limiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Freact-native-performance-limiter/lists"}