-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ttid/ttfd #1882
Closed
Closed
feat: ttid/ttfd #1882
Changes from 41 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
83626bd
test
buenaflor 1dbc007
draft impl for ttid
buenaflor f2668bb
poc
buenaflor 6a707da
use epoch
buenaflor 51d6c6d
remove duration
buenaflor 4c976b3
update
buenaflor 75a76fc
update poc
buenaflor 7f2ab85
update
buenaflor 16c5ca0
update
buenaflor 69e4d3e
update
buenaflor ab8bddc
working ttid and ttfd for non root app start navigations
buenaflor 7490a83
update
buenaflor c8f553f
refactor to navigator observer
buenaflor f0420ad
update
buenaflor 4da60a1
update
buenaflor 5db69e7
fix timestamps
buenaflor ab6abbf
update
buenaflor 2bfa150
refactor
buenaflor 0f1b10b
add tests
buenaflor bee35cf
update
buenaflor 18a3fdf
improve
buenaflor 07e67a3
update
buenaflor a3903f0
update
buenaflor 65626df
update
buenaflor 2928099
Fix tests
buenaflor 0c33885
Update origin and operation
buenaflor 00e7684
Improve code
buenaflor b3da58a
Improve code
buenaflor f888f83
Update
buenaflor 1478af3
Refactor ttfd
buenaflor b01c5d1
Refactor and fix tests
buenaflor 96b9f83
Add tests
buenaflor f535386
add ttid tracker tests
buenaflor 7a748b3
Update tests
buenaflor c17025b
Merge branch 'main' into feat/ttid-ttfd
buenaflor 852684d
fix
buenaflor ae62328
remove comments app start tracker
buenaflor d912922
fix tests
buenaflor 8f9c5da
add comments
buenaflor 67f622a
adjust test
buenaflor 011533d
try other test
buenaflor 9e7c1f0
format and fix test
buenaflor 1b25138
Merge branch 'main' into feat/ttid-ttfd
buenaflor 82b86fb
add comment
buenaflor aa42e95
exit early in app start event processor
buenaflor 25291cb
Apply review
buenaflor 32d3bc0
Update review
buenaflor 34033f9
remove debug label from framecallbackhandler
buenaflor 32faabf
pr improvements
buenaflor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:meta/meta.dart'; | ||
|
||
@internal | ||
class SentrySpanOperations { | ||
static const String uiLoad = 'ui.load'; | ||
static const String uiTimeToInitialDisplay = 'ui.load.initial_display'; | ||
static const String uiTimeToFullDisplay = 'ui.load.full_display'; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:flutter/scheduler.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
|
||
abstract class FrameCallbackHandler { | ||
void addPostFrameCallback(FrameCallback callback, {String debugLabel}); | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
class DefaultFrameCallbackHandler implements FrameCallbackHandler { | ||
@override | ||
void addPostFrameCallback(FrameCallback callback, | ||
{String debugLabel = 'callback'}) { | ||
WidgetsBinding.instance.addPostFrameCallback(callback); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
flutter/lib/src/integrations/app_start/app_start_tracker.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,41 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:meta/meta.dart'; | ||
|
||
import '../../../sentry_flutter.dart'; | ||
|
||
@internal | ||
class AppStartInfo { | ||
final DateTime start; | ||
final DateTime end; | ||
final SentryMeasurement measurement; | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
AppStartInfo(this.start, this.end, this.measurement); | ||
} | ||
|
||
@internal | ||
class AppStartTracker { | ||
static final AppStartTracker _instance = AppStartTracker._internal(); | ||
factory AppStartTracker() => _instance; | ||
AppStartTracker._internal(); | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Completer<AppStartInfo?> _appStartCompleter = Completer<AppStartInfo?>(); | ||
AppStartInfo? _appStartInfo; | ||
|
||
void setAppStartInfo(AppStartInfo? appStartInfo) { | ||
_appStartInfo = appStartInfo; | ||
if (!_appStartCompleter.isCompleted) { | ||
_appStartCompleter.complete(appStartInfo); | ||
} else { | ||
_appStartCompleter = Completer<AppStartInfo?>(); | ||
_appStartCompleter.complete(appStartInfo); | ||
} | ||
stefanosiano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
Future<AppStartInfo?> getAppStartInfo() { | ||
if (_appStartInfo != null) { | ||
return Future.value(_appStartInfo); | ||
} | ||
return _appStartCompleter.future; | ||
} | ||
} |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m
: This seems to be a duplicate state ofSentryNative.didFetchAppStart
. It would be better to only store the state once if we already got the app start or added it as a measurement. Why did we add this flag?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because
SentryNative.didFetchAppStart
doesn't tell us 'we've already added this measurement to the transaction`since the event processor is always run for every event checking
if (didFetchAppStart == true)
and then adding the measurement would mean we are always adding measurement because after the app start it's always true.