SentryEnvelope.fromMetrics constructor

SentryEnvelope.fromMetrics(
  1. Map<int, Iterable<Metric>> metricsBuckets,
  2. SdkVersion sdkVersion, {
  3. String? dsn,
})

Create a SentryEnvelope containing one SentryEnvelopeItem which holds the Metric data.

Implementation

factory SentryEnvelope.fromMetrics(
  Map<int, Iterable<Metric>> metricsBuckets,
  SdkVersion sdkVersion, {
  String? dsn,
}) {
  return SentryEnvelope(
    SentryEnvelopeHeader(
      SentryId.newId(),
      sdkVersion,
      dsn: dsn,
    ),
    [SentryEnvelopeItem.fromMetrics(metricsBuckets)],
  );
}