MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / create

Method create

crates/runner-shared/src/telemetry/mod.rs:162–174  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

160
161impl<R: TelemetryRow> TelemetryWriter<R> {
162 pub fn create(path: &Path) -> anyhow::Result<Self> {
163 if let Some(dir) = path.parent() {
164 std::fs::create_dir_all(dir)
165 .with_context(|| format!("Failed to create {}", dir.display()))?;
166 }
167 let file =
168 File::create(path).with_context(|| format!("Failed to create {}", path.display()))?;
169 let encoder = zstd::Encoder::new(BufWriter::new(file), ZSTD_LEVEL)?;
170 Ok(Self {
171 serializer: rmp_serde::Serializer::new(BufWriter::new(encoder)),
172 _rows: PhantomData,
173 })
174 }
175
176 pub fn write(&mut self, rows: impl IntoIterator<Item = R>) -> anyhow::Result<()> {
177 for row in rows {

Callers 2

export_run_idMethod · 0.80
append_to_fileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected