faro_dart 0.1.0 copy "faro_dart: ^0.1.0" to clipboard
faro_dart: ^0.1.0 copied to clipboard

Grafana Faro but for dart

faro_dart #

Grafana Faro, but for Dart (and flutter).

Usage #

See ./example/faro_dart_example.dart

Future<void> main() async {
  await Faro.init(
          (options) {
        var app = App("my-app", "0.0.1", "dev");

        options.collectorUrl = Uri.parse('https://your-collector.com/collector');
        options.meta = Meta(app: app);
      }
  );

  // push a log message
  Faro.pushLog("delay");

  // push a measurement
  Faro.pushMeasurement("delay", 2);

  // push an event
  Faro.pushEvent(Event("cta", attributes: {
    "foo": "bar",
  }));

  Faro.pushView("home");

  // push an error
  try {
    throw 'foo!';
  } catch (e, s) {
    Faro.pushError(e, stackTrace: s);
  }

  // pause recording
  await Faro.pause();

  // unpause recording
  await Faro.unpause();

  // force draining the buffer
  await Faro.drain();
}
1
likes
140
pub points
20%
popularity

Publisher

unverified uploader

Grafana Faro but for dart

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

http, meta, stack_trace, synchronized

More

Packages that depend on faro_dart