Public Member Functions | Public Attributes | Private Member Functions | List of all members
performance.prometheus.Prometheus Class Reference

Public Member Functions

def __init__ (self, str url, str start, str end)
 
Dict[str, Anyfetch_cpu_and_memory_data (self, List[str] container_list, Dict[str, List[str]] pod_dict)
 

Public Attributes

 end
 
 start
 
 url
 

Private Member Functions

Dict[str, Any_fetch_by_query (self, str query)
 
Dict[str, List[float]] _fetch_cpu_for_pod (self, str container_matcher, str pod_name)
 
Dict[str, List[float]] _fetch_memory_for_pod (self, str container_matcher, str pod_name)
 

Detailed Description

Objects which holds the start time, end time and query URL.

Definition at line 40 of file prometheus.py.

Constructor & Destructor Documentation

◆ __init__()

def performance.prometheus.Prometheus.__init__ (   self,
str  url,
str  start,
str  end 
)

Definition at line 43 of file prometheus.py.

Member Function Documentation

◆ _fetch_by_query()

Dict[str, Any] performance.prometheus.Prometheus._fetch_by_query (   self,
str  query 
)
private
Fetches the given query with time range.

Fetch the given query within a time range. The pulling
interval is every 5s, the actual data from the query is
a time series.

Definition at line 53 of file prometheus.py.

◆ _fetch_cpu_for_pod()

Dict[str, List[float]] performance.prometheus.Prometheus._fetch_cpu_for_pod (   self,
str  container_matcher,
str  pod_name 
)
private
Fetches the cpu data for each pod.

Fetch total cpu seconds during the time range specified in the Prometheus instance
for a pod. After obtain the cpu seconds, the data are trimmed from time series to
a data list and saved in the Dict that keyed by the container names.

Args:
    container_matcher:  A string consist one or more container name separated by |.

Definition at line 72 of file prometheus.py.

◆ _fetch_memory_for_pod()

Dict[str, List[float]] performance.prometheus.Prometheus._fetch_memory_for_pod (   self,
str  container_matcher,
str  pod_name 
)
private
Fetches memory data for each pod.

Fetch total memory data during the time range specified in the Prometheus instance
for a pod. After obtain the memory data, the data are trimmed from time series to
a data list and saved in the Dict that keyed by the container names.

Args:
    container_matcher:  A string consist one or more container name separated by |.

Definition at line 93 of file prometheus.py.

◆ fetch_cpu_and_memory_data()

Dict[str, Any] performance.prometheus.Prometheus.fetch_cpu_and_memory_data (   self,
List[str]  container_list,
Dict[str, List[str]]  pod_dict 
)
Fetch total cpu seconds and memory data for multiple pods.

Args:
    container_list: A list of container names to fetch the data for.
    pod_dict: the pods to fetch data for, the pod_dict is keyed by
      role of the pod: clients, driver and servers. The values
      for the pod_dict are the list of pod names that consist
      the same role specified in the key.

Definition at line 117 of file prometheus.py.

Member Data Documentation

◆ end

performance.prometheus.Prometheus.end

Definition at line 46 of file prometheus.py.

◆ start

performance.prometheus.Prometheus.start

Definition at line 45 of file prometheus.py.

◆ url

performance.prometheus.Prometheus.url

Definition at line 44 of file prometheus.py.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:41