@@ -41,13 +41,9 @@ t.test("it resets stats", async () => {
4141 } ,
4242 } ,
4343 userAgents : {
44- total : 0 ,
45- blocked : 0 ,
4644 breakdown : { } ,
4745 } ,
4846 ipAddresses : {
49- total : 0 ,
50- blocked : 0 ,
5147 breakdown : { } ,
5248 } ,
5349 } ) ;
@@ -66,13 +62,9 @@ t.test("it resets stats", async () => {
6662 } ,
6763 } ,
6864 userAgents : {
69- total : 0 ,
70- blocked : 0 ,
7165 breakdown : { } ,
7266 } ,
7367 ipAddresses : {
74- total : 0 ,
75- blocked : 0 ,
7668 breakdown : { } ,
7769 } ,
7870 } ) ;
@@ -102,13 +94,9 @@ t.test("it keeps track of amount of calls", async () => {
10294 } ,
10395 } ,
10496 userAgents : {
105- total : 0 ,
106- blocked : 0 ,
10797 breakdown : { } ,
10898 } ,
10999 ipAddresses : {
110- total : 0 ,
111- blocked : 0 ,
112100 breakdown : { } ,
113101 } ,
114102 } ) ;
@@ -144,13 +132,9 @@ t.test("it keeps track of amount of calls", async () => {
144132 } ,
145133 } ,
146134 userAgents : {
147- total : 0 ,
148- blocked : 0 ,
149135 breakdown : { } ,
150136 } ,
151137 ipAddresses : {
152- total : 0 ,
153- blocked : 0 ,
154138 breakdown : { } ,
155139 } ,
156140 } ) ;
@@ -186,13 +170,9 @@ t.test("it keeps track of amount of calls", async () => {
186170 } ,
187171 } ,
188172 userAgents : {
189- total : 0 ,
190- blocked : 0 ,
191173 breakdown : { } ,
192174 } ,
193175 ipAddresses : {
194- total : 0 ,
195- blocked : 0 ,
196176 breakdown : { } ,
197177 } ,
198178 } ) ;
@@ -222,13 +202,9 @@ t.test("it keeps track of amount of calls", async () => {
222202 } ,
223203 } ,
224204 userAgents : {
225- total : 0 ,
226- blocked : 0 ,
227205 breakdown : { } ,
228206 } ,
229207 ipAddresses : {
230- total : 0 ,
231- blocked : 0 ,
232208 breakdown : { } ,
233209 } ,
234210 } ) ;
@@ -264,13 +240,9 @@ t.test("it keeps track of amount of calls", async () => {
264240 } ,
265241 } ,
266242 userAgents : {
267- total : 0 ,
268- blocked : 0 ,
269243 breakdown : { } ,
270244 } ,
271245 ipAddresses : {
272- total : 0 ,
273- blocked : 0 ,
274246 breakdown : { } ,
275247 } ,
276248 } ) ;
@@ -306,13 +278,9 @@ t.test("it keeps track of amount of calls", async () => {
306278 } ,
307279 } ,
308280 userAgents : {
309- total : 0 ,
310- blocked : 0 ,
311281 breakdown : { } ,
312282 } ,
313283 ipAddresses : {
314- total : 0 ,
315- blocked : 0 ,
316284 breakdown : { } ,
317285 } ,
318286 } ) ;
@@ -367,13 +335,9 @@ t.test("it keeps track of amount of calls", async () => {
367335 } ,
368336 } ,
369337 userAgents : {
370- total : 0 ,
371- blocked : 0 ,
372338 breakdown : { } ,
373339 } ,
374340 ipAddresses : {
375- total : 0 ,
376- blocked : 0 ,
377341 breakdown : { } ,
378342 } ,
379343 } ) ;
@@ -424,13 +388,9 @@ t.test("it keeps track of requests", async () => {
424388 } ,
425389 } ,
426390 userAgents : {
427- total : 0 ,
428- blocked : 0 ,
429391 breakdown : { } ,
430392 } ,
431393 ipAddresses : {
432- total : 0 ,
433- blocked : 0 ,
434394 breakdown : { } ,
435395 } ,
436396 } ) ;
@@ -449,13 +409,9 @@ t.test("it keeps track of requests", async () => {
449409 } ,
450410 } ,
451411 userAgents : {
452- total : 0 ,
453- blocked : 0 ,
454412 breakdown : { } ,
455413 } ,
456414 ipAddresses : {
457- total : 0 ,
458- blocked : 0 ,
459415 breakdown : { } ,
460416 } ,
461417 } ) ;
@@ -475,13 +431,9 @@ t.test("it keeps track of requests", async () => {
475431 } ,
476432 } ,
477433 userAgents : {
478- total : 0 ,
479- blocked : 0 ,
480434 breakdown : { } ,
481435 } ,
482436 ipAddresses : {
483- total : 0 ,
484- blocked : 0 ,
485437 breakdown : { } ,
486438 } ,
487439 } ) ;
@@ -501,13 +453,9 @@ t.test("it keeps track of requests", async () => {
501453 } ,
502454 } ,
503455 userAgents : {
504- total : 0 ,
505- blocked : 0 ,
506456 breakdown : { } ,
507457 } ,
508458 ipAddresses : {
509- total : 0 ,
510- blocked : 0 ,
511459 breakdown : { } ,
512460 } ,
513461 } ) ;
@@ -528,13 +476,9 @@ t.test("it keeps track of requests", async () => {
528476 } ,
529477 } ,
530478 userAgents : {
531- total : 0 ,
532- blocked : 0 ,
533479 breakdown : { } ,
534480 } ,
535481 ipAddresses : {
536- total : 0 ,
537- blocked : 0 ,
538482 breakdown : { } ,
539483 } ,
540484 } ) ;
@@ -562,13 +506,9 @@ t.test("it force compresses stats", async () => {
562506 } ,
563507 } ,
564508 userAgents : {
565- total : 0 ,
566- blocked : 0 ,
567509 breakdown : { } ,
568510 } ,
569511 ipAddresses : {
570- total : 0 ,
571- blocked : 0 ,
572512 breakdown : { } ,
573513 } ,
574514 } ) ;
@@ -614,13 +554,9 @@ t.test("it keeps track of aborted requests", async () => {
614554 } ,
615555 } ,
616556 userAgents : {
617- total : 0 ,
618- blocked : 0 ,
619557 breakdown : { } ,
620558 } ,
621559 ipAddresses : {
622- total : 0 ,
623- blocked : 0 ,
624560 breakdown : { } ,
625561 } ,
626562 } ) ;
@@ -653,16 +589,12 @@ t.test("it keeps track of blocked IPs and user agents", async () => {
653589 } ,
654590 } ,
655591 userAgents : {
656- total : 1 ,
657- blocked : 1 ,
658592 breakdown : {
659593 // eslint-disable-next-line camelcase
660594 ai_bots : { total : 1 , blocked : 1 } ,
661595 } ,
662596 } ,
663597 ipAddresses : {
664- total : 1 ,
665- blocked : 1 ,
666598 breakdown : {
667599 "known_threat_actors/public_scanners" : { total : 1 , blocked : 1 } ,
668600 } ,
@@ -697,16 +629,12 @@ t.test("it keeps track of monitored IPs and user agents", async () => {
697629 } ,
698630 } ,
699631 userAgents : {
700- total : 1 ,
701- blocked : 0 ,
702632 breakdown : {
703633 // eslint-disable-next-line camelcase
704634 ai_data_scrapers : { total : 1 , blocked : 0 } ,
705635 } ,
706636 } ,
707637 ipAddresses : {
708- total : 1 ,
709- blocked : 0 ,
710638 breakdown : {
711639 "known_threat_actors/public_scanners" : { total : 1 , blocked : 0 } ,
712640 } ,
@@ -731,16 +659,12 @@ t.test("it keeps track of monitored IPs and user agents", async () => {
731659 } ,
732660 } ,
733661 userAgents : {
734- total : 2 ,
735- blocked : 0 ,
736662 breakdown : {
737663 // eslint-disable-next-line camelcase
738664 ai_data_scrapers : { total : 2 , blocked : 0 } ,
739665 } ,
740666 } ,
741667 ipAddresses : {
742- total : 2 ,
743- blocked : 0 ,
744668 breakdown : {
745669 "known_threat_actors/public_scanners" : { total : 2 , blocked : 0 } ,
746670 } ,
@@ -767,8 +691,6 @@ t.test("should track multiple matches for the same key", (t) => {
767691
768692 const result = stats . getStats ( ) ;
769693
770- t . equal ( result . ipAddresses . total , 1 ) ;
771- t . equal ( result . ipAddresses . blocked , 1 ) ;
772694 t . equal (
773695 result . ipAddresses . breakdown [ "known_threat_actors/public_scanners" ] . total ,
774696 2
@@ -778,8 +700,6 @@ t.test("should track multiple matches for the same key", (t) => {
778700 1
779701 ) ;
780702
781- t . equal ( result . userAgents . total , 1 ) ;
782- t . equal ( result . userAgents . blocked , 1 ) ;
783703 t . equal ( result . userAgents . breakdown [ "ai_data_scrapers" ] . total , 2 ) ;
784704 t . equal ( result . userAgents . breakdown [ "ai_data_scrapers" ] . blocked , 1 ) ;
785705
0 commit comments