-
Notifications
You must be signed in to change notification settings - Fork 120
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
exometer predefined only works when predefined list is empty. #70
Comments
I tried the following:
$ ERL_LIBS=`pwd`:`pwd`/test:`pwd`/deps erl
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.3 (abort with ^G)
1> application:ensure_all_started(exometer_core).
...
{ok,[syntax_tools,compiler,goldrush,lager,setup,bear,folsom,
exometer_core]}
11:10:11.707 [info] Application exometer_core started on node nonode@nohost
2> application:load(app1).
ok
3> application:set_env(app1,exometer_defaults,{consult,"$PRIV_DIR/exometer_defaults.eterm"}).
ok
4> application:set_env(app1,exometer_predefined,{script,"$PRIV_DIR/exometer_predefined.script"}).
ok
5> exometer_admin:register_application(app1).
ok
6> exometer:find_entries([]).
[{[c,1],counter,enabled}]
7> ets:tab2list(exometer_shared).
[{exometer_entry,{default,histogram,[h,'']},
histogram,undefined,exometer_histogram,1,0,undefined,
undefined,[],undefined}] What I can imagine is happening is that exometer processes your If you are unsure about whether the predef file gets loaded more than once, and you don't want to manually check before registering, you can use An obvious improvement would of course be that exometer recognizes that it's already registered the application at startup. |
There is also a general improvement of helping end user to know what has gone wrong inside exometer_core. For example there are multiple places from exomerter_core that generates {error, unsupported} if user who needs to write their own reporter. But what causes those are like a wild hunt. |
Agreed. PRs are welcome. ;-) |
Try to define configs outside of sys.config. The defaults seems to pass but predefined does not except empty. Following is the sys.config; and error trace. A dump of the ets provided at the end.
lager_test is an empty erlang application. exometer_core and lager also added to application source.
In erlang shell:
Steps:
application:ensure_all_started(lager_test) (see error log at bottom). <<<<< ERROR
Config files:
sys.config:
exometer_defaults.config:
exometer_predefined.config <<<<<<<<<< only works when exometer_predefined is empty list.
Error:
A dump of ets:
([email protected])12> ets:i().
id name type size mem owner
1 code set 374 25013 code_server
4098 code_names set 64 8421 code_server
8206 cookies set 0 299 auth
12305 shell_records ordered_set 0 89 <0.33.0>
ac_tab ac_tab set 48 3871 application_controller
file_io_servers file_io_servers set 0 299 file_server_2
global_locks global_locks set 0 299 global_name_server
global_names global_names set 0 299 global_name_server
global_names_ext global_names_ext set 0 299 global_name_server
global_pid_ids global_pid_ids bag 0 299 global_name_server
global_pid_names global_pid_names bag 0 299 global_name_server
inet_cache inet_cache bag 0 299 inet_db
inet_db inet_db set 29 624 inet_db
inet_hosts_byaddr inet_hosts_byaddr bag 0 299 inet_db
inet_hosts_byname inet_hosts_byname bag 0 299 inet_db
inet_hosts_file_byaddr inet_hosts_file_byaddr bag 0 299 inet_db
inet_hosts_file_byname inet_hosts_file_byname bag 0 299 inet_db
sys_dist sys_dist set 0 299 net_kernel
ok
The text was updated successfully, but these errors were encountered: