Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(embed): register fleet example with generated cookbook

Steven Enamakelb783b39e78ce
diff --git a/crates/openhuman-embed/examples/linux_fleet.rs b/crates/openhuman-embed/examples/linux_fleet.rs
index 362d00529a..664297fc4f 100644
--- a/crates/openhuman-embed/examples/linux_fleet.rs
+++ b/crates/openhuman-embed/examples/linux_fleet.rs
@@ -1,5 +1,7 @@
-//! Reproducible Linux RSS and cold-turn measurement of runtime-owned agents.
-//! Run the release binary in a fresh cgroup; inference is a loopback HTTP mock.
+//! Title: Linux agent fleet memory and latency
+//! Summary: Measure retained runtime-owned agents using loopback inference and two worker threads.
+//! Run: offline on Linux; use a fresh constrained cgroup for release measurements.
+//! Feature: default
#![recursion_limit = "512"]
@@ -24,6 +26,7 @@ fn rss_kib() -> anyhow::Result<u64> {
.parse()?)
}
+// ANCHOR: linux-fleet
fn main() -> anyhow::Result<()> {
let count: usize = std::env::args()
.nth(1)
@@ -33,8 +36,11 @@ fn main() -> anyhow::Result<()> {
openhuman_embed::process::tokio_runtime_builder()
.worker_threads(2)
.build()?
- .block_on(measure(count))
+ .block_on(measure(count))?;
+ println!("EXAMPLE_OK linux_fleet");
+ Ok(())
}
+// ANCHOR_END: linux-fleet
async fn measure(count: usize) -> anyhow::Result<()> {
let mock = MockServer::builder()
diff --git a/crates/openhuman-embed/examples/linux_fleet_cgroup.py b/crates/openhuman-embed/examples/linux_fleet_cgroup.py
index 8e86022e16..ba8243757a 100644
--- a/crates/openhuman-embed/examples/linux_fleet_cgroup.py
+++ b/crates/openhuman-embed/examples/linux_fleet_cgroup.py
@@ -10,7 +10,7 @@ binary = pathlib.Path(__file__).resolve().parents[3] / 'target/release/examples/
r=subprocess.run([str(binary), count],capture_output=True,text=True)
if r.returncode:
print(r.stderr, file=sys.stderr);sys.exit(r.returncode)
-record=json.loads(r.stdout)
+record=json.loads(next(line for line in r.stdout.splitlines() if line.startswith("{")))
path=next(line.split('::',1)[1] for line in pathlib.Path('/proc/self/cgroup').read_text().splitlines() if line.startswith('0::'))
cg=pathlib.Path('/sys/fs/cgroup')/path.lstrip('/')
for name in ['memory.peak','memory.max','cpu.max','memory.events']: