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

Method with_suffix

src/run_environment/interfaces.rs:122–130  ·  view source on GitHub ↗

Returns a new `RunPart` with the given suffix appended to `run_part_id`. The suffix is a structured key-value map that gets: - serialized as JSON and appended to `run_part_id` (e.g. `job_name-{"executor":"valgrind","run-index":0}`) - merged into the `metadata` field This is used to differentiate multiple uploads within the same run (e.g., different executors, or multiple invocations in the same

(mut self, suffix: BTreeMap<String, Value>)

Source from the content-addressed store, hash-verified

120 /// This is used to differentiate multiple uploads within the same run
121 /// (e.g., different executors, or multiple invocations in the same CI job).
122 pub fn with_suffix(mut self, suffix: BTreeMap<String, Value>) -> Self {
123 if suffix.is_empty() {
124 return self;
125 }
126 let suffix_str = serde_json::to_string(&suffix).expect("Unable to serialize suffix");
127 self.run_part_id = format!("{}-{}", self.run_part_id, suffix_str);
128 self.metadata.extend(suffix);
129 self
130 }
131}
132
133#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]

Callers 1

get_upload_metadataMethod · 0.80

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected