Quick Start
Installation
-
Add
marco
to project.yarn add @d11/marconpm install @d11/marco -
Wrap screen with
PerformanceTracker
to track the draw time of the screen, and usetrack
to send custom markers.// Import the PerformanceTracker componentimport { PerformanceTracker } from '@d11/marco';// Configure PerformanceTracker to persist data on the devicePerformanceTracker.configure({ persistToFile: true });const MyScreen = () => {// Track specific actionsuseEffect(() => {PerformanceTracker.track('Screen_Mounted', Date.now());}, [])return (// Wrap screen with PerformanceTracker to measure draw time<PerformanceTracker tagName="Screen_Loaded">{/* Screen content goes here */}<button onClick={handleOnPress}>Click Me</button></PerformanceTracker>);}; -
For instrumentation, you can choose maestro or detox, or use any pre-configured instrumentation tool to run the iteration.
-
Create a
marco.config.js
file at the root of project with the following sample config.marco.config.js module.exports = {android: {4 collapsed linespackageName: 'com.example.app',outputPath: './marco-reports/android',dataDir: './marco-reports/android/log.json',port: '8080',},ios: {4 collapsed linespackageName: 'com.example.app',outputPath: './marco-reports/ios',dataDir: './marco-reports/ios/log.json',port: '8080',},}; -
Run the following command from the CLI to fetch data from the device.
yarn marco generate --platform androidnpm marco generate --platform android -
To visualize the data on a dashboard, run the following command. This will open a dashboard on localhost at the desired port.
yarn marco visualize --platform androidnpm marco visualize --platform android
🎉 Yeah! First marker is tracked. Now leverage the marco panel to track the performance of your app.