Skip to content

Quick Start

Installation

  1. Add marco to project.

    yarn add @d11/marco
  2. Wrap screen with PerformanceTracker to track the draw time of the screen, and use track to send custom markers.

    // Import the PerformanceTracker component
    import { PerformanceTracker } from '@d11/marco';
    // Configure PerformanceTracker to persist data on the device
    PerformanceTracker.configure({ persistToFile: true });
    const MyScreen = () => {
    // Track specific actions
    useEffect(() => {
    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>
    );
    };
  3. For instrumentation, you can choose maestro or detox, or use any pre-configured instrumentation tool to run the iteration.

  4. Create a marco.config.js file at the root of project with the following sample config.

    marco.config.js
    module.exports = {
    android: {
    4 collapsed lines
    packageName: 'com.example.app',
    outputPath: './marco-reports/android',
    dataDir: './marco-reports/android/log.json',
    port: '8080',
    },
    ios: {
    4 collapsed lines
    packageName: 'com.example.app',
    outputPath: './marco-reports/ios',
    dataDir: './marco-reports/ios/log.json',
    port: '8080',
    },
    };
  5. Run the following command from the CLI to fetch data from the device.

    yarn marco generate --platform android
  6. 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 android

🎉 Yeah! First marker is tracked. Now leverage the marco panel to track the performance of your app.