.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.metrics.models.HistogramStorage Class Reference

Public Member Functions

 __init__ (self, histogram_class=Histogram)
 
 clear (self)
 
 configure (self, width, size, *args)
 
 get (self, *args)
 
 dump (self)
 

Public Attributes

 histogram_class = histogram_class
 
dict measures = {}
 

Static Private Attributes

str __slots__ = 'measures', 'histogram_class'
 

Detailed Description

Definition at line 102 of file models.py.

Constructor & Destructor Documentation

◆ __init__()

searx.metrics.models.HistogramStorage.__init__ ( self,
histogram_class = Histogram )

Definition at line 106 of file models.py.

106 def __init__(self, histogram_class=Histogram):
107 self.clear()
108 self.histogram_class = histogram_class
109

References searx.metrics.models.CounterStorage.clear(), and searx.metrics.models.HistogramStorage.clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ clear()

searx.metrics.models.HistogramStorage.clear ( self)

Definition at line 110 of file models.py.

110 def clear(self):
111 self.measures = {}
112

Referenced by searx.metrics.models.HistogramStorage.__init__().

+ Here is the caller graph for this function:

◆ configure()

searx.metrics.models.HistogramStorage.configure ( self,
width,
size,
* args )

Definition at line 113 of file models.py.

113 def configure(self, width, size, *args):
114 measure = self.histogram_class(width, size)
115 self.measures[args] = measure
116 return measure
117

References searx.metrics.models.HistogramStorage.histogram_class, and searx.metrics.models.HistogramStorage.measures.

◆ dump()

searx.metrics.models.HistogramStorage.dump ( self)

Definition at line 121 of file models.py.

121 def dump(self):
122 logger.debug("Histograms:")
123 ks = sorted(self.measures.keys(), key='/'.join) # pylint: disable=invalid-name
124 for k in ks:
125 logger.debug("- %-60s %s", '|'.join(k), self.measures[k])
126
127

References searx.metrics.models.HistogramStorage.measures.

◆ get()

searx.metrics.models.HistogramStorage.get ( self,
* args )

Definition at line 118 of file models.py.

118 def get(self, *args):
119 return self.measures.get(args, None)
120

References searx.metrics.models.HistogramStorage.measures.

Referenced by searx.botdetection.config.Config.__getitem__(), searx.botdetection.config.Config.path(), and searx.botdetection.config.Config.pyobj().

+ Here is the caller graph for this function:

Member Data Documentation

◆ __slots__

str searx.metrics.models.HistogramStorage.__slots__ = 'measures', 'histogram_class'
staticprivate

Definition at line 104 of file models.py.

◆ histogram_class

searx.metrics.models.HistogramStorage.histogram_class = histogram_class

Definition at line 108 of file models.py.

Referenced by searx.metrics.models.HistogramStorage.configure().

◆ measures

dict searx.metrics.models.HistogramStorage.measures = {}

The documentation for this class was generated from the following file: