Sha256: c4e38a04796647b3cd8277197b6f9720b15628ce29643a1f72dfde3d8fe043c2
Contents?: true
Size: 1.53 KB
Versions: 26
Compression:
Stored size: 1.53 KB
Contents
shared_examples "activesupport start finish override" do let(:instrumenter) { as.instrumenter } it "instruments start/finish events with payload on start ignores payload" do instrumenter.start("sql.active_record", :sql => "SQL") instrumenter.finish("sql.active_record", {}) expect(transaction).to include_event( "body" => "", "body_format" => Appsignal::EventFormatter::SQL_BODY_FORMAT, "count" => 1, "name" => "sql.active_record", "title" => "" ) end it "instruments an ActiveSupport::Notifications.start/finish event with payload on finish" do instrumenter.start("sql.active_record", {}) instrumenter.finish("sql.active_record", :sql => "SQL") expect(transaction).to include_event( "body" => "SQL", "body_format" => Appsignal::EventFormatter::SQL_BODY_FORMAT, "count" => 1, "name" => "sql.active_record", "title" => "" ) end it "does not instrument events whose name starts with a bang" do instrumenter.start("!sql.active_record", {}) instrumenter.finish("!sql.active_record", {}) expect(transaction).to_not include_events end context "when a transaction is completed in an instrumented block" do it "does not complete the ActiveSupport::Notifications.instrument event" do expect(transaction).to receive(:complete) instrumenter.start("sql.active_record", {}) Appsignal::Transaction.complete_current! instrumenter.finish("sql.active_record", {}) expect(transaction).to_not include_events end end end
Version data entries
26 entries across 26 versions & 1 rubygems