.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 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 __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 histogram_class, and 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 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 get(), and measures.

Referenced by get(), and searx.answerers._core.AnswerStorage.register().

+ Here is the call graph for this function:
+ 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 configure().

◆ measures

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

Definition at line 111 of file models.py.

Referenced by configure(), dump(), and get().


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