Skip to content

Instantly share code, notes, and snippets.

@thijsc
Created July 6, 2017 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thijsc/2ea4125fddc06ec454b766637671d9ba to your computer and use it in GitHub Desktop.
Save thijsc/2ea4125fddc06ec454b766637671d9ba to your computer and use it in GitHub Desktop.
Sequel standalone example
source 'https://rubygems.org'
gem 'sequel'
gem 'sqlite3'
gem 'appsignal'
require 'sequel'
require 'appsignal'
require 'fileutils'
ENV['APPSIGNAL_ACTIVE'] = 'true'
ENV['APPSIGNAL_APP_NAME'] = 'Sequel standalone'
ENV['APPSIGNAL_APP_ENV'] = 'development'
ENV['APPSIGNAL_PUSH_API_KEY'] = 'key'
Appsignal.start_logger
Appsignal.start
FileUtils.rm_f('database.db')
DB = Sequel.connect('sqlite://database.db')
DB.run("create table t (a text, b text)")
DB.run("insert into t values ('a', 'b')")
Appsignal.monitor_single_transaction(
"perform_job.query",
:class => "App",
:method => "perform"
) do
sleep 4
puts DB["select * from t"].to_a
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment