"lib/bindings/vscode:/vscode.git/clone" did not exist on "8c40bbb06261fd253829f7c1f2cc0fe2b3ea0b51"
README.md 914 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Dynamo Codegen

Python code generator for Dynamo Python bindings.

## gen-python-prometheus-names

Generates `prometheus_names.py` from Rust source `lib/runtime/src/metrics/prometheus_names.rs`.

### Usage

```bash
cargo run -p dynamo-codegen --bin gen-python-prometheus-names
```

### What it does

- Parses Rust AST from `lib/runtime/src/metrics/prometheus_names.rs`
- Generates Python classes with constants at `lib/bindings/python/src/dynamo/prometheus_names.py`
- Handles macro-generated constants (e.g., `kvstats_name!("active_blocks")``"kvstats_active_blocks"`)

### Example

**Rust input:**
```rust
pub mod kvstats {
    pub const ACTIVE_BLOCKS: &str = kvstats_name!("active_blocks");
}
```

**Python output:**
```python
class kvstats:
    ACTIVE_BLOCKS = "kvstats_active_blocks"
```

### When to run

Run after modifying `lib/runtime/src/metrics/prometheus_names.rs` to regenerate the Python file.