diff --git a/scywr/src/insertworker.rs b/scywr/src/insertworker.rs index 5bbf9d8..ed66825 100644 --- a/scywr/src/insertworker.rs +++ b/scywr/src/insertworker.rs @@ -364,6 +364,7 @@ fn prepare_timebin_v02_insert_futs( item.max, item.avg, item.dev, + item.lst, ); // TODO would be better to count inserts only on completed insert stats.inserted_binned().inc(); diff --git a/scywr/src/iteminsertqueue.rs b/scywr/src/iteminsertqueue.rs index 2bdb3b8..a65c25d 100644 --- a/scywr/src/iteminsertqueue.rs +++ b/scywr/src/iteminsertqueue.rs @@ -548,6 +548,7 @@ pub struct TimeBinSimpleF32V02 { pub max: f32, pub avg: f32, pub dev: f32, + pub lst: f32, } // Needs to be Clone to send it to multiple retention times if required. diff --git a/scywr/src/schema.rs b/scywr/src/schema.rs index ec4ddf2..dc43840 100644 --- a/scywr/src/schema.rs +++ b/scywr/src/schema.rs @@ -668,12 +668,13 @@ pub async fn migrate_scylla_data_schema( ("max", "float"), ("avg", "float"), ("dev", "float"), + ("lst", "float"), ], ["series", "binlen", "msp"], ["off"], rett.ttl_binned(), ); - let do_change = true; + // let do_change = true; tab.setup(do_change, scy).await?; } { diff --git a/scywr/src/store.rs b/scywr/src/store.rs index 3a357d5..4b20c37 100644 --- a/scywr/src/store.rs +++ b/scywr/src/store.rs @@ -151,8 +151,8 @@ impl DataStore { let qu_insert_binned_scalar_f32_v02 = prep_qu_ins_c!( "binned_scalar_f32_v02", - "series, binlen, msp, off, cnt, min, max, avg, dev", - "?, ?, ?, ?, ?, ?, ?, ?, ?", + "series, binlen, msp, off, cnt, min, max, avg, dev, lst", + "?, ?, ?, ?, ?, ?, ?, ?, ?, ?", rett, scy ); diff --git a/serieswriter/src/binwritergrid.rs b/serieswriter/src/binwritergrid.rs index 2678ccc..0db3625 100644 --- a/serieswriter/src/binwritergrid.rs +++ b/serieswriter/src/binwritergrid.rs @@ -92,7 +92,7 @@ impl BinWriterGrid { for e in out.iter_debug() { trace_tick_verbose!("{e:?}"); } - for ((((((&ts1, &ts2), &cnt), &min), &max), &avg), &fnl) in out.zip_iter() { + for (((((((&ts1, &ts2), &cnt), &min), &max), &avg), &lst), &fnl) in out.zip_iter() { if fnl == false { info!("non final bin"); } else if cnt == 0 { @@ -127,6 +127,7 @@ impl BinWriterGrid { max, avg, dev: f32::NAN, + lst, }); match &self.rt { RetentionTime::Short => {