Skip to content

Commit 87174bc

Browse files
committed
Remove FP from rate
1 parent f57cdea commit 87174bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

estimate_push_protection_rate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def main() -> None:
6060
now = datetime.now(timezone.utc)
6161

6262
cut_off_date = args.cut_off_date
63-
cut_off_datetime = None
63+
cut_off_datetime = now
6464

6565
if cut_off_date is not None:
6666
try:
@@ -114,7 +114,8 @@ def main() -> None:
114114
))
115115

116116
blocking_timespan = now - earliest_date
117-
rate = len(remaining_protected_secrets) / blocking_timespan.days if blocking_timespan.days > 0 else len(remaining_protected_secrets)
117+
count_without_false_positives = len(remaining_protected_secrets) - false_positives
118+
rate = count_without_false_positives / blocking_timespan.days if blocking_timespan.days > 0 else count_without_false_positives
118119

119120
print(f"Estimated secrets blocked per day since {earliest_date.date()}: {rate:.2f}")
120121
print(f" ... per week ... : {rate * 7:.2f}")

0 commit comments

Comments
 (0)