Przemyslaw Pietrzkiewicz | 1d90994 | 2015-08-28 16:27:56 +0200 | [diff] [blame] | 1 | # benchmark |
| 2 | |
| 3 | This application connects to another mojo application, collects traces during |
| 4 | indicated period of time and computes a number of results based on the collected |
| 5 | traces. It can be used to measure performance of a mojo app, provided that the |
| 6 | app being benchmarked participates in the [tracing |
Przemyslaw Pietrzkiewicz | 91a18d9 | 2015-08-31 15:08:01 +0200 | [diff] [blame] | 7 | ecosystem](../../mojo/services/tracing/public/interfaces/tracing.mojom). |
Przemyslaw Pietrzkiewicz | 1d90994 | 2015-08-28 16:27:56 +0200 | [diff] [blame] | 8 | |
| 9 | ## Arguments |
| 10 | |
Przemyslaw Pietrzkiewicz | ddfda66 | 2015-09-16 15:56:39 +0200 | [diff] [blame] | 11 | The benchmarking app **requires** the following arguments: |
Przemyslaw Pietrzkiewicz | 1d90994 | 2015-08-28 16:27:56 +0200 | [diff] [blame] | 12 | |
| 13 | - `--app=<app_url>` - url of the application to be benchmarked |
| 14 | - `--duration=<duration_seconds>` - duration of the benchmark in seconds |
| 15 | |
Przemyslaw Pietrzkiewicz | ddfda66 | 2015-09-16 15:56:39 +0200 | [diff] [blame] | 16 | The following arguments are **optional**: |
| 17 | |
| 18 | - `--trace-output=<output_file_path>` - local file path at which the collected trace |
| 19 | will be written |
| 20 | |
| 21 | Any other arguments are assumed to be descriptions of measurements to be |
Przemyslaw Pietrzkiewicz | 1d90994 | 2015-08-28 16:27:56 +0200 | [diff] [blame] | 22 | conducted on the collected trace data. Each measurement has to be of form: |
| 23 | `<measurement_type>/<trace_event_category>/<trace_event_name>`. |
| 24 | |
| 25 | The following measurement types are available: |
| 26 | |
| 27 | - `time_until` - measures time until the first occurence of the event named |
| 28 | `trace_event_name` in category `trace_event_category`. |
| 29 | - `avg_duration` - measures average duration of all events named |
| 30 | `trace_event_name` in category `trace_event_category`. |
| 31 | |
| 32 | ## Runner script |
| 33 | |
Przemyslaw Pietrzkiewicz | 91a18d9 | 2015-08-31 15:08:01 +0200 | [diff] [blame] | 34 | Devtools offers [a helper script](../../mojo/devtools/common/mojo_benchmark) |
Przemyslaw Pietrzkiewicz | 845d098 | 2015-09-14 15:55:43 +0200 | [diff] [blame] | 35 | allowing to run a list of benchmarks in controlled caching conditions, both |
Przemyslaw Pietrzkiewicz | ddfda66 | 2015-09-16 15:56:39 +0200 | [diff] [blame] | 36 | on **Android** and **Linux**. |