Skip to content
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

Various performance improvements #224

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0962fe3
Add performance checks to clang-tidy config
hikinggrass Dec 10, 2024
3f76a88
Log module startup time for JavaScript and Python modules as well
hikinggrass Dec 10, 2024
2b17dfb
Use const ref for a few more variables and parameters
hikinggrass Dec 10, 2024
f5d4333
Remove serialize function from config
hikinggrass Dec 10, 2024
9d4da56
Refactor schema loading and validation
hikinggrass Dec 10, 2024
9d5496c
Ad some moves that clang-tidy suggested
hikinggrass Dec 10, 2024
a93bdfa
Directly pass the active_modules part of a config to the parse function
hikinggrass Dec 10, 2024
c74055b
Improve yaml file loading performance by reserving the appropriate am…
hikinggrass Dec 10, 2024
b8385de
Log the number of modules started
hikinggrass Dec 10, 2024
0bc601b
Fix narrowing conversion warning in yaml error handler by claming max…
hikinggrass Dec 10, 2024
bb1c2de
Fix widening conversion warning by multiplying two std::size_t already
hikinggrass Dec 10, 2024
0acb24f
Bump version to 0.19.2
hikinggrass Dec 10, 2024
9ddb9ce
Only publish module_names (a mapping of module type to id) once and r…
hikinggrass Dec 11, 2024
d40f7c3
Publish manifest individually
hikinggrass Dec 11, 2024
dbd4dc2
async get() function for MQTT used in get_module_config
hikinggrass Dec 12, 2024
1077b00
Fix everestjs config parsing with new config entry format
hikinggrass Dec 16, 2024
250ee4a
Capturing more vars as refs
hikinggrass Dec 16, 2024
5551fed
Log which topic cause a timeout exception in get()
hikinggrass Dec 16, 2024
c2f2f60
Use get_with_timeout in get_module_config
hikinggrass Dec 18, 2024
b96933b
Fix usage of MQTTSettings uses socket in manager
hikinggrass Dec 18, 2024
e6bf11c
Use get_module_name instead of get_module_info if only the module nam…
hikinggrass Dec 18, 2024
5d63f80
More const ref usage
hikinggrass Dec 18, 2024
04ec269
Re-order config handler in manager
hikinggrass Dec 21, 2024
4b6d16e
everestpy: initialize logging in module ctor not RuntimeSession
hikinggrass Dec 21, 2024
ed5152e
everestpy: add new RuntimeSession ctor that accepts MQTTSettings and …
hikinggrass Dec 21, 2024
30cf7e2
everestpy: add short documentation comments and deprecated RuntimeSes…
hikinggrass Dec 21, 2024
9a90570
More constref and move usage
hikinggrass Dec 21, 2024
c4737e3
Add --retain-topics flag to manager to keep retained topics after sta…
hikinggrass Dec 21, 2024
61603c9
Remove old cleanup_retained_topics functions since this is now provid…
hikinggrass Dec 21, 2024
6c19fb4
clang-format
hikinggrass Dec 21, 2024
6405e8e
Erase MessageHandler for topics without any registered handlers
hikinggrass Jan 2, 2025
7c539ac
Use .at() instead of [] for map access
hikinggrass Jan 2, 2025
1e4f79e
Exit early with EXIT_FAILURE if there are no modules to start
hikinggrass Jan 3, 2025
64e9ae2
Merge remote-tracking branch 'origin/main' into feature/performance-i…
hikinggrass Jan 3, 2025
9b68f6d
Make logged duration of get_module_config less verbose
hikinggrass Jan 6, 2025
abad2b8
Remove redundant unique_ptrs in Validators struct
hikinggrass Jan 7, 2025
3814cdd
Turn load_schema and load_schemas into free functions
hikinggrass Jan 7, 2025
ad1ecda
Move get and get_async from MQTTAbstraction to module config since it…
hikinggrass Jan 7, 2025
96835c0
load_schema and load_schemas: clang-format
hikinggrass Jan 7, 2025
b42680a
Revert to old file loading code for redability reasons
hikinggrass Jan 7, 2025
560c5ab
Merge remote-tracking branch 'origin/main' into feature/performance-i…
hikinggrass Jan 7, 2025
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
8 changes: 2 additions & 6 deletions everestpy/src/everest/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,14 @@ RuntimeSession::RuntimeSession(const std::string& prefix, const std::string& con
// We extract the settings from the config file so everest-testing doesn't break
const auto ms = Everest::ManagerSettings(prefix, config_file);

Everest::Logging::init(ms.runtime_settings->logging_config_file.string());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been moved? Isn't logging already used before until the module is constructed?

this->logging_config_file = ms.runtime_settings->logging_config_file;

this->mqtt_settings = ms.mqtt_settings;
}

RuntimeSession::RuntimeSession() {
const auto module_id = get_variable_from_env("EV_MODULE");

namespace fs = std::filesystem;
const fs::path logging_config_file =
this->logging_config_file =
Everest::assert_file(get_variable_from_env("EV_LOG_CONF_FILE"), "Default logging config");
Everest::Logging::init(logging_config_file.string(), module_id);

this->mqtt_settings = get_mqtt_settings_from_env();
}
Expand Down
5 changes: 5 additions & 0 deletions everestpy/src/everest/misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ class RuntimeSession {
return mqtt_settings;
}

const std::filesystem::path& get_logging_config_file() const {
return logging_config_file;
}

private:
Everest::MQTTSettings mqtt_settings;
std::filesystem::path logging_config_file;
};

struct Interface {
Expand Down
2 changes: 2 additions & 0 deletions everestpy/src/everest/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Module::Module(const RuntimeSession& session) : Module(get_variable_from_env("EV
Module::Module(const std::string& module_id_, const RuntimeSession& session_) :
module_id(module_id_), session(session_), start_time(std::chrono::system_clock::now()) {

Everest::Logging::init(session.get_logging_config_file().string(), module_id);

this->mqtt_abstraction = std::make_shared<Everest::MQTTAbstraction>(session.get_mqtt_settings());
this->mqtt_abstraction->connect();
this->mqtt_abstraction->spawn_main_loop_thread();
Expand Down