Skip to content

Commit

Permalink
remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Sep 10, 2024
1 parent 6ae5a65 commit 24d43f6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 51 deletions.
3 changes: 2 additions & 1 deletion flutter/lib/src/integrations/native_app_start_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ class _AppStartInfo {
}

class _TimeSpan {
_TimeSpan({required this.start, required this.end, required this.description});
_TimeSpan(
{required this.start, required this.end, required this.description});

final DateTime start;
final DateTime end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NativeAppStartIntegration extends Integration<SentryFlutterOptions> {
final FrameCallbackHandler _frameCallbackHandler;
final NativeAppStartHandler _nativeAppStartHandler;
DateTime? _appStartEnd;

/// This timestamp marks the end of app startup. Either set by calling
// ignore: deprecated_member_use_from_same_package
/// [SentryFlutter.setAppStartEnd]. The [SentryFlutterOptions.autoAppStart]
Expand Down
14 changes: 0 additions & 14 deletions flutter/lib/src/navigation/time_to_initial_display_tracker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ class TimeToInitialDisplayTracker {
);
}

Future<void> trackAppStart(ISentrySpan transaction,
{required DateTime startTimestamp,
required DateTime endTimestamp}) async {
await _trackTimeToInitialDisplay(
transaction: transaction,
startTimestamp: startTimestamp,
endTimestamp: endTimestamp,
origin: SentryTraceOrigins.autoUiTimeToDisplay,
);

// Store the end timestamp for potential use by TTFD tracking
_endTimestamp = endTimestamp;
}

Future<void> _trackTimeToInitialDisplay({
required ISentrySpan transaction,
required DateTime startTimestamp,
Expand Down
35 changes: 0 additions & 35 deletions flutter/test/navigation/time_to_initial_display_tracker_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,6 @@ void main() {
sut.clear();
});

group('app start', () {
test('tracking creates and finishes ttid span with correct measurements',
() async {
final endTimestamp =
fixture.startTimestamp.add(const Duration(milliseconds: 10));

final transaction =
fixture.getTransaction(name: 'root ("/")') as SentryTracer;
await sut.trackAppStart(transaction,
startTimestamp: fixture.startTimestamp, endTimestamp: endTimestamp);

final children = transaction.children;
expect(children, hasLength(1));

final ttidSpan = children.first;
expect(ttidSpan.context.operation,
SentrySpanOperations.uiTimeToInitialDisplay);
expect(ttidSpan.finished, isTrue);
expect(ttidSpan.context.description, 'root ("/") initial display');
expect(ttidSpan.origin, SentryTraceOrigins.autoUiTimeToDisplay);
expect(ttidSpan.startTimestamp, fixture.startTimestamp);
expect(ttidSpan.endTimestamp, endTimestamp);

final ttidMeasurement =
transaction.measurements['time_to_initial_display'];
expect(ttidMeasurement, isNotNull);
expect(ttidMeasurement?.unit, DurationSentryMeasurementUnit.milliSecond);
expect(
ttidMeasurement?.value,
ttidSpan.endTimestamp!
.difference(ttidSpan.startTimestamp)
.inMilliseconds);
});
});

group('regular route', () {
test(
'approximation tracking creates and finishes ttid span with correct measurements',
Expand Down

0 comments on commit 24d43f6

Please sign in to comment.