Giter VIP home page Giter VIP logo

0xba1 / very_good_performance Goto Github PK

View Code? Open in Web Editor NEW

This project forked from verygoodopensource/very_good_performance

0.0 0.0 0.0 919 KB

Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way created by Very Good Ventures ๐Ÿฆ„

Home Page: https://pub.dev/packages/very_good_performance

License: MIT License

Dart 30.48% Kotlin 0.19% Swift 1.75% Objective-C 0.06% CMake 22.96% C++ 36.83% C 2.15% HTML 5.58%

very_good_performance's Introduction

Very Good Performance

Very Good Ventures Very Good Ventures

Developed with ๐Ÿ’™ by Very Good Ventures ๐Ÿฆ„

ci coverage pub package License: MIT style: very good analysis


Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way

Usage

very_good_performance.yaml

Add a new file at root of your project named very_good_performance.yaml with the following fields.

You can modify these values to match your own performance expectations.

performance_report:
  directory: performance/reports
integration_test_expectations:
  should_fail_build_on_warning: true
  should_fail_build_on_error: true
performance_metrics:
  missed_frames_threshold:
    warning: 5
    error: 10
  average_frame_build_rate_threshold:
    warning_time_in_milliseconds: 14.0
    error_time_in_milliseconds: 16.0
  worst_frame_build_rate_threshold:
    warning_time_in_milliseconds: 14.0
    error_time_in_milliseconds: 16.0

Running tests with FlutterDrive

Simply wrap your FlutterDriver tests with the method capturePerformanceReport to start collecting performance information

test('tapping on the Increment button updates the counter', () async {
  await driver.capturePerformanceReport(
    reportName: 'counter_performance',
    action: () async {
      await driver.tap(find.byType(FloatingActionButton));
      expect(await driver.getText(find.text('1')), '1');
      await driver.tap(find.byType(FloatingActionButton));
      expect(await driver.getText(find.text('2')), '2');
    },
  );
});

At the end of the execution, you will see a similar report to this one:

Performance Report

Running the example project

You can find an example project that showcases how to use this library.

$> cd example
$> flutter drive --target=e2e/e2e.dart --driver=e2e/counter_test.dart -d macos --profile

You should see the Counter app running and, at the end of the execution, it will print the performance overview in the console, and will generate the performance reports under e2e/performance/reports.

very_good_performance's People

Contributors

jorgecoca avatar felangel avatar pedromassango avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.