Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Efficiency Updates / Distribution & Aggregation / Timing calls/funs #4

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c937020
Updates: don't serialize through process, use "double buffer" methodo…
Jul 20, 2012
bd35779
Support a master node, which aggregates stats
Jul 25, 2012
6686af9
Fixes for master node implementation
Jul 25, 2012
5a30041
Add UDP server support
Nov 29, 2012
e012987
Basic protocol implementation
Nov 29, 2012
085fc79
Remove unused files.
Nov 29, 2012
a9d2333
estatsd cluster upgrade
Dec 4, 2012
b821905
Utils necessary for the previous patch
Dec 4, 2012
1a37bbc
Also, the header file with necessary definitions
Dec 4, 2012
d6d98fa
Include release directory
Dec 6, 2012
683886b
Include rebar.config too!
Dec 6, 2012
4eb22cc
R15B compatibility fixes
Dec 6, 2012
ce1a1a6
Default destination; no default peers
Dec 6, 2012
a21a81f
Correcting version.
Dec 6, 2012
873b4bd
Tagging support.
Dec 20, 2012
ff1ffbb
Fix: vm_metrics reporting when disabled
Dec 21, 2012
aa8e544
Warning cleanup
Dec 21, 2012
f4cd8ad
Update version: 1.0.0 -> 1.1.0
Dec 21, 2012
0907530
Make TCP ports configurable.
Dec 21, 2012
e170e4b
Fix: vm metric keys should be atoms
Jan 10, 2013
9b18b15
Fixed handling of ranch, it's now a dep instead of manually started.
Licenser Jan 20, 2013
4d8346b
Removed rel file so this can live happiely in another applicaiton.
Licenser Jan 20, 2013
daf5305
Merge pull request #2 from Licenser/master
soup-in-boots Jan 21, 2013
57ebfbb
Standalone service instructions
soup-in-boots Jan 21, 2013
fd83160
Support sample rates on counters
Feb 12, 2013
e00ddb0
Release: 1.1.4
Feb 12, 2013
43fbbdf
Bug fixes
Feb 13, 2013
1f9a382
Use same tree structures as newer statsd servers
Feb 13, 2013
69ebaed
Optimize timings
Mar 25, 2013
e994e4f
Correct parsing and aggregation for new timer methods
Mar 25, 2013
1f4c6ce
Minor bugfix
Mar 26, 2013
1f067a6
Release: 1.2.1
Mar 26, 2013
f477137
Release 1.2.2
Mar 27, 2013
8963198
Update README.txt
soup-in-boots Mar 28, 2013
993d946
Rename README.txt to README.md
soup-in-boots Mar 28, 2013
2fc5c13
Update README.md
soup-in-boots Mar 28, 2013
0d6b696
Segment support
soup-in-boots Jul 31, 2013
b9f86d3
Fix gauge accumulation
Oct 28, 2013
abcb865
Whitespace cleanup
Oct 28, 2013
8ce7bb0
RELEASE 1.3.1
Oct 28, 2013
8a5a885
Update ranch from 0.4.0 to 0.8.4
Nov 22, 2013
d403c22
RELEASE 1.3.2
Nov 22, 2013
a662f56
Enable timing samples via UDP protocol
Jan 3, 2014
d45c5f9
RELEASE 1.3.3
Jan 3, 2014
d06998f
RELEASE 1.3.4
May 13, 2014
f25af05
Add support for HTTP post for HostedGraphite
Jan 19, 2015
ee107f8
Support floats for timing values over UDP
Jan 19, 2015
a892ddc
code_change header was off
Jan 19, 2015
1c9deb2
RELEASE 1.3.5
Jan 19, 2015
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
Prev Previous commit
Next Next commit
Bug fixes
* Support integers for sample rate
* Add "other" clause to parse_value to prevent crashing
  when there's a badly encoded value.
  • Loading branch information
Zachary Hueras committed Feb 13, 2013
commit 43fbbdf9746c8505ef06748d9b1aa57f3cfb251c
2 changes: 1 addition & 1 deletion src/estatsd.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, estatsd,
[
{description, "Stats aggregation service that writes to graphite"},
{vsn, "1.1.4"},
{vsn, "1.1.5"},
{registered, []},
{applications, [
kernel,
14 changes: 12 additions & 2 deletions src/estatsd_listener.erl
Original file line number Diff line number Diff line change
@@ -54,13 +54,23 @@ parse_metric(Metric) ->
end.

parse_value(Key, Value) ->
case re:split(Value, ?COMPILE_ONCE("\\|"), [{return, list}]) of
case re:split(Value, ?COMPILE_ONCE("\\|"), [{return, list}, trim]) of
[N, "ms"] ->
estatsd:timing(Key, list_to_integer(N));
[N, "g"] ->
estatsd:gauge(Key, list_to_integer(N));
[N, "c"] ->
estatsd:increment(Key, list_to_integer(N));
[N, "c", [$@|Sample]] ->
estatsd:increment(Key, trunc(list_to_integer(N) / list_to_float(Sample)))
estatsd:increment(Key, trunc(list_to_integer(N) / parse_float(Sample)));
_Other ->
error_logger:error_msg("Bad Value: ~p | ~p", [Key, Value])
end.

parse_float(String) ->
FlatString = binary_to_list(iolist_to_binary(String)),
case string:to_float(FlatString) of
{error, no_float} -> list_to_integer(String);
{F, _Rest} -> F
end.