Skip to content

Commit ec0769f

Browse files
committed
Fixes.
1 parent 14a1da2 commit ec0769f

File tree

3 files changed

+13
-32
lines changed

3 files changed

+13
-32
lines changed

demos/benchmarks/android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<application
33
android:label="benchmarks"
44
android:name="${applicationName}"
5-
android:icon="@mipmap/ic_launcher">
5+
android:icon="@mipmap/ic_launcher"
6+
android:usesCleartextTraffic="true">
67
<activity
78
android:name=".MainActivity"
89
android:exported="true"
@@ -30,6 +31,7 @@
3031
<meta-data
3132
android:name="flutterEmbedding"
3233
android:value="2" />
34+
3335
</application>
3436
<!-- Required to query activities that can process text, see:
3537
https://developer.android.com/training/package-visibility and
@@ -42,4 +44,6 @@
4244
<data android:mimeType="text/plain"/>
4345
</intent>
4446
</queries>
47+
48+
<uses-permission android:name="android.permission.INTERNET"/>
4549
</manifest>

demos/benchmarks/lib/widgets/benchmark_items_page.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ class _BenchmarkItemsWidgetState extends State<BenchmarkItemsWidget> {
101101
"Busy with sync... ${syncDuration.inMilliseconds}ms / $count operations"));
102102
}
103103

104+
final latencies =
105+
_data.map((e) => e.latency).where((e) => e != null).toList();
106+
final totalLatency = latencies.fold(0, (a, b) => a + b!.inMicroseconds);
107+
final averageLatencyMicros =
108+
latencies.isNotEmpty ? totalLatency / latencies.length : 0;
109+
final latencyString = (averageLatencyMicros / 1000.0).toStringAsFixed(1);
110+
104111
final clearButton = TextButton.icon(
105112
label: const Text('Delete all'),
106113
onPressed: () {
@@ -157,7 +164,7 @@ class _BenchmarkItemsWidgetState extends State<BenchmarkItemsWidget> {
157164
overflowSpacing: 8.0,
158165
children: <Widget>[
159166
Text(
160-
'First sync duration: ${syncDuration.inMilliseconds}ms / $count operations'),
167+
'First sync duration: ${syncDuration.inMilliseconds}ms / $count operations / ${latencyString}ms latency'),
161168
create100,
162169
create1000,
163170
resyncButton,

demos/benchmarks/test/widget_test.dart

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)