debugCollectionEnabled property

bool debugCollectionEnabled

Whether block timings are collected and can be retrieved using the debugCollect method.

This is always false in release mode.

Implementation

static bool get debugCollectionEnabled => _collectionEnabled;
void debugCollectionEnabled=(bool value)

Enables metric collection.

Metric collection can only be enabled in non-release modes. It is most useful in profile mode where application performance is representative of a deployed application.

When disabled, resets collected data by calling debugReset.

Throws a StateError if invoked in release mode.

Implementation

static set debugCollectionEnabled(bool value) {
  if (kReleaseMode) {
    throw _createReleaseModeNotSupportedError();
  }
  if (value == _collectionEnabled) {
    return;
  }
  _collectionEnabled = value;
  debugReset();
}