Skip to content

Efficient influxdatabase connections #412

@FJanssen-TNO

Description

@FJanssen-TNO

Use the following code for time statistics on a run:

import cProfile, pstats

pr = cProfile.Profile()
pr.enable()

Code to run scenario --> like run_grow_tutorial

pr.disable()
pstats.Stats(pr).sort_stats("cumtime").print_stats(100)

This provides overview of time spend in parts of code. Here it is noted that each call to _load_profile_timeseries_from_database takes about 0.5s. Since this is called for every unique profile, if users start to add more unique profiles, this can add up significantly in time. The loading of the profile itself (load_influxdb) takes only about 0.1s per profile.
The influxdatabasemanager should be safed, such that if that connection was already made for a previous profile, this connection can be used again.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions