Sha256: 8d97bdff070544c99d38b5c5f2308ee13338fb6cee7661783efe513f64418283
Contents?: true
Size: 1.53 KB
Versions: 18
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 instrumenter.start("sql.active_record", {}) Appsignal::Transaction.complete_current! instrumenter.finish("sql.active_record", {}) expect(transaction).to_not include_events expect(transaction).to be_completed end end end
Version data entries
18 entries across 18 versions & 1 rubygems