Rehearsal ----------------------------------------------
pool - 10 0.060000 0.000000 0.060000 ( 0.065491)
pool - 100 0.050000 0.000000 0.050000 ( 0.058047)
------------------------------------- total: 0.110000sec
user system total real
pool - 10 0.140000 0.000000 0.140000 ( 0.145850)
pool - 100 0.040000 0.000000 0.040000 ( 0.040523)
This file contains 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
# typed: false | |
# frozen_string_literal: true | |
# | |
# Log SQL calls that get made to stdout along with their backtrace with formatting | |
# | |
# Usage: | |
# LogSql.start | |
# ... | |
# <code with db calls you wish to log> | |
# ... |
This file contains 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
module Celluloid | |
module Supervision | |
class Container | |
# Manages a fixed-size pool of actors | |
# Delegates work (i.e. methods) and supervises actors | |
# Don't use this class directly. Instead use MyKlass.pool | |
class Pool | |
include Celluloid | |
trap_exit :__crash_handler__ |
This file contains 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
➜ celluloid git:(multiplex) ✗ ruby benchmarks/pool.rb | |
I, [2016-08-10T20:03:53.171191 #13540] INFO -- : Celluloid 0.17.5 is running in BACKPORTED mode. [ http://git.io/vJf3J ] | |
Celluloid::Group::Pool | |
Rehearsal ----------------------------------------------- | |
pool - 10 2.190000 0.110000 2.300000 ( 2.277025) | |
pool - 100 1.290000 0.060000 1.350000 ( 1.335328) | |
pool - 1000 2.090000 0.050000 2.140000 ( 2.130047) | |
-------------------------------------- total: 5.790000sec | |
user system total real |
This file contains 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "bundler/setup" | |
require "celluloid/autostart" | |
require "benchmark" | |
class Worker | |
include Celluloid |
This file contains 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "bundler/setup" | |
require "celluloid/autostart" | |
require "benchmark" | |
class Worker | |
include Celluloid |
This file contains 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 "logger" | |
require "thread" | |
require "timeout" | |
require "set" | |
$CELLULOID_DEBUG = false | |
$CELLULOID_MANAGED ||= false | |
require "celluloid/version" | |
require "celluloid/notices" |
This file contains 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
#!/usr/bin/env ruby | |
$LOAD_PATH.push File.expand_path("../../lib", __FILE__) | |
require "celluloid/autostart" | |
require "mathn" | |
# | |
# Basic spawn example | |
# |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'celluloid/autostart' | |
require 'benchmark' | |
message = :ohai |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'celluloid/autostart' | |
require 'benchmark' | |
message = :ohai |
NewerOlder