@@ -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,14 @@ 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 ( ) ;
302+ let start_time = DateTime :: from_timestamp_millis ( bin. start . timestamp_millis ( ) )
303+ . unwrap ( )
304+ . to_rfc3339 ( ) ;
305+ let end_time = DateTime :: from_timestamp_millis ( bin. end . timestamp_millis ( ) )
306+ . unwrap ( )
307+ . to_rfc3339 ( ) ;
304308 // Sum up the number of rows that fall within the bin
305- let log_count : u64 = all_manifest_files
309+ let count : u64 = all_manifest_files
306310 . iter ( )
307311 . flat_map ( |m| & m. files )
308312 . filter_map ( |f| {
@@ -324,13 +328,9 @@ impl CountsRequest {
324328 . sum ( ) ;
325329
326330 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,
331+ start_time,
332+ end_time,
333+ count,
334334 } ) ;
335335 }
336336 Ok ( counts_records)
0 commit comments