@@ -46,19 +46,28 @@ defmodule Sentry.ClientReportTest do
4646
4747 assert :ok = Sender . record_discarded_events ( :before_send , events , :test_client_report )
4848
49- assert :sys . get_state ( :test_client_report ) == % { { :before_send , "error" } => 2 }
49+ assert :sys . get_state ( :test_client_report ) == % {
50+ { :before_send , "error" } => 1 ,
51+ { :before_send , "transaction" } => 1
52+ }
5053
5154 assert :ok = Sender . record_discarded_events ( :before_send , events , :test_client_report )
5255
53- assert :sys . get_state ( :test_client_report ) == % { { :before_send , "error" } => 4 }
56+ assert :sys . get_state ( :test_client_report ) == % {
57+ { :before_send , "error" } => 2 ,
58+ { :before_send , "transaction" } => 2
59+ }
5460
5561 assert :ok = Sender . record_discarded_events ( :event_processor , events , :test_client_report )
5662 assert :ok = Sender . record_discarded_events ( :network_error , events , :test_client_report )
5763
5864 assert :sys . get_state ( :test_client_report ) == % {
59- { :before_send , "error" } => 4 ,
60- { :event_processor , "error" } => 2 ,
61- { :network_error , "error" } => 2
65+ { :before_send , "error" } => 2 ,
66+ { :before_send , "transaction" } => 2 ,
67+ { :event_processor , "error" } => 1 ,
68+ { :event_processor , "transaction" } => 1 ,
69+ { :network_error , "error" } => 1 ,
70+ { :network_error , "transaction" } => 1
6271 }
6372
6473 send ( Process . whereis ( :test_client_report ) , :send_report )
@@ -70,9 +79,12 @@ defmodule Sentry.ClientReportTest do
7079 decode_envelope! ( body )
7180
7281 assert client_report [ "discarded_events" ] == [
73- % { "reason" => "before_send" , "category" => "error" , "quantity" => 4 } ,
74- % { "reason" => "event_processor" , "category" => "error" , "quantity" => 2 } ,
75- % { "reason" => "network_error" , "category" => "error" , "quantity" => 2 }
82+ % { "category" => "error" , "quantity" => 2 , "reason" => "before_send" } ,
83+ % { "category" => "transaction" , "quantity" => 2 , "reason" => "before_send" } ,
84+ % { "category" => "error" , "quantity" => 1 , "reason" => "event_processor" } ,
85+ % { "category" => "transaction" , "quantity" => 1 , "reason" => "event_processor" } ,
86+ % { "category" => "error" , "quantity" => 1 , "reason" => "network_error" } ,
87+ % { "category" => "transaction" , "quantity" => 1 , "reason" => "network_error" }
7688 ]
7789
7890 assert client_report [ "timestamp" ] =~ ~r/ ^\d {4}-\d {2}-\d {2}T\d {2}:\d {2}:\d {2}$/
0 commit comments