Skip to content

Commit

Permalink
Merge pull request #1764
Browse files Browse the repository at this point in the history
Remove obsolete experimental features
  • Loading branch information
Neverlord committed Feb 21, 2024
2 parents ab1f6bf + e7d6ea9 commit 190ccd0
Show file tree
Hide file tree
Showing 25 changed files with 13 additions and 826 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ is based on [Keep a Changelog](https://keepachangelog.com).
- All `to_stream` and `to_typed_stream` member functions on actors (they are
available on `caf::flow::observable` directly).
- The `group` API has been removed entirely.
- The experimental APIs for actor profiling and inserting tracing data have been
removed. Neither API has a clear use case at the moment and since we have not
received any feedback on either API, we have decided to remove them to
simplify the code base.

### Changed

Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ option(THREADS_PREFER_PTHREAD_FLAG "Prefer -pthread flag if available " ON)

# -- CAF options that are off by default ---------------------------------------

option(CAF_ENABLE_ACTOR_PROFILER "Enable experimental profiler API" OFF)
option(CAF_ENABLE_CPACK "Enable packaging via CPack" OFF)
option(CAF_ENABLE_CURL_EXAMPLES "Build examples with libcurl" OFF)
option(CAF_ENABLE_PROTOBUF_EXAMPLES "Build examples with Google Protobuf" OFF)
Expand Down
2 changes: 0 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Flags (use --enable-<name> to activate and --disable-<name> to deactivate):
qt6-examples build examples with the Qt6 framework [OFF]
runtime-checks build CAF with extra runtime assertions [OFF]
utility-targets include targets like consistency-check [OFF]
actor-profiler enable experimental proiler API [OFF]
examples build small programs showcasing CAF features [ON]
io-module build networking I/O module [ON]
openssl-module build OpenSSL module [ON]
Expand Down Expand Up @@ -107,7 +106,6 @@ set_build_flag() {
qt6-examples) FlagName='CAF_ENABLE_QT6_EXAMPLES' ;;
runtime-checks) FlagName='CAF_ENABLE_RUNTIME_CHECKS' ;;
utility-targets) FlagName='CAF_ENABLE_UTILITY_TARGETS' ;;
actor-profiler) FlagName='CAF_ENABLE_ACTOR_PROFILER' ;;
examples) FlagName='CAF_ENABLE_EXAMPLES' ;;
io-module) FlagName='CAF_ENABLE_IO_MODULE' ;;
net-module) FlagName='CAF_ENABLE_NET_MODULE' ;;
Expand Down
5 changes: 0 additions & 5 deletions libcaf_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ caf_add_component(
caf/actor_ostream.cpp
caf/actor_pool.cpp
caf/actor_pool.test.cpp
caf/actor_profiler.cpp
caf/actor_proxy.cpp
caf/actor_registry.cpp
caf/actor_registry.test.cpp
Expand Down Expand Up @@ -339,8 +338,6 @@ caf_add_component(
caf/term.cpp
caf/thread_hook.cpp
caf/timestamp.cpp
caf/tracing_data.cpp
caf/tracing_data_factory.cpp
caf/type_id.cpp
caf/type_id_list.cpp
caf/type_id_list.test.cpp
Expand All @@ -357,7 +354,6 @@ caf_add_component(
tests/legacy/core-test.cpp
LEGACY_TEST_SUITES
actor_lifetime
actor_profiler
actor_termination
config_option_set
config_value
Expand All @@ -377,7 +373,6 @@ caf_add_component(
response_promise
stateful_actor
thread_hook
tracing_data
typed_actor_view
typed_response_promise
typed_spawn
Expand Down
13 changes: 0 additions & 13 deletions libcaf_core/caf/actor_profiler.cpp

This file was deleted.

98 changes: 0 additions & 98 deletions libcaf_core/caf/actor_profiler.hpp

This file was deleted.

4 changes: 1 addition & 3 deletions libcaf_core/caf/actor_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,14 @@ auto make_actor_metric_families(telemetry::metric_registry& reg) {
} // namespace

actor_system::actor_system(actor_system_config& cfg)
: profiler_(cfg.profiler),
ids_(0),
: ids_(0),
metrics_(cfg),
base_metrics_(make_base_metrics(metrics_)),
logger_(cfg.make_logger(*this)),
registry_(*this),
dummy_execution_unit_(this),
await_actors_before_shutdown_(true),
cfg_(cfg),
tracing_context_(cfg.tracing_context),
private_threads_(this) {
CAF_SET_LOGGER_SYS(this);
meta_objects_guard_ = detail::global_meta_objects_guard();
Expand Down
52 changes: 0 additions & 52 deletions libcaf_core/caf/actor_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "caf/actor_cast.hpp"
#include "caf/actor_clock.hpp"
#include "caf/actor_config.hpp"
#include "caf/actor_profiler.hpp"
#include "caf/actor_registry.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/init_fun_factory.hpp"
Expand Down Expand Up @@ -526,9 +525,6 @@ class CAF_CORE_EXPORT actor_system {
auto res = make_actor<C>(next_actor_id(), node(), this, cfg,
std::forward<Ts>(xs)...);
auto ptr = static_cast<C*>(actor_cast<abstract_actor*>(res));
#ifdef CAF_ENABLE_ACTOR_PROFILER
profiler_add_actor(*ptr, cfg.parent);
#endif
ptr->launch(cfg.host, has_lazy_init_flag(Os), has_hide_flag(Os));
return res;
}
Expand Down Expand Up @@ -619,9 +615,6 @@ class CAF_CORE_EXPORT actor_system {
auto res = make_actor<Impl>(next_actor_id(), node(), this, cfg,
std::forward<Ts>(xs)...);
auto ptr = static_cast<Impl*>(actor_cast<abstract_actor*>(res));
#ifdef CAF_ENABLE_ACTOR_PROFILER
profiler_add_actor(*ptr, cfg.parent);
#endif
auto launch = [strong_ptr = std::move(res), host{cfg.host}] {
// Note: we pass `res` to this lambda instead of `ptr` to keep a strong
// reference to the actor.
Expand All @@ -632,41 +625,6 @@ class CAF_CORE_EXPORT actor_system {
return std::make_tuple(ptr, launcher<decltype(launch)>(std::move(launch)));
}

void profiler_add_actor(const local_actor& self, const local_actor* parent) {
if (profiler_)
profiler_->add_actor(self, parent);
}

void profiler_remove_actor(const local_actor& self) {
if (profiler_)
profiler_->remove_actor(self);
}

void profiler_before_processing(const local_actor& self,
const mailbox_element& element) {
if (profiler_)
profiler_->before_processing(self, element);
}

void profiler_after_processing(const local_actor& self,
invoke_message_result result) {
if (profiler_)
profiler_->after_processing(self, result);
}

void profiler_before_sending(const local_actor& self,
mailbox_element& element) {
if (profiler_)
profiler_->before_sending(self, element);
}

void profiler_before_sending_scheduled(const local_actor& self,
caf::actor_clock::time_point timeout,
mailbox_element& element) {
if (profiler_)
profiler_->before_sending_scheduled(self, timeout, element);
}

base_metrics_t& base_metrics() noexcept {
return base_metrics_;
}
Expand All @@ -679,10 +637,6 @@ class CAF_CORE_EXPORT actor_system {
return actor_metric_families_;
}

tracing_data_factory* tracing_context() const noexcept {
return tracing_context_;
}

detail::private_thread* acquire_private_thread();

void release_private_thread(detail::private_thread*);
Expand Down Expand Up @@ -720,9 +674,6 @@ class CAF_CORE_EXPORT actor_system {

// -- member variables -------------------------------------------------------

/// Provides system-wide callbacks for several actor operations.
actor_profiler* profiler_;

/// Used to generate ascending actor IDs.
std::atomic<size_t> ids_;

Expand Down Expand Up @@ -762,9 +713,6 @@ class CAF_CORE_EXPORT actor_system {
/// The system-wide, user-provided configuration.
actor_system_config& cfg_;

/// Stores the system-wide factory for deserializing tracing data.
tracing_data_factory* tracing_context_;

/// Caches the configuration parameter `caf.metrics-filters.actors.includes`
/// for faster lookups at runtime.
std::vector<std::string> metrics_actors_includes_;
Expand Down
10 changes: 2 additions & 8 deletions libcaf_core/caf/actor_system_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ actor_system_config::actor_system_config()
opt_group{custom_options_, "caf.scheduler"}
.add<string>("policy", "'stealing' (default) or 'sharing'")
.add<size_t>("max-threads", "maximum number of worker threads")
.add<size_t>("max-throughput", "nr. of messages actors can consume per run")
.add<bool>("enable-profiling", "enables profiler output")
.add<timespan>("profiling-resolution", "data collection rate")
.add<string>("profiling-output-file", "output file for the profiler");
.add<size_t>("max-throughput",
"nr. of messages actors can consume per run");
opt_group(custom_options_, "caf.work-stealing")
.add<size_t>("aggressive-poll-attempts", "nr. of aggressive steal attempts")
.add<size_t>("aggressive-steal-interval",
Expand Down Expand Up @@ -104,10 +102,6 @@ settings actor_system_config::dump_content() const {
put_missing(scheduler_group, "policy", defaults::scheduler::policy);
put_missing(scheduler_group, "max-throughput",
defaults::scheduler::max_throughput);
put_missing(scheduler_group, "enable-profiling", false);
put_missing(scheduler_group, "profiling-resolution",
defaults::scheduler::profiling_resolution);
put_missing(scheduler_group, "profiling-output-file", std::string{});
// -- work-stealing parameters
auto& work_stealing_group = caf_group["work-stealing"].as_dictionary();
put_missing(work_stealing_group, "aggressive-poll-attempts",
Expand Down
11 changes: 0 additions & 11 deletions libcaf_core/caf/actor_system_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#pragma once

#include "caf/actor_factory.hpp"
#include "caf/actor_profiler.hpp"
#include "caf/config_option.hpp"
#include "caf/config_option_adder.hpp"
#include "caf/config_option_set.hpp"
Expand Down Expand Up @@ -235,16 +234,6 @@ class CAF_CORE_EXPORT actor_system_config {

thread_hooks thread_hooks_;

/// Provides system-wide callbacks for several actor operations.
/// @experimental
/// @note Has no effect unless building CAF with CAF_ENABLE_ACTOR_PROFILER.
actor_profiler* profiler = nullptr;

/// Enables CAF to deserialize application-specific tracing information.
/// @experimental
/// @note Has no effect unless building CAF with CAF_ENABLE_ACTOR_PROFILER.
tracing_data_factory* tracing_context = nullptr;

// -- parsing parameters -----------------------------------------------------

/// Configures the default path of the configuration file.
Expand Down
2 changes: 0 additions & 2 deletions libcaf_core/caf/all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
#include "caf/term.hpp"
#include "caf/thread_hook.hpp"
#include "caf/timeout_definition.hpp"
#include "caf/tracing_data.hpp"
#include "caf/tracing_data_factory.hpp"
#include "caf/type_id.hpp"
#include "caf/typed_actor.hpp"
#include "caf/typed_actor_pointer.hpp"
Expand Down
2 changes: 0 additions & 2 deletions libcaf_core/caf/blocking_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ void blocking_actor::receive_impl(receive_cond& rcc, message_id mid,
// Dispatch on the current mailbox element.
if (consume()) {
unstash();
CAF_AFTER_PROCESSING(this, invoke_message_result::consumed);
CAF_LOG_FINALIZE_EVENT();
if (getf(abstract_actor::collects_metrics_flag)) {
auto& builtins = builtin_metrics();
Expand All @@ -293,7 +292,6 @@ void blocking_actor::receive_impl(receive_cond& rcc, message_id mid,
continue;
}
// Message was skipped.
CAF_AFTER_PROCESSING(this, invoke_message_result::skipped);
CAF_LOG_SKIP_EVENT();
stash_.push(ptr.release());
}
Expand Down
2 changes: 0 additions & 2 deletions libcaf_core/caf/defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ constexpr auto buffer_size = int32_t{4096}; // // 32 KB for elements of size 8.
namespace caf::defaults::scheduler {

constexpr auto policy = std::string_view{"stealing"};
constexpr auto profiling_output_file = std::string_view{""};
constexpr auto max_throughput = std::numeric_limits<size_t>::max();
constexpr auto profiling_resolution = timespan(100'000'000);

} // namespace caf::defaults::scheduler

Expand Down

0 comments on commit 190ccd0

Please sign in to comment.