@@ -248,11 +248,11 @@ impl Query {
248
248
#[ derive( Debug , Serialize , Clone ) ]
249
249
pub struct CountsRecord {
250
250
/// Start time of the bin
251
- pub counts_start_timestamp : String ,
251
+ pub start_time : String ,
252
252
/// End time of the bin
253
- pub counts_end_timestamp : String ,
253
+ pub end_time : String ,
254
254
/// Number of logs in the bin
255
- pub log_count : u64 ,
255
+ pub count : u64 ,
256
256
}
257
257
258
258
struct TimeBounds {
@@ -299,10 +299,8 @@ impl CountsRequest {
299
299
300
300
for bin in counts {
301
301
// 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 ( ) ;
304
302
// 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
306
304
. iter ( )
307
305
. flat_map ( |m| & m. files )
308
306
. filter_map ( |f| {
@@ -324,13 +322,9 @@ impl CountsRequest {
324
322
. sum ( ) ;
325
323
326
324
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,
334
328
} ) ;
335
329
}
336
330
Ok ( counts_records)
0 commit comments