Skip to content

Commit

Permalink
Rename gc settings to clearer language. (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino authored Feb 24, 2021
1 parent a5eb6a3 commit dccac4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions newrelic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ def _process_configuration(section):
'get', _map_inc_excl_attributes)
_process_setting(section, 'transaction_name.naming_scheme',
'get', None)
_process_setting(section, 'gc_profiler.enabled',
_process_setting(section, 'gc_runtime_metrics.enabled',
'getboolean', None)
_process_setting(section, 'gc_profiler.top_object_count_limit',
_process_setting(section, 'gc_runtime_metrics.top_object_count_limit',
'getint', None)
_process_setting(section, 'thread_profiler.enabled',
'getboolean', None)
Expand Down
8 changes: 4 additions & 4 deletions newrelic/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AttributesSettings(Settings):
pass


class GCProfilerSettings(Settings):
class GCRuntimeMetricsSettings(Settings):
pass


Expand Down Expand Up @@ -324,7 +324,7 @@ class EventHarvestConfigHarvestLimitSettings(Settings):

_settings = TopLevelSettings()
_settings.attributes = AttributesSettings()
_settings.gc_profiler = GCProfilerSettings()
_settings.gc_runtime_metrics = GCRuntimeMetricsSettings()
_settings.thread_profiler = ThreadProfilerSettings()
_settings.transaction_tracer = TransactionTracerSettings()
_settings.transaction_tracer.attributes = TransactionTracerAttributesSettings()
Expand Down Expand Up @@ -613,8 +613,8 @@ def default_host(license_key):
_settings.thread_profiler.enabled = True
_settings.cross_application_tracer.enabled = True

_settings.gc_profiler.enabled = False
_settings.gc_profiler.top_object_count_limit = 5
_settings.gc_runtime_metrics.enabled = False
_settings.gc_runtime_metrics.top_object_count_limit = 5

_settings.transaction_events.enabled = True
_settings.transaction_events.attributes.enabled = True
Expand Down
4 changes: 2 additions & 2 deletions newrelic/samplers/gc_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def enabled(self):
return False
else:
settings = global_settings()
return settings.gc_profiler.enabled
return settings.gc_runtime_metrics.enabled

@property
def top_object_count_limit(self):
settings = global_settings()
return settings.gc_profiler.top_object_count_limit
return settings.gc_runtime_metrics.top_object_count_limit

def record_gc(self, phase, info):
if not self.enabled:
Expand Down
6 changes: 3 additions & 3 deletions tests/agent_unittests/test_sampler_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def test_gc_metrics_collection(gc_data_source, top_object_count_limit):
@override_generic_settings(
settings,
{
"gc_profiler.enabled": True,
"gc_profiler.top_object_count_limit": top_object_count_limit,
"gc_runtime_metrics.enabled": True,
"gc_runtime_metrics.top_object_count_limit": top_object_count_limit,
},
)
def _test():
Expand Down Expand Up @@ -126,7 +126,7 @@ def _test():
)
@pytest.mark.parametrize("enabled", (True, False))
def test_gc_metrics_config(gc_data_source, enabled):
@override_generic_settings(settings, {"gc_profiler.enabled": enabled})
@override_generic_settings(settings, {"gc_runtime_metrics.enabled": enabled})
def _test():
assert gc_data_source.enabled == enabled

Expand Down

0 comments on commit dccac4f

Please sign in to comment.