blib/lib/Sentry/Envelope.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 24 CC 1 SCAR 6.9
CC
1
Cov
0%
serialize
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Sentry::Envelope;
2 use Mojo::Base -base, -signatures;
3  
4 use Mojo::JSON qw(encode_json);
5  
6 has event_id => undef;
7 has headers => sub ($self) { {
8 event_id => $self->event_id,
9  
10 # sent_at => time
11 } };
12 has body => sub { {} };
13 has sample_rates => sub { [{ id => "client_rate", rate => "1" }] };
14 has type => 'transaction';
15 has item_headers =>
16 sub ($self) { { type => $self->type, sample_rates => $self->sample_rates } };
17  
18 sub serialize ($self) {
19 my @lines = ($self->headers, $self->item_headers, $self->body);
20 return join("\n", map { encode_json($_) } @lines);
21 }
22  
23 1;