@@ -40,8 +40,15 @@ use crate::{
4040 users:: { dashboards:: DASHBOARDS , filters:: FILTERS } ,
4141} ;
4242
43- type StreamMetadataResponse =
44- Result < ( String , Vec < ObjectStoreFormat > , TelemetryType ) , PrismHomeError > ;
43+ type StreamMetadataResponse = Result <
44+ (
45+ String ,
46+ Vec < ObjectStoreFormat > ,
47+ TelemetryType ,
48+ Option < String > ,
49+ ) ,
50+ PrismHomeError ,
51+ > ;
4552
4653#[ derive( Debug , Serialize , Default ) ]
4754pub struct DatedStats {
@@ -55,6 +62,8 @@ pub struct DatedStats {
5562pub struct DataSet {
5663 title : String ,
5764 dataset_type : TelemetryType ,
65+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
66+ time_partition : Option < String > ,
5867}
5968
6069#[ derive( Debug , Serialize ) ]
@@ -120,7 +129,7 @@ pub async fn generate_home_response(
120129
121130 for result in stream_metadata_results {
122131 match result {
123- Ok ( ( stream, metadata, dataset_type) ) => {
132+ Ok ( ( stream, metadata, dataset_type, time_partition ) ) => {
124133 // Skip internal streams if the flag is false
125134 if !include_internal
126135 && metadata
@@ -133,6 +142,7 @@ pub async fn generate_home_response(
133142 datasets. push ( DataSet {
134143 title : stream,
135144 dataset_type,
145+ time_partition,
136146 } ) ;
137147 }
138148 Err ( e) => {
@@ -204,7 +214,15 @@ fn get_top_5_streams_by_ingestion(
204214
205215async fn get_stream_metadata (
206216 stream : String ,
207- ) -> Result < ( String , Vec < ObjectStoreFormat > , TelemetryType ) , PrismHomeError > {
217+ ) -> Result <
218+ (
219+ String ,
220+ Vec < ObjectStoreFormat > ,
221+ TelemetryType ,
222+ Option < String > ,
223+ ) ,
224+ PrismHomeError ,
225+ > {
208226 let path = RelativePathBuf :: from_iter ( [ & stream, STREAM_ROOT_DIRECTORY ] ) ;
209227 let obs = PARSEABLE
210228 . storage
@@ -234,8 +252,9 @@ async fn get_stream_metadata(
234252 }
235253
236254 let dataset_type = stream_jsons[ 0 ] . telemetry_type ;
255+ let time_partition = stream_jsons[ 0 ] . time_partition . clone ( ) ;
237256
238- Ok ( ( stream, stream_jsons, dataset_type) )
257+ Ok ( ( stream, stream_jsons, dataset_type, time_partition ) )
239258}
240259
241260async fn stats_for_date (
0 commit comments