Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
42387e8
Initial C extension implementation
csfrancis Mar 19, 2020
ddfce73
Enable warnings + pedantic flag and allow for easier debugging by set…
methodmissing Mar 21, 2020
37f71d2
Implement DatagramBuilder#generate_generic_datagram as a C function w…
methodmissing Mar 21, 2020
2c46dba
Introduce support for conditionally enabling GC.stress for the test s…
methodmissing Mar 21, 2020
5913e03
Prevent buffer overflows in DatagramBuilder#generate_generic_datagram…
methodmissing Mar 22, 2020
f0c9cec
Introduce a bounded cache for DatagramBuilder#normalize_tags used fro…
methodmissing Mar 22, 2020
86a26fe
Let the C ext be a prepended module as opposed to redefinition which …
methodmissing Mar 22, 2020
2272013
Let the normalized tags cache be a compile time option
methodmissing Mar 22, 2020
ab7b420
No need to memset the buffer to 0s for 4096 bytes on every call as we…
methodmissing Mar 22, 2020
ce81bbb
Also extract a bounded normalized metrics name cache (perhaps normali…
methodmissing Mar 22, 2020
84e28f1
The gist of this change is moving normalized caches to symbol tables …
methodmissing Mar 23, 2020
b7a19e8
Extract normalize_name_fast_path which is guaranteed to not do a func…
methodmissing Mar 24, 2020
430e72b
Fix warnings about losing integer precision
methodmissing Mar 26, 2020
be655a5
Introduce a fast path for sample rate Float and Fixnum types that pre…
methodmissing Mar 26, 2020
2200dec
Avoid Array alloc + concat for when both default and given tags are s…
methodmissing Mar 26, 2020
ef094cd
Hide #generate_generic_datagram and #normalize_name from Ruby and dir…
methodmissing Mar 26, 2020
1664789
Prefer a strhash table for the normalized names cache
methodmissing Mar 30, 2020
d60dbe1
Move the global string allocations to builder struct members instead
methodmissing Mar 30, 2020
a40d369
Perform the empty default tags predicate check on init
methodmissing Mar 30, 2020
16d6f14
Let append_normalized_tags prefer a bool return too
methodmissing Mar 30, 2020
666ff83
Explicitly set freed struct members and the builder to NULL in datagr…
methodmissing Apr 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ doc
*.gem
.bundle
Gemfile.lock
lib/statsd/instrument/ext/*
pkg/*
vendor/
tmp/*
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
require 'bundler/gem_tasks'
require 'rake/testtask'

GEMSPEC = eval(File.read('statsd-instrument.gemspec'))

require 'rake/extensiontask'
Rake::ExtensionTask.new('statsd', GEMSPEC) do |ext|
ext.ext_dir = 'ext/statsd'
ext.lib_dir = 'lib/statsd/instrument/ext'
end
task :build => :compile

Rake::TestTask.new('test') do |t|
t.ruby_opts << '-r rubygems'
t.libs << 'lib' << 'test'
t.test_files = FileList['test/**/*_test.rb']
end

task :test => :build

task default: :test
12 changes: 12 additions & 0 deletions ext/statsd/extconf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'mkmf'

append_cflags '-pedantic'
append_cflags '-Wall'
if ENV['STATSD_EXT_DEBUG']
append_cflags "-Og"
append_cflags '-ggdb3'
else
append_cflags "-O3"
end

create_makefile('statsd/statsd')
Loading