@@ -247,6 +247,7 @@ impl ArtifactManifest {
247247 }
248248 DeserializedArtifactSource :: CompositeControlPlane {
249249 zones,
250+ measurement_corpus,
250251 } => {
251252 ensure ! (
252253 kind == KnownArtifactKind :: ControlPlane ,
@@ -289,6 +290,21 @@ impl ArtifactManifest {
289290 hash,
290291 } ) ?;
291292 }
293+ for manifest in measurement_corpus {
294+ let ( hash, name) = manifest. with_name_and_entry (
295+ & artifact_data. version ,
296+ |name, entry| {
297+ builder. append_measurement ( name, entry)
298+ } ,
299+ ) ?;
300+ data_builder. insert ( DeploymentUnitData {
301+ name : name. to_owned ( ) ,
302+ version : artifact_data. version . clone ( ) ,
303+ kind : zone_kind. clone ( ) ,
304+ hash,
305+ } ) ?;
306+ }
307+
292308 (
293309 ArtifactSource :: Memory ( builder. finish ( ) ?. into ( ) ) ,
294310 data_builder. finish_units ( ) ,
@@ -338,7 +354,13 @@ impl ArtifactManifest {
338354 /// details if any artifacts are missing.
339355 pub fn verify_all_present ( & self ) -> Result < ( ) > {
340356 let all_artifacts: BTreeSet < _ > = KnownArtifactKind :: iter ( )
341- . filter ( |k| !matches ! ( k, KnownArtifactKind :: Zone ) )
357+ . filter ( |k| {
358+ !matches ! (
359+ k,
360+ KnownArtifactKind :: Zone
361+ | KnownArtifactKind :: MeasurementCorpus
362+ )
363+ } )
342364 . collect ( ) ;
343365 let present_artifacts: BTreeSet < _ > =
344366 self . artifacts . keys ( ) . copied ( ) . collect ( ) ;
@@ -377,7 +399,8 @@ impl<'a> FakeDataAttributes<'a> {
377399 KnownArtifactKind :: Host
378400 | KnownArtifactKind :: Trampoline
379401 | KnownArtifactKind :: ControlPlane
380- | KnownArtifactKind :: Zone => {
402+ | KnownArtifactKind :: Zone
403+ | KnownArtifactKind :: MeasurementCorpus => {
381404 return make_filler_text (
382405 & self . kind . to_string ( ) ,
383406 self . version ,
@@ -582,6 +605,7 @@ pub enum DeserializedArtifactSource {
582605 } ,
583606 CompositeControlPlane {
584607 zones : Vec < DeserializedControlPlaneZoneSource > ,
608+ measurement_corpus : Vec < DeserializedControlPlaneZoneSource > ,
585609 } ,
586610}
587611
@@ -608,10 +632,16 @@ impl DeserializedArtifactSource {
608632 archive_b. apply_size_delta ( size_delta) ?;
609633 Ok ( ( ) )
610634 }
611- DeserializedArtifactSource :: CompositeControlPlane { zones } => {
635+ DeserializedArtifactSource :: CompositeControlPlane {
636+ zones,
637+ measurement_corpus,
638+ } => {
612639 for zone in zones {
613640 zone. apply_size_delta ( size_delta) ?;
614641 }
642+ for manifest in measurement_corpus {
643+ manifest. apply_size_delta ( size_delta) ?;
644+ }
615645 Ok ( ( ) )
616646 }
617647 }
@@ -696,6 +726,8 @@ impl DeserializedFileArtifactSource {
696726 }
697727}
698728
729+ // FIXME probably give this a better name if we're going to use it for
730+ // measurements
699731#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
700732#[ serde( tag = "kind" , rename_all = "snake_case" ) ]
701733pub enum DeserializedControlPlaneZoneSource {
0 commit comments