File Coverage

blib/lib/Sentry/Envelope.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 15 16 93.7


line stmt bran cond sub pod time code
1             package Sentry::Envelope;
2 4     4   25 use Mojo::Base -base, -signatures;
  4         9  
  4         67  
3              
4 4     4   1408 use Mojo::JSON qw(encode_json);
  4         21  
  4         2005  
5              
6             has event_id => undef;
7             has headers => sub ($self) { { event_id => $self->event_id } };
8             has body => sub { {} };
9             has sample_rates => sub { [{ id => "client_rate", rate => "1" }] }; # FIXME
10             has type => 'transaction';
11             has item_headers =>
12             sub ($self) { { type => $self->type, sample_rates => $self->sample_rates } };
13              
14 10     10 0 16 sub serialize ($self) {
  10         18  
  10         14  
15 10         33 my @lines = ($self->headers, $self->item_headers, $self->body);
16 10         56 return join("\n", map { encode_json($_) } @lines);
  30         271  
17             }
18              
19             1;