# Introspection

> USearch for Zig

```zig
const description = try index.describe();
std.debug.print("{d} entries in {d} bytes\n", .{ description.size, description.memory_usage });
std.debug.print("dispatched to {s} across {d} shards\n", .{ description.cpu_class, description.shards_count });
std.debug.print("compiled for {s}\n", .{usearch.capabilitiesCompiled()});
std.debug.print("available here {s}\n", .{usearch.capabilitiesAvailable()});

const reachability = try index.on(executor).health();
std.debug.print("{d} of {d} entries reachable\n", .{ reachability.reachable, reachability.audited });
```

`health` audits how much of the graph a search reaches from its landmarks; entries it misses stay unfound until a `refine` re-links them.

`const usearch = @import("usearch");`

## DenseIndexDescription

A live index's state, reported by [`DenseIndex.describe`](https://www.unum.cloud/docs/usearch/zig/metrics.md#describe).

```zig
pub const DenseIndexDescription = struct
```

Each counter is read once, so under
concurrent insertions they may come from slightly different moments.
Mirrors `usearch_dense_index_description_t`.

- `metadata` `DenseMetadata`: The frozen metric, quantization, dimensions and connectivity.
- `size` `usize`: Stored entries.
- `capacity` `usize`: Entries hosted without growing again.
- `memory_usage` `usize`: Bytes the handle holds; traversal scratch is the executor's.
- `cpu_class` `[:0]const u8`: The CPU class dispatch picked on this machine, as `usearch_cpu_class_name` spells it.
- `gpu_class` `[:0]const u8`: The GPU class dispatch picked on the index's devices; "unknown" for a host index.
- `shards_count` `usize`: Live shards.

## DenseReachability

One reachability audit: the population it judged, and how much of it a search reaches.

```zig
pub const DenseReachability = extern struct
```

Mirrors `usearch_reachability_t`.

- `audited` `usize`: Entries published when the audit started; compare `reachable` against this, never a later size.
- `reachable` `usize`: Of those, the entries a search reaches from the landmarks; the rest wait for a [`refine`](https://www.unum.cloud/docs/usearch/zig/metrics.md#refine).
- `sweeps` `usize`: Levels the sweep took to converge.
- `back_sweeps` `usize`: Levels the sweep back toward the entry point took, where an audit sweeps both ways.

## DenseDescribe

One [`DenseIndex.describe`](https://www.unum.cloud/docs/usearch/zig/metrics.md#describe), as a [`Deferred`](https://www.unum.cloud/docs/usearch/zig/executors.md#Deferred) holds it.

```zig
pub const DenseDescribe = struct
```

- `description` `usearch_dense_index_description_t`
- `outcome` `Outcome`

## DenseCount

One [`DenseIndex.count`](https://www.unum.cloud/docs/usearch/zig/metrics.md#count), as a [`Deferred`](https://www.unum.cloud/docs/usearch/zig/executors.md#Deferred) holds it.

```zig
pub const DenseCount = struct
```

- `key` `Key`
- `entries` `usize`
- `outcome` `Outcome`

## DenseHealth

One [`DenseIndex.health`](https://www.unum.cloud/docs/usearch/zig/metrics.md#health), as a [`Deferred`](https://www.unum.cloud/docs/usearch/zig/executors.md#Deferred) holds it.

```zig
pub const DenseHealth = struct
```

- `reachability` `DenseReachability`
- `outcome` `Outcome`

## version

The library's version, as a static null-terminated string.

```zig
pub fn version() [:0]const u8
```

Calls `usearch_version_name`.

## capabilitiesCompiled

The hardware capabilities this binary was compiled with, comma-separated.

```zig
pub fn capabilitiesCompiled() [:0]const u8
```

Calls `usearch_capabilities_compiled`.

## capabilitiesAvailable

The hardware capabilities the current machine offers at runtime, comma-separated.

```zig
pub fn capabilitiesAvailable() [:0]const u8
```

Calls `usearch_capabilities_available`.

