Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5ad308b
commit
buenaflor Apr 18, 2024
7bc756b
Merge branch 'main' into feat/app-start-improve
buenaflor Apr 23, 2024
3e0790a
Update
buenaflor Apr 23, 2024
d0eb540
Remove print
buenaflor Apr 23, 2024
05c208c
Remove comments
buenaflor Apr 23, 2024
c796b71
Update
buenaflor Apr 24, 2024
da8297e
Merge branch 'main' into feat/app-start-improve
buenaflor Apr 24, 2024
bdc8588
Add linting
buenaflor Apr 24, 2024
d1b37cd
Update CHANGELOG
buenaflor Apr 24, 2024
6f44478
Update CHANGELOG.md
buenaflor Apr 24, 2024
8051972
Update naming
buenaflor Apr 24, 2024
29671ff
Merge branch 'main' into feat/app-start-improve
buenaflor Apr 24, 2024
b401ed0
Update naming
buenaflor Apr 24, 2024
c06973c
Update naming
buenaflor Apr 24, 2024
2bb3887
Update description from first frame render to initial frame render
buenaflor Apr 24, 2024
3aadc19
Initial
buenaflor Apr 25, 2024
86bc3bf
Merge branch 'feat/app-start-improve' into feat/app-start-native-spans
buenaflor Apr 25, 2024
801483e
update
buenaflor Apr 26, 2024
d28af71
dart format
buenaflor Apr 26, 2024
21c61a6
Update comments
buenaflor Apr 26, 2024
88a8819
Update
buenaflor Apr 26, 2024
0d73052
Update
buenaflor Apr 26, 2024
1e05ae5
Update
buenaflor Apr 26, 2024
73d830a
Update
buenaflor Apr 26, 2024
62cb2be
Update
buenaflor Apr 26, 2024
111125c
Fix tests
buenaflor Apr 29, 2024
04ad023
Fix test
buenaflor Apr 29, 2024
e9e95c4
Add unused import
buenaflor Apr 29, 2024
bb785b6
Merge branch 'feat/app-start-improve' into feat/app-start-native-spans
buenaflor Apr 29, 2024
d0ce3a4
Fix tests
buenaflor Apr 29, 2024
b22a9c0
Update
buenaflor May 2, 2024
d4c6b1a
Updaet
buenaflor May 2, 2024
06325a2
Update
buenaflor May 3, 2024
bc7ba9e
Update
buenaflor May 3, 2024
4367089
Merge branch 'main' into feat/app-start-native-spans
buenaflor May 6, 2024
a847325
Update CHANGELOG
buenaflor May 6, 2024
7703c4e
Update CHANGELOG
buenaflor May 6, 2024
4ae3212
Update formatting of kotlin file
buenaflor May 6, 2024
342b518
Update
buenaflor May 6, 2024
7a1084f
Update test
buenaflor May 6, 2024
16303bd
format
buenaflor May 6, 2024
20e595f
Update SentryFlutterPlugin.kt
buenaflor May 6, 2024
0cf5d12
Update SentryFlutterPlugin.kt
buenaflor May 6, 2024
2820fc8
Update
buenaflor May 6, 2024
c122240
Update main.dart
buenaflor May 6, 2024
939ed17
Merge branch 'main' into feat/app-start-native-spans
buenaflor May 8, 2024
cdad9a8
Update
buenaflor May 8, 2024
ffb3695
Update
buenaflor May 8, 2024
e3197a7
Update
buenaflor May 8, 2024
427d516
Updaet
buenaflor May 8, 2024
ab63c3b
Format
buenaflor May 8, 2024
93b4516
Update flutter/lib/src/sentry_flutter.dart
buenaflor May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update naming
  • Loading branch information
buenaflor committed Apr 24, 2024
commit c06973c5201e038de97aa01e4603a4effa823e4e
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

private var activity: WeakReference<Activity>? = null
private var framesTracker: ActivityFramesTracker? = null
private var engineEndTime: Long? = null
private var engineReadyEndtime: Long? = null

override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
engineEndTime = System.currentTimeMillis()
engineReadyEndtime = System.currentTimeMillis()

context = flutterPluginBinding.applicationContext
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "sentry_flutter")
Expand Down Expand Up @@ -149,7 +149,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
}

private fun fetchEngineReadyEndtime(result: Result) {
result.success(engineEndTime)
result.success(engineReadyEndtime)
}

private fun beginNativeFrames(result: Result) {
Expand Down
6 changes: 3 additions & 3 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
#endif
}

private static var engineEndtime: Int64 = 0
private static var engineReadyEndtime: Int64 = 0

public static func register(with registrar: FlutterPluginRegistrar) {
let currentDate = Date()
let timeInterval = currentDate.timeIntervalSince1970
engineEndtime = Int64(timeInterval * 1000)
engineReadyEndtime = Int64(timeInterval * 1000)

#if os(iOS)
let channel = FlutterMethodChannel(name: "sentry_flutter", binaryMessenger: registrar.messenger())
Expand Down Expand Up @@ -86,7 +86,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
}

private func fetchEngineReadyEndtime(result: @escaping FlutterResult) {
result(SentryFlutterPluginApple.engineEndtime)
result(SentryFlutterPluginApple.engineReadyEndtime)
}

// swiftlint:disable:next cyclomatic_complexity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ class NativeAppStartIntegration extends Integration<SentryFlutterOptions> {
_native.appStartEnd ??= options.clock();
final appStartEnd = _native.appStartEnd;
final nativeAppStart = await _native.fetchNativeAppStart();
final engineEndtime = await _native.fetchEngineReadyEndtime();
final engineReadyEndtime = await _native.fetchEngineReadyEndtime();
final dartLoadingEnd = SentryFlutter.dartLoadingEnd;

if (nativeAppStart == null ||
appStartEnd == null ||
engineEndtime == null) {
engineReadyEndtime == null) {
return;
}

final appStartDateTime = DateTime.fromMillisecondsSinceEpoch(
nativeAppStart.appStartTime.toInt());
final duration = appStartEnd.difference(appStartDateTime);
final engineEndDatetime =
DateTime.fromMillisecondsSinceEpoch(engineEndtime);
DateTime.fromMillisecondsSinceEpoch(engineReadyEndtime);

// We filter out app start more than 60s.
// This could be due to many different reasons.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ void main() {
});

test('have correct endTimestamp', () async {
final engineEndtime = await fixture.native.fetchEngineReadyEndtime();
final engineReadyEndtime = await fixture.native.fetchEngineReadyEndtime();
expect(coldStartSpan?.endTimestamp, fixture.native.appStartEnd?.toUtc());
expect(engineReadySpan?.endTimestamp,
DateTime.fromMillisecondsSinceEpoch(engineEndtime!).toUtc());
DateTime.fromMillisecondsSinceEpoch(engineReadyEndtime!).toUtc());
expect(dartIsolateLoadingSpan?.endTimestamp,
SentryFlutter.dartLoadingEnd.toUtc());
expect(firstFrameRenderSpan?.endTimestamp, coldStartSpan?.endTimestamp);
Expand Down