Skip to content

412-Efficient influxdatabase connections#425

Draft
gopalangj wants to merge 6 commits intomainfrom
412-efficient-influxdatabase-connections
Draft

412-Efficient influxdatabase connections#425
gopalangj wants to merge 6 commits intomainfrom
412-efficient-influxdatabase-connections

Conversation

@gopalangj
Copy link
Copy Markdown
Collaborator

No description provided.

@gopalangj gopalangj linked an issue Feb 6, 2026 that may be closed by this pull request
@gopalangj
Copy link
Copy Markdown
Collaborator Author

@KobusVanRooyen, made an initial commit to this issue, where there is a slight improvement (~0.3s faster per call). I would still want to know if it could be sped up (exploratory), but I don't want to overdo it, so I would like to hear the requirements/what you think as well.

@KobusVanRooyen
Copy link
Copy Markdown
Collaborator

@KobusVanRooyen, made an initial commit to this issue, where there is a slight improvement (~0.3s faster per call). I would still want to know if it could be sped up (exploratory), but I don't want to overdo it, so I would like to hear the requirements/what you think as well.

@gopalangj 0.3s faster, nice. What is the ~percentage improvement? What was the original time [s] per call?

Comment thread src/mesido/esdl/profile_parser.py
Comment thread src/mesido/esdl/profile_parser.py Outdated
…zation/mesido into 412-efficient-influxdatabase-connections

Pulling main into the branch before making any changes
…ifferent threads trying to access same object information that could lead to code corruption
Comment thread src/mesido/esdl/esdl_mixin.py
Comment thread src/mesido/esdl/profile_parser.py
Comment thread src/mesido/esdl/profile_parser.py
Comment thread src/mesido/esdl/profile_parser.py
Comment thread src/mesido/esdl/esdl_mixin.py
Comment thread src/mesido/esdl/profile_parser.py
Comment thread src/mesido/esdl/profile_parser.py
@KobusVanRooyen
Copy link
Copy Markdown
Collaborator

KobusVanRooyen commented Apr 9, 2026

@gopalangj review completed.

@gopalangj
Copy link
Copy Markdown
Collaborator Author

@KobusVanRooyen Pushed changes after discussion

Copy link
Copy Markdown
Collaborator Author

@gopalangj gopalangj left a comment

Choose a reason for hiding this comment

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

Submitting "pending" comments. They are outdated anyway, but for the sake of completion

Comment thread src/mesido/esdl/profile_parser.py Outdated

conn_settings = ConnectionSettings(
host=profile.host,
# host=profile.host,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

profile.host starts the hyperlink with "https:/", whereas profile_host starts without it. It did seem okay to query and make connections without the "https:/". This particular change made coding other parts easy, which is why I did it, but I don't want to break the code. So I'd like to know about this as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I do see that the conn_settings are used only in this part of the code (within this function), which is a local variable. So essentially it should not break the other parts of the code

Comment thread src/mesido/esdl/profile_parser.py Outdated
Comment thread src/mesido/esdl/profile_parser.py
f" is not available in the host.",
)
potential_error_to_error(NetworkErrors.HEAT_NETWORK_ERRORS)
with self._lock:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This thread lock is implemented so that different threads don't try to access the same information (here the DB Manager object), which could lead to the program crashing. Thus, this will allow the threads to access the data one-at a time.
This adds a very small overhead, but will be beneficial and safe for large-problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Efficient influxdatabase connections

2 participants