Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Performance metrics | |
| Name: `transaction_duration` /Measurement /`namespace`, `action` | |
| Exception metrics | |
| Name: `transaction_exception_count` /Counter /`namespace`, `action` | |
| Name: `transaction_exception_rate` /Gauge /`namespace`, `action` | |
| Queue duration metrics | |
| Name: `transaction_queue_duration` /Measurement /`namespace` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :database do | |
| task :current_visits => :environment do | |
| Appsignal.set_gauge("current_visits", CurrentVisit.count) | |
| end | |
| task :done do | |
| # Wait for data to flush | |
| Appsignal.stop | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Consumer that updates dashboards for an app | |
| # through the AppSignal GraphQL API. | |
| require 'rest-client' | |
| require 'active_support' | |
| require 'active_support/core_ext' | |
| APPID = '' # app/site id, can be found in the url (/sites/<id>) | |
| TOKEN = '' # Can be found on https://appsignal.com/users/edit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - | |
| title: 'Heroku Postres' | |
| graphs: | |
| - | |
| title: Connections | |
| kind: gauge | |
| format: number | |
| draw_null_as_zero: false | |
| fields: | |
| - active_connections |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.foo.insertMany([ | |
| { email: '[email protected]', course: 'a', purchaseDate: 10 }, | |
| { email: '[email protected]', course: 'b', purchaseDate: 20 }, | |
| { email: '[email protected]', course: 'c', purchaseDate: 5 }, | |
| { email: '[email protected]', course: 'c', purchaseDate: 6 }, | |
| { email: '[email protected]', course: 'b', purchaseDate: 10 }, | |
| { email: '[email protected]', course: 'a', purchaseDate: 5 }, | |
| { email: '[email protected]', course: 'd', purchaseDate: 1 }, | |
| { email: '[email protected]', course: 'd', purchaseDate: 1 }, | |
| { email: '[email protected]', course: 'a', purchaseDate: 1 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| let str = "000030.294"; | |
| let float: f32 = str.parse().unwrap(); | |
| println!("{:?}", float); | |
| } | |
| // Running this on a Raspberry Pi returns: | |
| //pi@raspberrypi ~ $ RUST_BACKTRACE=1 ./p1-monitor | |
| //0.000000000000000000000000000000000000000000042 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "appsignal" | |
| Appsignal.config = Appsignal::Config.new( | |
| File.expand_path(File.dirname(__FILE__)), | |
| "development" | |
| ) | |
| Appsignal.start | |
| class DailyProcessor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - | |
| title: 'Sidekiq Queues' | |
| graphs: | |
| - | |
| title: 'Sidekiq Queue count' | |
| kind: count | |
| filter: queue_(.+)_count | |
| format: number | |
| - | |
| title: 'Sidekiq Queue durations' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # config/initializers/sidekiq.rb | |
| require 'socket' | |
| class MemoryUsageMiddleware | |
| attr_reader :active, :max_oom, :shutdown | |
| cattr_reader :cached_mb, :last_checked_at, :hostname | |
| def self.start | |
| @@start ||= Time.now | |
| end |
NewerOlder