示例#1
0
 def __init__(self, normalized_shares: float, container: ContainerInterface,
              common_labels: Dict[str, str]):
     self.normalized_shares = normalized_shares
     self.cgroup = container.get_cgroup()
     super().__init__(value=normalized_shares,
                      common_labels=common_labels,
                      min_value=0)
示例#2
0
 def __init__(self, value: bool, container: ContainerInterface,
              common_labels: Dict[str, str]):
     self.value = value
     self.cgroup = container.get_cgroup()
     super().__init__(value=value,
                      common_labels=common_labels,
                      min_value=0,
                      max_value=1)
示例#3
0
 def __init__(self, value: str, container: ContainerInterface, common_labels: dict):
     assert isinstance(value, str)
     self.cgroup = container.get_cgroup()
     self.subcgroups = container.get_subcgroups()
     self.value = value
     self.common_labels = common_labels
     self.labels_updater = LabelsUpdater(common_labels or {})
     self.min_value = 0
     self.max_value = None  # TO BE UPDATED by subclass
示例#4
0
 def __init__(self, normalized_quota: float, container: ContainerInterface,
              common_labels: dict):
     self.normalized_quota = normalized_quota
     self.cgroup = container.get_cgroup()
     self.subcgroups = container.get_subcgroups()
     super().__init__(value=normalized_quota,
                      common_labels=common_labels,
                      min_value=0,
                      max_value=1.0)
示例#5
0
 def __init__(self, value: str, container: ContainerInterface,
              common_labels: dict):
     assert isinstance(value, str)
     self.cgroup = container.get_cgroup()
     self._original_value = value
     self.value = _parse_cpuset(value)
     self.common_labels = common_labels
     self.labels_updater = LabelsUpdater(common_labels or {})
     # First core
     self.min_value = 0
     # Last core
     self.max_value = self.cgroup.platform_cpus - 1