Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ public void purge()
@Override
public String status()
{
if (!ASYNC_PROFILER_ENABLED.getBoolean())
{
return "Async Profiler is not enabled. Enable it by setting " + ASYNC_PROFILER_ENABLED.getKey() + " property to true.";
}
return run(new ThrowingFunction<>()
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,13 @@ public void testSecondStartNotExecuted()
}

@Test
public void testProfilerDisabledThrowsException()
public void testProfilerDisabledReturnsMessage()
{
try (WithProperties properties = new WithProperties().set(ASYNC_PROFILER_UNSAFE_MODE, true).set(ASYNC_PROFILER_ENABLED, false))
{
assertThatThrownBy(() -> {
AsyncProfilerService profiler = getProfiler(true);
profiler.status();
}).hasMessageContaining("Async Profiler is not enabled. Enable it by setting cassandra.async_profiler.enabled property to true.");
AsyncProfilerService profiler = getProfiler(true);
String status = profiler.status();
assertTrue(status.contains("Async Profiler is not enabled. Enable it by setting cassandra.async_profiler.enabled property to true."));
}
}

Expand Down