-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into robert/plat-11577_view_load_instrumentation_…
…updates
- Loading branch information
Showing
23 changed files
with
333 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
...s/fixture_resources/lib/scenarios/auto_instrument_navigation_with_view_load_scenario.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:mazerunner/main.dart'; | ||
|
||
import 'scenario.dart'; | ||
|
||
class AutoInstrumentNavigationWithViewLoadScenario extends Scenario { | ||
final _key = | ||
GlobalKey<_AutoInstrumentNavigationWithViewLoadScenarioScreenState>(); | ||
|
||
@override | ||
Future<void> run() async { | ||
setInstrumentsNavigation(true); | ||
setInstrumentsViewLoad(true); | ||
await startBugsnag(); | ||
setMaxBatchSize(1); | ||
} | ||
|
||
@override | ||
Widget? createWidget() { | ||
return AutoInstrumentNavigationWithViewLoadScenarioScreen( | ||
key: _key, | ||
runCommandCallback: () => runCommandCallback!(), | ||
); | ||
} | ||
|
||
@override | ||
RouteSettings? routeSettings() { | ||
return const RouteSettings(name: 'navigation_view_load_scenario'); | ||
} | ||
|
||
void step2() { | ||
_key.currentState!.setStage(2); | ||
} | ||
|
||
void step3() { | ||
_key.currentState!.setStage(3); | ||
} | ||
|
||
void step4() { | ||
_key.currentState!.setStage(4); | ||
} | ||
|
||
@override | ||
void invokeMethod(String name) { | ||
switch (name) { | ||
case 'step2': | ||
step2(); | ||
break; | ||
case 'step3': | ||
step3(); | ||
break; | ||
case 'step4': | ||
step4(); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
} | ||
|
||
class AutoInstrumentNavigationWithViewLoadScenarioScreen | ||
extends StatefulWidget { | ||
const AutoInstrumentNavigationWithViewLoadScenarioScreen({ | ||
super.key, | ||
required this.runCommandCallback, | ||
}); | ||
final void Function() runCommandCallback; | ||
|
||
@override | ||
State<AutoInstrumentNavigationWithViewLoadScenarioScreen> createState() => | ||
_AutoInstrumentNavigationWithViewLoadScenarioScreenState(); | ||
} | ||
|
||
class _AutoInstrumentNavigationWithViewLoadScenarioScreenState | ||
extends State<AutoInstrumentNavigationWithViewLoadScenarioScreen> { | ||
var _stage = 1; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GestureDetector( | ||
child: Container( | ||
color: Colors.white, | ||
child: MeasuredWidget( | ||
name: 'AutoInstrumentNavigationWithViewLoadWidget', | ||
builder: (context) => Row( | ||
children: [ | ||
if (_stage < 4) | ||
BugsnagLoadingIndicator( | ||
child: Column(children: [ | ||
if (_stage < 3) | ||
const BugsnagLoadingIndicator( | ||
child: Text('Still loading...'), | ||
), | ||
if (_stage < 2) | ||
const BugsnagLoadingIndicator( | ||
child: CircularProgressIndicator(), | ||
) | ||
]), | ||
), | ||
const Text( | ||
'AutoInstrumentNavigationWithViewLoadScenarioScreen') | ||
], | ||
), | ||
)), | ||
onTap: () => widget.runCommandCallback()); | ||
} | ||
|
||
void setStage(int stage) { | ||
setState(() { | ||
_stage = stage; | ||
}); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
features/fixture_resources/lib/scenarios/dart_io_traceparent_scenario.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:bugsnag_flutter_dart_io_http_client/bugsnag_flutter_dart_io_http_client.dart' | ||
as dartIo; | ||
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart'; | ||
import '../main.dart'; | ||
import 'scenario.dart'; | ||
|
||
class DartIoTraceparentScenario extends Scenario { | ||
@override | ||
Future<void> run() async { | ||
await startBugsnag(); | ||
setMaxBatchSize(1); | ||
dartIo.addSubscriber(bugsnag_performance.networkInstrumentation); | ||
final client = dartIo.HttpClient(); | ||
HttpClientRequest request = await client | ||
.getUrl(Uri.parse('${FixtureConfig.MAZE_HOST.toString()}/reflect')); | ||
await request.close(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
features/fixture_resources/lib/scenarios/http_client_trace_propagation_urls_scenario.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart'; | ||
import 'package:bugsnag_http_client/bugsnag_http_client.dart' as http; | ||
import '../main.dart'; | ||
import 'scenario.dart'; | ||
|
||
class HttpClientTracePropagationUrlsScenario extends Scenario { | ||
@override | ||
Future<void> run() async { | ||
await startBugsnag(tracePropagationUrls: [RegExp('dosend')]); | ||
setMaxBatchSize(1); | ||
http.addSubscriber(bugsnag_performance.networkInstrumentation); | ||
http.get( | ||
Uri.parse('${FixtureConfig.MAZE_HOST.toString()}/reflect?dontsend')); | ||
await Future.delayed(Duration(seconds: 1)); | ||
http.get(Uri.parse('${FixtureConfig.MAZE_HOST.toString()}/reflect?dosend')); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
features/fixture_resources/lib/scenarios/http_client_traceparent_scenario.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart'; | ||
import 'package:bugsnag_http_client/bugsnag_http_client.dart' as http; | ||
import '../main.dart'; | ||
import 'scenario.dart'; | ||
|
||
class HttpClientTraceparentScenario extends Scenario { | ||
@override | ||
Future<void> run() async { | ||
await startBugsnag(); | ||
setMaxBatchSize(1); | ||
http.addSubscriber(bugsnag_performance.networkInstrumentation); | ||
http.get(Uri.parse('${FixtureConfig.MAZE_HOST.toString()}/reflect')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.