diff --git a/src/howl.rs b/src/howl.rs index 1935b9d..749fc5c 100644 --- a/src/howl.rs +++ b/src/howl.rs @@ -67,7 +67,7 @@ fn generate_run_start<'a>( let det_spec_map_buf = SpectraDetectorMapping::create(fbb, &args); let file_name = format!("{}.nxs", Uuid::new_v4()); - let run_name = format!("saluki-howl-{}", Uuid::new_v4()); + let run_name = format!("{}-{}", config.instrument, Uuid::new_v4()); let start_time = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) @@ -78,7 +78,7 @@ fn generate_run_start<'a>( start_time: start_time as u64, stop_time: 0, // TODO check this - it's optional so not necessarily 0 run_name: Some(fbb.create_string(&run_name)), - instrument_name: Some(fbb.create_string("saluki-howl")), + instrument_name: Some(fbb.create_string(&config.instrument)), nexus_structure: Some(nexus_structure), job_id: Some(fbb.create_string(job_id)), broker: None, @@ -314,6 +314,7 @@ pub struct HowlConfig<'a> { pub abort_runs: bool, pub kafka_config: Option>, pub nexus_structure_path: Option, + pub instrument: String, } fn generate_veto_config<'a>( @@ -602,6 +603,7 @@ mod tests { abort_runs: false, kafka_config: None, nexus_structure_path: None, + instrument: "blah".to_string(), }; let out = generate_default_nexus_structure(&conf); diff --git a/src/main.rs b/src/main.rs index 19a8584..ce364e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,6 +114,9 @@ enum Commands { /// Read a NeXus structure from the specified file. #[arg(short = 's', long)] nexus_structure_path: Option, + /// Optionally specify the instrument name for run starts + #[arg(short = 'i', long)] + instrument: Option, // Additonal command line arguments #[arg(short = 'X', long)] kafka_config: Option>, @@ -185,6 +188,7 @@ async fn main() { fast, abort_runs, nexus_structure_path, + instrument, kafka_config, } => howl(&HowlConfig { kafka_config, @@ -208,6 +212,7 @@ async fn main() { fast, abort_runs, nexus_structure_path, + instrument: instrument.unwrap_or(topic_prefix), }), Commands::Count { topic,