@@ -367,7 +367,9 @@ async def terminal_snapshot(self) -> Dict[str, int]:
367
367
self .log .info (
368
368
f"🧹 Recording expired data: { term_counts } for { start_of_day } "
369
369
)
370
- expiry = start_of_day + timedelta (days = self .settings .max_retention )
370
+ expiry = start_of_day + timedelta (
371
+ days = self .settings .terminal_max_retention_days
372
+ )
371
373
# Write the values to storage.
372
374
await self .redis .zadd (
373
375
self .settings .terminal_table ,
@@ -430,24 +432,14 @@ def config(env_args: os._Environ = os.environ) -> argparse.Namespace:
430
432
431
433
parser .add_argument ("-c" , "--config" , help = "configuration_file" , action = "append" )
432
434
433
- parser .add_argument (
434
- "--db_dsn" ,
435
- "-b" ,
436
- help = "Database DSN connection string" ,
437
- default = env_args .get (
438
- "AUTOEND__DB_DSN" ,
439
- env_args .get ("AUTOCONNECT__DB_DSN" , "grpc://localhost:8086" ),
440
- ),
441
- )
442
-
443
435
parser .add_argument (
444
436
"--db_settings" ,
445
437
"-s" ,
446
438
help = "Database settings" ,
447
439
default = env_args .get (
448
- "AUTOEND__DB_SETTINGS " ,
440
+ "AUTOCONNECT__DB_SETTINGS " ,
449
441
env_args .get (
450
- "AUTOCONNECT__DB_SETTINGS " ,
442
+ "AUTOEND__DB_SETTINGS " ,
451
443
'{"message_family":"message","router_family":"router", "table_name":"projects/test/instances/test/tables/autopush"}' ,
452
444
),
453
445
),
@@ -459,12 +451,6 @@ def config(env_args: os._Environ = os.environ) -> argparse.Namespace:
459
451
default = env_args .get ("AUTOTRACK_FAMILY" , RELIABILITY_FAMILY ),
460
452
)
461
453
462
- parser .add_argument (
463
- "--bucket_name" ,
464
- help = "GCP Storage Bucket name" ,
465
- default = env_args .get ("AUTOTRACK_BUCKET_NAME" ),
466
- )
467
-
468
454
parser .add_argument (
469
455
"--bucket_retention_days" ,
470
456
help = "Number of days to retain generated reports in the Bucket" ,
@@ -485,8 +471,8 @@ def config(env_args: os._Environ = os.environ) -> argparse.Namespace:
485
471
"-r" ,
486
472
help = "DSN to connect to the Redis like service." ,
487
473
default = env_args .get (
488
- "AUTOEND__RELIABILITY_DSN " ,
489
- env_args .get ("AUTOCONNECT__RELIABILITY_DSN " , "redis://localhost" ),
474
+ "AUTOCONNECT__RELIABILITY_DSN " ,
475
+ env_args .get ("AUTOEND__RELIABILITY_DSN " , "redis://localhost" ),
490
476
),
491
477
)
492
478
@@ -525,18 +511,10 @@ def config(env_args: os._Environ = os.environ) -> argparse.Namespace:
525
511
default = env_args .get ("AUTOTRACK_TERM_MAX_RETENTION_DAYS" , 1 ),
526
512
)
527
513
528
- parser .add_argument (
529
- "--report_max_retention_days" ,
530
- help = "Number of days to retain reports in the reliability bucket" ,
531
- default = env_args .get ("AUTOTRACK_REPORT_MAX_RETENTION_DAYS" , 30 ),
532
- )
533
-
534
514
parser .add_argument (
535
515
"--report_bucket_name" ,
536
516
help = "Name of the bucket to store reliability reports" ,
537
- default = env_args .get (
538
- "AUTOTRACK_REPORT_BUCKET_NAME" , "autopush-dev-reliability"
539
- ),
517
+ default = env_args .get ("AUTOTRACK_REPORT_BUCKET_NAME" , "autopush-reliability" ),
540
518
)
541
519
542
520
parser .add_argument (
@@ -600,9 +578,9 @@ async def amain(log: logging.Logger, settings: argparse.Namespace):
600
578
if await counter .get_lock ():
601
579
await counter .terminal_snapshot ()
602
580
# if we have a bucket to write to, write the reports to the bucket.
603
- if settings .bucket_name :
581
+ if settings .report_bucket_name :
604
582
client = storage .Client ()
605
- bucket = client .lookup_bucket (bucket_name = settings .bucket_name )
583
+ bucket = client .lookup_bucket (bucket_name = settings .report_bucket_name )
606
584
if bucket :
607
585
report_name = datetime .now ().strftime ("%Y-%m-%d" )
608
586
# technically, `bucket.list_blobs` can return `.num_results` but since this is
@@ -619,7 +597,7 @@ async def amain(log: logging.Logger, settings: argparse.Namespace):
619
597
else :
620
598
log .debug ("Reports already generated, skipping..." )
621
599
# Maybe we're just interested in getting a report?
622
- if not settings .bucket_name :
600
+ if not settings .report_bucket_name :
623
601
for style in settings .output :
624
602
print (await bigtable .output (style ))
625
603
print ("\f " )
0 commit comments