Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/howl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down Expand Up @@ -314,6 +314,7 @@ pub struct HowlConfig<'a> {
pub abort_runs: bool,
pub kafka_config: Option<Vec<KafkaOption>>,
pub nexus_structure_path: Option<PathBuf>,
pub instrument: String,
}

fn generate_veto_config<'a>(
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ enum Commands {
/// Read a NeXus structure from the specified file.
#[arg(short = 's', long)]
nexus_structure_path: Option<PathBuf>,
/// Optionally specify the instrument name for run starts
#[arg(short = 'i', long)]
instrument: Option<String>,
// Additonal command line arguments
#[arg(short = 'X', long)]
kafka_config: Option<Vec<KafkaOption>>,
Expand Down Expand Up @@ -185,6 +188,7 @@ async fn main() {
fast,
abort_runs,
nexus_structure_path,
instrument,
kafka_config,
} => howl(&HowlConfig {
kafka_config,
Expand All @@ -208,6 +212,7 @@ async fn main() {
fast,
abort_runs,
nexus_structure_path,
instrument: instrument.unwrap_or(topic_prefix),
}),
Commands::Count {
topic,
Expand Down
Loading