Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Oct 23, 2023
1 parent cfc8bdb commit 84e1155
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:math';

import 'package:collection/collection.dart';
import 'package:meta/meta.dart';

import '../../shared/shared_model.dart';

Expand All @@ -18,6 +19,7 @@ typedef LeakSummaryCallback = void Function(LeakSummary);
typedef LeaksCallback = void Function(Leaks leaks);

/// Set of classes to ignore during leak tracking.
@immutable
class IgnoredLeaksSet {
/// Creates instance of [IgnoredLeaksSet].
///
Expand Down Expand Up @@ -114,6 +116,7 @@ class IgnoredLeaksSet {
}

/// The total set of ignored leaks for both [notGCed] and [notDisposed] leaks.
@immutable
class IgnoredLeaks {
const IgnoredLeaks({
this.notGCed = const IgnoredLeaksSet(),
Expand Down Expand Up @@ -167,6 +170,7 @@ class IgnoredLeaks {
/// Stacktrace and retaining path collection can seriously affect performance and memory footprint.
/// So, it is recommended to have them disabled for leak detection and to enable them
/// only for leak troubleshooting.
@immutable
class LeakDiagnosticConfig {
const LeakDiagnosticConfig({
this.collectRetainingPathForNotGCed = false,
Expand Down Expand Up @@ -280,6 +284,7 @@ class LeakTrackingConfig {
/// Leak tracking settings for a specific phase of the application execution.
///
/// Can be used to customize leak tracking for individual tests.
@immutable
class PhaseSettings {
const PhaseSettings({
this.ignoredLeaks = const IgnoredLeaks(),
Expand Down Expand Up @@ -340,6 +345,7 @@ int _mapHash(Map<String, int?> map) =>
Object.hash(Object.hashAll(map.keys), Object.hashAll(map.values));

/// Settings for measuring memory footprint.
@immutable
class MemoryBaselining {
const MemoryBaselining({
this.mode = BaseliningMode.measure,
Expand Down Expand Up @@ -381,6 +387,7 @@ enum BaseliningMode {

const defaultAllowedRssDeviation = 1.3;

@immutable
class MemoryBaseline {
const MemoryBaseline({
// TODO(polina-c): add SDK version after fixing https://github.com/flutter/flutter/issues/61814
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void _emptyLeakHandler(Leaks leaks) {}
///
/// If [LeakTesting.settings] are updated during a test run,
/// the new value will be used for the next test.
@immutable
class LeakTesting {
const LeakTesting._({
this.ignore = true,
Expand Down

0 comments on commit 84e1155

Please sign in to comment.