campanja/folsomite — pull request #2 by arcusfelis (2013-07-06 17:35:21+00:00)
Title: Fixed issues with unkown metric types

Hi,
I fixed crashes, caused by unknown metric types (see `folsomite_server:expand_metric/2`).

Fixed errors (from lager's log):
```
2013-07-06 18:05:54.434 [error] <0.745.0> Supervisor folsomite_sup had
child folsomite_server started with folsomite_server:start_link() at
<0.768.0> exit with reason no function clause matching
folsomite_server:a2l(<<"muc.localhost">>) line 154 in context
child_terminated

2013-07-06 18:16:09.100 [error] <0.750.0> CRASH REPORT Process
folsomite_server with 0 neighbours exited with reason: no function clause
matching zeta:ev("ejabberd muc.localhost modRosterGets", []) line 36 in
gen_server:terminate/6 line 747
```

The same errors with stacktraces (SASL):
```
2013-07-06 18:00:54 =ERROR REPORT====
** Generic server folsomite_server terminating
** Last message in was {timeout,#Ref<0.0.0.10935>,'#flush'}
** When Server state == {state,60000,[folsomite],"ejabberd_localhost","ejabberd",#Ref<0.0.0.10935>}
** Reason for termination ==
** {function_clause,[{folsomite_server,a2l,[<<"muc.localhost">>],[{file,"src/folsomite_server.erl"},{line,154}]},{folsomite_server,'-a2l/1-lc$^0/1-0-',1,[{file,"src/folsomite_server.erl"},{line,158}]},{folsomite_server,a2l,1,[{file,"src/folsomite_server.erl"},{line,158}]},{lists,map,2,[{file,"lists.erl"},{line,1173}]},{folsomite_server,expand,2,[{file,"src/folsomite_server.erl"},{line,115}]},{folsomite_server,expand0,2,[{file,"src/folsomite_server.erl"},{line,108}]},{lists,flatmap,2,[{file,"lists.erl"},{line,1184}]},{folsomite_server,get_stats,0,[{file,"src/folsomite_server.erl"},{line,89}]}]}
2013-07-06 18:00:54 =CRASH REPORT====
crasher:
initial call: folsomite_server:init/1
pid: <0.747.0>
registered_name: folsomite_server
exception exit: {{function_clause,[{folsomite_server,a2l,[<<"muc.localhost">>],[{file,"src/folsomite_server.erl"},{line,154}]},{folsomite_server,'-a2l/1-lc$^0/1-0-',1,[{file,"src/folsomite_server.erl"},{line,158}]},{folsomite_server,a2l,1,[{file,"src/folsomite_server.erl"},{line,158}]},{lists,map,2,[{file,"lists.erl"},{line,1173}]},{folsomite_server,expand,2,[{file,"src/folsomite_server.erl"},{line,115}]},{folsomite_server,expand0,2,[{file,"src/folsomite_server.erl"},{line,108}]},{lists,flatmap,2,[{file,"lists.erl"},{line,1184}]},{folsomite_server,get_stats,0,[{file,"src/folsomite_server.erl"},{line,89}]}]},[{gen_server,terminate,6,[{file,"gen_server.erl"},{line,747}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
ancestors: [folsomite_sup,<0.743.0>]

2013-07-06 18:16:09 =ERROR REPORT====
** Generic server folsomite_server terminating
** Last message in was {timeout,#Ref<0.0.0.10941>,'#flush'}
** When Server state == {state,60000,[folsomite],"ejabberd_localhost","ejabberd",#Ref<0.0.0.10941>}
** Reason for termination ==
** {function_clause,[{zeta,ev,["ejabberd muc.localhost modRosterGets",[]],[{file,"src/zeta.erl"},{line,36}]},{zeta,ev,2,[{file,"src/zeta.erl"},{line,37}]},{zeta,ev,4,[{file,"src/zeta.erl"},{line,60}]},{zeta,ev,4,[{file,"src/zeta.erl"},{line,66}]},{folsomite_server,'-send_stats/1-lc$^0/1-0-',3,[{file,"src/folsomite_server.erl"},{line,127}]},{folsomite_server,'-send_stats/1-lc$^0/1-0-',3,[{file,"src/folsomite_server.erl"},{line,128}]},{folsomite_server,send_stats,1,[{file,"src/folsomite_server.erl"},{line,127}]},{timer,tc,1,[{file,"timer.erl"},{line,165}]}]}
2013-07-06 18:16:09 =CRASH REPORT====
crasher:
initial call: folsomite_server:init/1
pid: <0.750.0>
registered_name: folsomite_server
exception exit: {{function_clause,[{zeta,ev,["ejabberd muc.localhost modRosterGets",[]],[{file,"src/zeta.erl"},{line,36}]},{zeta,ev,2,[{file,"src/zeta.erl"},{line,37}]},{zeta,ev,4,[{file,"src/zeta.erl"},{line,60}]},{zeta,ev,4,[{file,"src/zeta.erl"},{line,66}]},{folsomite_server,'-send_stats/1-lc$^0/1-0-',3,[{file,"src/folsomite_server.erl"},{line,127}]},{folsomite_server,'-send_stats/1-lc$^0/1-0-',3,[{file,"src/folsomite_server.erl"},{line,128}]},{folsomite_server,send_stats,1,[{file,"src/folsomite_server.erl"},{line,127}]},{timer,tc,1,[{file,"timer.erl"},{line,165}]}]},[{gen_server,terminate,6,[{file,"gen_server.erl"},{line,747}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
ancestors: [folsomite_sup,<0.743.0>]
```