John Allspaw
Dr. Neil J. Gunther - http://perfdynamics.blogspot.com/2013/03/monitorama-2013-conference.html
Mathias Meyer
Cliff Moon
John E. Vincent
Writes completed in 26.395 seconds | |
800 total | |
765 acknowledged | |
770 survivors | |
5 unacknowledged writes found! ヽ(´ー`)ノ | |
(30 31 32 33 34) | |
0.95625 ack rate | |
0.0 loss rate | |
0.006535948 unacknowledged but successful rate |
SUITE_NAME=default | |
# create a bats subdirectory under your desired suite | |
mkdir -p test/integration/$SUITE_NAME/bats | |
# create an initial "canary" bats test file | |
# more examples at: | |
# * https://github.com/fnichol/chef-rvm/tree/master/test/integration/rubies/bats | |
# * https://github.com/fnichol/chef-ruby_build/tree/master/test/integration/alltherubies/bats | |
# * https://github.com/sstephenson/bats |
John Allspaw
Dr. Neil J. Gunther - http://perfdynamics.blogspot.com/2013/03/monitorama-2013-conference.html
Mathias Meyer
Cliff Moon
John E. Vincent
Some people think that configuration should not be "Turing complete"; others think the configuration language should be as expressive as possible--so much so that it amounts to a programming language itself.
I assert that configuration files which are not Turing complete (or, perhaps a more useful distinction, are not "sufficiently complex languages") are in practice extended to be that complex; and when that happens, the result is often more difficult to understand than if the language were more powerful to start with.
(setq ruby-deep-indent-paren nil) | |
(defadvice ruby-indent-line (after unindent-closing-paren activate) | |
(let ((column (current-column)) | |
indent offset) | |
(save-excursion | |
(back-to-indentation) | |
(let ((state (syntax-ppss))) | |
(setq offset (- column (current-column))) | |
(when (and (eq (char-after) ?\)) | |
(not (zerop (car state)))) |
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"route53:ChangeResourceRecordSets", | |
"route53:GetHostedZone", | |
"route53:ListResourceRecordSets" | |
], | |
"Effect": "Allow", | |
"Resource": [ |
# My take on Mike's source_for method. | |
# (see http://pragmaticstudio.com/blog/2013/2/13/view-source-ruby-methods) | |
# | |
# (1) I named it 'src' rather than source_for (ok, I'm a lazy typer). | |
# (2) The edit function was broken out as a separate function. | |
# (3) The edit function is for emacs | |
# (4) If the method is not defined on the object, and the object | |
# is a class, then see if it is an instance method on the class. | |
# | |
# The fourth point allows my to say: |
require 'connection_pool' | |
require 'redis' | |
require 'metriks' | |
class RedisClientWrapper | |
def initialize(options) | |
@options = options.delete(:pool) | |
@pool = ConnectionPool.new(@options) do | |
::Redis.new(options) | |
end |
It is generally desirable to group all the hosts for a specific service into a single dashboard view. For example, all the web servers are in single view while all the database servers are in another view.
This is usually not an issue when you are sending custom metrics using Riemann client. However, there are cases where you are using something that you do not control how the metrics are being sent. i.e., Riemann-tools.
Since Riemann-tools scripts are application agnostic, in order for the dashboard view to group hosts, we must inject some application specific information into the tags field. Tags is a collection of arbitrary strings. In the case of Riemann-tools scripts you can pass in arbitrary strings on the command line.
riemann-health --host 127.0.0.1 --tag "prod" --tag "webserver"
Jim Weirich:
This is how I explain it… Ruby has Procs and Lambdas. Procs are created with
Proc.new { }
, lambdas are created withlambda {}
and->() {}
.
In Ruby 1.8,
proc {}
creates lambda, and Ruby 1.9 it creates procs (don't ask).
Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.
This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.