From 7da0ccd55be00de511a97e4b95f2ca4fc59cd197 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 18 Dec 2021 11:35:50 -0500 Subject: [PATCH] Fine tune reporting of CFE internals --- src/js/cosmetic-filtering.js | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index 2dfa88921..3634a80ef 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -1127,28 +1127,31 @@ FilterContainer.prototype.getFilterCount = function() { /******************************************************************************/ FilterContainer.prototype.dump = function() { + let genericCount = 0; + for ( const i of [ 'simple', 'complex' ] ) { + for ( const j of [ 'id', 'cl' ] ) { + genericCount += this.lowlyGeneric[j][i].size; + } + } return [ 'Cosmetic Filtering Engine internals:', - `specific counts: ${this.specificFilters.size}`, - 'generic counts:', - ` lowly.id.simple: ${this.lowlyGeneric.id.simple.size}`, - ` lowly.class.simple: ${this.lowlyGeneric.cl.simple.size}`, - ` lowly.id.complex: ${this.lowlyGeneric.id.complex.size}`, - ` lowly.class.complex: ${this.lowlyGeneric.cl.complex.size}`, - ` highly.simple: ${this.highlyGeneric.simple.dict.size}`, - ` highly.complex: ${this.highlyGeneric.complex.dict.size}`, - `+ lowly.id.simple: ${this.lowlyGeneric.id.simple.size}`, - ...Array.from(this.lowlyGeneric.id.simple).map(a => ` ###${a}`), - `+ lowly.id.complex: ${this.lowlyGeneric.id.complex.size}`, - ...Array.from(this.lowlyGeneric.id.complex.values()).map(a => ` ###${a}`), - `+ lowly.class.simple: ${this.lowlyGeneric.cl.simple.size}`, - ...Array.from(this.lowlyGeneric.cl.simple).map(a => ` ##.${a}`), - `+ lowly.class.complex: ${this.lowlyGeneric.cl.complex.size}`, - ...Array.from(this.lowlyGeneric.cl.complex.values()).map(a => ` ##.${a}`), - `+ highly.simple: ${this.highlyGeneric.simple.dict.size}`, - ...Array.from(this.highlyGeneric.simple.dict).map(a => ` ##${a}`), - `+ highly.complex: ${this.highlyGeneric.complex.dict.size}`, - ...Array.from(this.highlyGeneric.complex.dict).map(a => ` ##${a}`), + `specific: ${this.specificFilters.size}`, + `generic: ${genericCount}`, + `+ lowly.id: ${this.lowlyGeneric.id.simple.size + this.lowlyGeneric.id.complex.size}`, + ` + simple: ${this.lowlyGeneric.id.simple.size}`, + ...Array.from(this.lowlyGeneric.id.simple).map(a => ` ###${a}`), + ` + complex: ${this.lowlyGeneric.id.complex.size}`, + ...Array.from(this.lowlyGeneric.id.complex.values()).map(a => ` ##${a}`), + `+ lowly.class: ${this.lowlyGeneric.cl.simple.size + this.lowlyGeneric.cl.complex.size}`, + ` + simple: ${this.lowlyGeneric.cl.simple.size}`, + ...Array.from(this.lowlyGeneric.cl.simple).map(a => ` ##.${a}`), + ` + complex: ${this.lowlyGeneric.cl.complex.size}`, + ...Array.from(this.lowlyGeneric.cl.complex.values()).map(a => ` ##${a}`), + `+ highly: ${this.highlyGeneric.simple.dict.size + this.highlyGeneric.complex.dict.size}`, + ` + highly.simple: ${this.highlyGeneric.simple.dict.size}`, + ...Array.from(this.highlyGeneric.simple.dict).map(a => ` ##${a}`), + ` + highly.complex: ${this.highlyGeneric.complex.dict.size}`, + ...Array.from(this.highlyGeneric.complex.dict).map(a => ` ##${a}`), ].join('\n'); };