forceFlush method

  1. @override
Future<bool> forceFlush()
override

Force flush metrics through the associated exporter.

Returns true if the flush was successful, false otherwise.

Implementation

@override
Future<bool> forceFlush() async {
  if (_isShutdown) return false;
  final data = await collect();
  if (data.metrics.isNotEmpty) {
    await exporter.export(data);
  }
  return await exporter.forceFlush();
}