Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit b73a12f

Browse files
authored
remove some read/write concurrency settings from ets tables (#135)
1 parent 60077b8 commit b73a12f

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

src/oc_sampler_period_or_count.erl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
%% public
3232

3333
init(Opts) ->
34-
_ = ets:new(?ETS_TABLE, [named_table, public,
35-
{read_concurrency, true},
36-
{write_concurrency, true}]),
34+
_ = ets:new(?ETS_TABLE, [named_table, public]),
3735

3836
Period0 = proplists:get_value(period, Opts, ?DEFAULT_PERIOD),
3937
%% TODO: check Period0 is a non-negative integer

src/oc_server.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ handle_cast(_, State) ->
4343
maybe_init_ets() ->
4444
case ets:info(?SPAN_TAB, name) of
4545
undefined ->
46-
ets:new(?SPAN_TAB, [named_table, public, {write_concurrency, true},
47-
{read_concurrency, true}, {keypos, #span.span_id}]);
46+
ets:new(?SPAN_TAB, [named_table, public, {write_concurrency, true}, {keypos, #span.span_id}]);
4847
_ ->
4948
ok
5049
end.

src/oc_stat_measure.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ terminate_() ->
148148

149149
%% @private
150150
'__init_backend__'() ->
151-
?MEASURES_TABLE = ets:new(?MEASURES_TABLE, [set, named_table, public, {keypos, 2}, {read_concurrency, true}]),
151+
?MEASURES_TABLE = ets:new(?MEASURES_TABLE, [set, named_table, public, {keypos, 2}]),
152152
ok.
153153

154154
%% =============================================================================

src/oc_stat_view.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ tag_values_(Tags, Keys) ->
369369

370370
%% @private
371371
'__init_backend__'() ->
372-
?VIEWS_TABLE = ets:new(?VIEWS_TABLE, [set, named_table, public, {keypos, 2}, {read_concurrency, true}]),
372+
?VIEWS_TABLE = ets:new(?VIEWS_TABLE, [set, named_table, public, {keypos, 2}]),
373373
ok.
374374

375375
%% =============================================================================

src/opencensus_app.erl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ stop(_State) ->
3434
maybe_init_ets() ->
3535
case ets:info(?SPAN_TAB, name) of
3636
undefined ->
37-
ets:new(?SPAN_TAB, [named_table, public, {write_concurrency, true},
38-
{read_concurrency, true}, {keypos, #span.span_id}]);
37+
ets:new(?SPAN_TAB, [named_table, public, {write_concurrency, true}, {keypos, #span.span_id}]);
3938
_ ->
4039
ok
4140
end,
4241

43-
ets:new(oc_producer_registry, [bag, named_table, public, {write_concurrency, true},
44-
{read_concurrency, true}]),
42+
ets:new(oc_producer_registry, [bag, named_table, public]),
4543

4644
oc_producer_registry:add_producer(oc_self_producer).

test/ocp_SUITE.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ end_per_suite(_Config) ->
2727
ok.
2828

2929
init_per_testcase(_, Config) ->
30-
Tab = ets:new(reporter_tab, [public, {write_concurrency, true},
31-
{read_concurrency, true}, {keypos, #span.span_id}]),
30+
Tab = ets:new(reporter_tab, [public, {keypos, #span.span_id}]),
3231
application:set_env(opencensus, send_interval_ms, 1),
3332
application:set_env(opencensus, reporters, [{oc_tab_reporter, []}]),
3433
application:set_env(opencensus, tab_reporter, #{tid => Tab}),

test/opencensus_SUITE.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ end_per_suite(_Config) ->
2424
ok.
2525

2626
init_per_testcase(_, Config) ->
27-
Tab = ets:new(reporter_tab, [public, {write_concurrency, true},
28-
{read_concurrency, true}, {keypos, #span.span_id}]),
27+
Tab = ets:new(reporter_tab, [public, {keypos, #span.span_id}]),
2928
application:set_env(opencensus, send_interval_ms, 1),
3029
application:set_env(opencensus, reporters, [{oc_tab_reporter, []}]),
3130
application:set_env(opencensus, tab_reporter, #{tid => Tab}),

0 commit comments

Comments
 (0)