Skip to content

Commit

Permalink
Add: Metadata for observability (#508)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Mikhail Bautin <mbautin@users.noreply.github.com>
  • Loading branch information
mbautin and mbautin authored Oct 22, 2024
1 parent c27c99d commit 113a786
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/usearch/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3175,6 +3175,18 @@ class index_gt {

std::size_t memory_usage_per_node(level_t level) const noexcept { return node_bytes_(level); }

double inverse_log_connectivity() const {
return pre_.inverse_log_connectivity;
}

std::size_t neighbors_base_bytes() const {
return pre_.neighbors_base_bytes;
}

std::size_t neighbors_bytes() const {
return pre_.neighbors_bytes;
}

#if defined(USEARCH_USE_PRAGMA_REGION)
#pragma endregion

Expand Down
3 changes: 3 additions & 0 deletions include/usearch/index_dense.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ class index_dense_gt {
std::size_t max_level() const { return typed_->max_level(); }
index_dense_config_t const& config() const { return config_; }
index_limits_t const& limits() const { return typed_->limits(); }
double inverse_log_connectivity() const { return typed_->inverse_log_connectivity(); }
std::size_t neighbors_base_bytes() const { return typed_->neighbors_base_bytes(); }
std::size_t neighbors_bytes() const { return typed_->neighbors_bytes(); }
bool multi() const { return config_.multi; }
std::size_t currently_available_threads() const {
std::unique_lock<std::mutex> available_threads_lock(available_threads_mutex_);
Expand Down

0 comments on commit 113a786

Please sign in to comment.