# quick'n'dirty
def diff_gc(first_gc, second_gc)
# add custom field
[first_gc, second_gc].each { |gc| gc[:allocated] = gc[:total_allocated_object] - gc[:total_freed_object] }
# get data
first_gc.keys.map do |key|
before = first_gc[key]
after = second_gc[key]
diff = after - before
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
#!/bin/sh | |
# | |
# StatsD | |
# | |
# chkconfig: 3 50 50 | |
# description: StatsD init.d | |
. /lib/lsb/init-functions | |
desc=statsd | |
STATSDDIR=/opt/statsd |
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 'allocation_stats | |
stats = AllocationStats.trace { Project.last.as_json }; | |
puts stats.allocations(alias_paths: true).at_least(5).group_by(:sourcefile, :sourceline, :class_plus).sort_by_count.to_text | |
# |
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
proxy_set_header Host $http_host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; |
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
# prompt with more informations when set -x | |
export PS4='+$(/bin/date +"%Y/%m/%d-%T%z"):[$(which $(sed -n -r "${LINENO}s/^[[:space:]]*([^[:space:]]+).*/\1/p" "${BASH_SOURCE}"))]:${BASH_SOURCE}:${LINENO}:${FUNCNAME}: ' |
I hereby claim:
- I am cbliard on github.
- I am cbliard (https://keybase.io/cbliard) on keybase.
- I have a public key ASCdMBCKni_k6tH61HSuEb3chkgXX-7GeBpT4GQ8mBzhrQo
To claim this, I am signing this object: