A helper class for computing metric differences.  
 More...
 | 
| metric_module.MetricsSnapshot  | baseline (self) | 
|   | 
| None  | baseline (self, metric_module.MetricsSnapshot value) | 
|   | 
| metric_module.MetricsSnapshot  | current (self) | 
|   | 
| None  | current (self, metric_module.MetricsSnapshot value) | 
|   | 
| metric_module.MetricsSnapshot  | diff (self) | 
|   | 
| float  | value_at (self, typing.Optional[str] subpath=None, typing.Optional[typing.Dict] add_labels=None, *typing.Optional[float] default=None) | 
|   | Returns a single metric value at the specified path, prepending the path provided at construction.  
  | 
|   | 
| metric_module.MetricsSnapshot  | fetch (self) | 
|   | Fetches metric values from the service.  
  | 
|   | 
|  'MetricsDiffer'  | __aenter__ (self) | 
|   | 
| None  | __aexit__ (self, exc_type, exc, tb) | 
|   | 
A helper class for computing metric differences. 
- See also
 - ClientMonitor.metrics_diff 
 
Definition at line 514 of file client.py.
 
◆ __aenter__()
      
        
          |  'MetricsDiffer' pytest_userver.client.MetricsDiffer.__aenter__  | 
          ( | 
            | 
          self | ) | 
           | 
        
      
 
 
◆ __aexit__()
      
        
          |  None pytest_userver.client.MetricsDiffer.__aexit__  | 
          ( | 
            | 
          self,  | 
        
        
           | 
           | 
            | 
          exc_type,  | 
        
        
           | 
           | 
            | 
          exc,  | 
        
        
           | 
           | 
            | 
          tb  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ baseline() [1/2]
      
        
          |  metric_module.MetricsSnapshot pytest_userver.client.MetricsDiffer.baseline  | 
          ( | 
            | 
          self | ) | 
           | 
        
      
 
 
◆ baseline() [2/2]
      
        
          |  None pytest_userver.client.MetricsDiffer.baseline  | 
          ( | 
            | 
          self,  | 
        
        
           | 
           | 
          metric_module.MetricsSnapshot  | 
          value  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ current() [1/2]
      
        
          |  metric_module.MetricsSnapshot pytest_userver.client.MetricsDiffer.current  | 
          ( | 
            | 
          self | ) | 
           | 
        
      
 
 
◆ current() [2/2]
      
        
          |  None pytest_userver.client.MetricsDiffer.current  | 
          ( | 
            | 
          self,  | 
        
        
           | 
           | 
          metric_module.MetricsSnapshot  | 
          value  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ diff()
      
        
          |  metric_module.MetricsSnapshot pytest_userver.client.MetricsDiffer.diff  | 
          ( | 
            | 
          self | ) | 
           | 
        
      
 
 
◆ fetch()
      
        
          |  metric_module.MetricsSnapshot pytest_userver.client.MetricsDiffer.fetch  | 
          ( | 
            | 
          self | ) | 
           | 
        
      
 
Fetches metric values from the service. 
Definition at line 604 of file client.py.
 
 
◆ value_at()
      
        
          |  float pytest_userver.client.MetricsDiffer.value_at  | 
          ( | 
            | 
          self,  | 
        
        
           | 
           | 
          typing.Optional[str]   | 
          subpath = None,  | 
        
        
           | 
           | 
          typing.Optional[typing.Dict]   | 
          add_labels = None,  | 
        
        
           | 
           | 
          *typing.Optional[float]   | 
          default = None  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Returns a single metric value at the specified path, prepending the path provided at construction. 
If a dict of labels is provided, does en exact match of labels, prepending the labels provided at construction.
- Parameters
 - 
  
    | subpath | Suffix of the metric path; the path provided at construction is prepended  | 
    | add_labels | Labels that the metric must have in addition to the labels provided at construction  | 
    | default | An optional default value in case the metric is missing  | 
  
   
- Exceptions
 - 
  
    | AssertionError | if not one metric by path  | 
  
   
Definition at line 573 of file client.py.
 
 
◆ _baseline
  
  
      
        
          | pytest_userver.client.MetricsDiffer._baseline | 
         
       
   | 
  
protected   | 
  
 
 
◆ _current
  
  
      
        
          | pytest_userver.client.MetricsDiffer._current | 
         
       
   | 
  
protected   | 
  
 
 
◆ _diff
  
  
      
        
          | pytest_userver.client.MetricsDiffer._diff | 
         
       
   | 
  
protected   | 
  
 
 
◆ _diff_gauge
  
  
      
        
          | pytest_userver.client.MetricsDiffer._diff_gauge | 
         
       
   | 
  
protected   | 
  
 
 
◆ current
      
        
          | pytest_userver.client.MetricsDiffer.current | 
        
      
 
 
The documentation for this class was generated from the following file:
- /data/code/service_template/third_party/userver/testsuite/pytest_plugins/pytest_userver/client.py