Currently bear is focused on use inside the Folsom Erlang metrics library but all of these functions are generic and useful in other situations.
Pull requests accepted!
a set of statistics functions for erlang
License: Apache License 2.0
It is sometimes very useful to have it on hand without need to recalculate it from histogram
The line #287 in ranks_of/5 is never executed, bad pattern matching issue.
Bear doesn't appear to have any tag of any kind so 'git describe' fails. For it to be included into a riak release, we need something we can describe.
Now I'm in trouble for breaking all the Basho builds by including folsom (and therefore bear) as a dep for riak. Would it be possible for you to tag the current version of bear to save me the trouble of maintaining a fork just to have a tag?
If I start a histogram and log a series of 0's to it, I get the following error:
{pushysim@128.0.0.1)7>folsom_metrics:new_histogram('bar', slide, 10).
(pushysim@127.0.0.1)8> folsom_metrics:notify({'bar',0}).
ok
(pushysim@127.0.0.1)9> folsom_metrics:notify({'bar',0}).
ok
(pushysim@127.0.0.1)10> folsom_metrics:notify({'bar',0}).
ok
(pushysim@127.0.0.1)11> folsom_metrics:notify({'bar',0}).
ok
(pushysim@127.0.0.1)12> folsom_metrics:notify({'bar',0}).
ok
(pushysim@127.0.0.1)13> folsom_metrics:notify({'bar',0}).
ok
(pushysim@127.0.0.1)14> folsom_metrics:get_histogram_statistics('bar').
** exception error: bad argument in an arithmetic expression
in function bear:harmonic_mean/1
in call from bear:get_statistics/1
in call from lists:seq/2
The quick fix would be to add a new fun-head of
harmonic_mean(#scan_result{sumInv=0}) ->
0;
But not sure what the return value should be - 0, infinity ? Thoughts ?
https://github.com/boundary/bear/blob/master/src/bear.erl#L316 seems to be the culprit.
I'm posting this issue for discussion. It is reasonable to argue that there should never be a negative reading. In which case…should I
bad arg
negative histogram readings (leaving it up to the user to detect and drop / correct / handle appropriately) negative readings?For me, folsom histogram bad arg
ing negative readings is the most logical, but somewhat interface breaking.
I'm just after your thoughts / input on the best location to solve this problem.
Since bear declares a flag to compile with HiPE support, it's surprise that it doesn't works:
$ ./rebar eunit
==> bear (eunit)
Compiled test/bear_test.erl
Compiled src/bear.erl
...
bear_test: negative2_test...*failed*
in function bear:get_statistics_subset/2
called as get_statistics_subset([-1,-1,-2,-2,-3,-5,-6,-10],[min])
in call from bear_test:negative2_test/0 (test/bear_test.erl, line 284)
in call from bear_test:negative2_test/0
**error:undef
=ERROR REPORT==== 7-May-2015::14:36:54 ===
Native loading of /home/kxepal/projects/forks/bear/.eunit/bear.beam failed: {'EXIT',
{badarg,
[{hipe_bifs,
patch_call,
[1079926198,
140635773809724,
[]],
[]},
{hipe_unified_loader,
patch_call_insn,
3,
[{file,
"hipe_unified_loader.erl"},
{line,
507}]},
{hipe_unified_loader,
patch_bif_call_list,
4,
[{file,
"hipe_unified_loader.erl"},
{line,
492}]},
{hipe_unified_loader,
patch_call,
5,
[{file,
"hipe_unified_loader.erl"},
{line,
483}]},
{hipe_unified_loader,
patch,
5,
[{file,
"hipe_unified_loader.erl"},
{line,
458}]},
{hipe_unified_loader,
load_common,
4,
[{file,
"hipe_unified_loader.erl"},
{line,
235}]},
{hipe_unified_loader,
load_native_code,
2,
[{file,
"hipe_unified_loader.erl"},
{line,
105}]},
{code_server,
load_native_code,
2,
[{file,
"code_server.erl"},
{line,
1294}]}]}}
undefined
*** test module not found ***
**bear
=======================================================
Failed: 46. Skipped: 0. Passed: 1.
One or more tests were cancelled.
ERROR: Cover analyze failed for bear: {not_cover_compiled,bear} "/home/kxepal/projects/forks/bear/.eunit/bear.beam"
ERROR: eunit failed while processing /home/kxepal/projects/forks/bear: {'EXIT',
{function_clause,
[{rebar_eunit,'-cover_write_index/2-fun-0-',[{0,0},[bear]],[]},
{lists,partition,4,[{file,"lists.erl"},{line,1300}]},
{rebar_eunit,cover_write_index,2,[]},
{rebar_eunit,cover_analyze,3,[]},
{rebar_eunit,eunit,2,[]},
{rebar_core,run_modules,4,[]},
{rebar_core,execute,4,[]},
{rebar_core,process_dir,4,[]}]}}
This repo is forked and likely unmaintained.
I no longer have access the folsom related projects and it seems like I probably won't in the near future. To continue maintaining them I have moved the project to https://github.com/folsom-project Please update your projects.
Is it possible to create a 0.8.2 tag which includes this PR: #19?
It would be nice to also bump up Folsoms use of Bear to this one as well
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.