@@ -248,11 +248,11 @@ impl Query {
248248#[ derive( Debug , Serialize , Clone ) ]
249249pub struct CountsRecord {
250250 /// Start time of the bin
251- pub counts_start_timestamp : String ,
251+ pub start_time : String ,
252252 /// End time of the bin
253- pub counts_end_timestamp : String ,
253+ pub end_time : String ,
254254 /// Number of logs in the bin
255- pub log_count : u64 ,
255+ pub count : u64 ,
256256}
257257
258258struct TimeBounds {
@@ -299,10 +299,8 @@ impl CountsRequest {
299299
300300 for bin in counts {
301301 // extract start and end time to compare
302- let counts_start_timestamp = bin. start . timestamp_millis ( ) ;
303- let counts_end_timestamp = bin. end . timestamp_millis ( ) ;
304302 // Sum up the number of rows that fall within the bin
305- let log_count : u64 = all_manifest_files
303+ let count : u64 = all_manifest_files
306304 . iter ( )
307305 . flat_map ( |m| & m. files )
308306 . filter_map ( |f| {
@@ -324,13 +322,9 @@ impl CountsRequest {
324322 . sum ( ) ;
325323
326324 counts_records. push ( CountsRecord {
327- counts_start_timestamp : DateTime :: from_timestamp_millis ( counts_start_timestamp)
328- . unwrap ( )
329- . to_rfc3339 ( ) ,
330- counts_end_timestamp : DateTime :: from_timestamp_millis ( counts_end_timestamp)
331- . unwrap ( )
332- . to_rfc3339 ( ) ,
333- log_count,
325+ start_time : bin. start . to_rfc3339 ( ) ,
326+ end_time : bin. end . to_rfc3339 ( ) ,
327+ count,
334328 } ) ;
335329 }
336330 Ok ( counts_records)
0 commit comments