Skip to content

Commit ec1a8f0

Browse files
committed
chore: cleanup readme too
1 parent 1229bc4 commit ec1a8f0

1 file changed

Lines changed: 0 additions & 53 deletions

File tree

README.md

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -351,59 +351,6 @@ const ReportActionsView = ({reportID, isActiveReport}) => {
351351
export default ReportActionsView;
352352
```
353353

354-
# Benchmarks
355-
356-
Provide the `captureMetrics` boolean flag to `Onyx.init` to capture call statistics
357-
358-
```js
359-
Onyx.init({
360-
keys: ONYXKEYS,
361-
evictableKeys: [ONYXKEYS.COLLECTION.REPORT_ACTIONS],
362-
captureMetrics: Config.BENCHMARK_ONYX,
363-
});
364-
```
365-
366-
At any point you can get the collected statistics using `Onyx.getMetrics()`.
367-
This will return an object containing `totalTime`, `averageTime` and `summaries`.
368-
`summaries` is a collection of statistics for each method it contains data about:
369-
- method name
370-
- total, max, min, average times for this method calls
371-
- calls - a list of individual calls with each having: start time; end time; call duration; call arguments
372-
- start/end times are relative to application launch time - 0.00 being exactly at launch
373-
374-
If you wish to reset the metrics and start over use `Onyx.resetMetrics()`
375-
376-
Finally, there's a `Onyx.printMetrics()` method which prints human statistics information on the dev console. You can use this method during debugging. For example add an `Onyx.printMetrics()` line somewhere in code or call it through the dev console. It supports 3 popular formats *MD* - human friendly markdown, *CSV* and *JSON*. The default is MD if you want to print another format call `Onyx.printMetrics({ format: 'csv' })` or
377-
`Onyx.printMetrics({ format: 'json' })`.
378-
379-
Sample output of `Onyx.printMetrics()`
380-
381-
```
382-
### Onyx Benchmark
383-
- Total: 1.5min
384-
- Last call finished at: 12.55sec
385-
386-
| method | total time spent | max | min | avg | time last call completed | calls made |
387-
|-----------------|-----------------:|----------:|---------:|----------:|-------------------------:|-----------:|
388-
| Onyx:getAllKeys | 1.2min | 2.16sec | 0.159ms | 782.230ms | 12.55sec | 90 |
389-
| Onyx:merge | 4.73sec | 2.00sec | 74.412ms | 591.642ms | 10.24sec | 8 |
390-
| Onyx:set | 3.90sec | 846.760ms | 43.663ms | 433.056ms | 7.47sec | 9 |
391-
| Onyx:get | 8.87sec | 2.00sec | 0.063ms | 61.998ms | 10.24sec | 143 |
392-
393-
394-
| Onyx:set |
395-
|---------------------------------------------------------------|
396-
| start time | end time | duration | args |
397-
|-----------:|----------:|----------:|--------------------------|
398-
| 291.042ms | 553.079ms | 262.037ms | session, [object Object] |
399-
| 293.719ms | 553.316ms | 259.597ms | account, [object Object] |
400-
| 294.541ms | 553.651ms | 259.109ms | network, [object Object] |
401-
| 365.378ms | 554.246ms | 188.867ms | iou, [object Object] |
402-
| 1.08sec | 2.20sec | 1.12sec | network, [object Object] |
403-
| 1.08sec | 2.20sec | 1.12sec | iou, [object Object] |
404-
| 1.17sec | 2.20sec | 1.03sec | currentURL, / |
405-
```
406-
407354
# Debug mode
408355

409356
It can be useful to log why Onyx is calling `setState()` on a particular React component so that we can understand which key changed, what changed about the value, and the connected component that ultimately rendered as a result. When used correctly this can help isolate problem areas and unnecessary renders in the code. To enable this feature, pass `debugSetState: true` to the config and grep JS console logs for `[Onyx-Debug]`.

0 commit comments

Comments
 (0)