__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
from typing import Dict, NamedTuple, Optional, Union
class Timestamp:
"""A nanosecond-resolution timestamp."""
def __init__(self, sec: float, nsec: float) -> None:
if nsec < 0 or nsec >= 1e9:
raise ValueError(f"Invalid value for nanoseconds in Timestamp: {nsec}")
if sec < 0:
nsec = -nsec
self.sec: int = int(sec)
self.nsec: int = int(nsec)
def __str__(self) -> str:
return f"{self.sec}.{self.nsec:09d}"
def __repr__(self) -> str:
return f"Timestamp({self.sec}, {self.nsec})"
def __float__(self) -> float:
return float(self.sec) + float(self.nsec) / 1e9
def __eq__(self, other: object) -> bool:
return isinstance(other, Timestamp) and self.sec == other.sec and self.nsec == other.nsec
def __ne__(self, other: object) -> bool:
return not self == other
def __gt__(self, other: "Timestamp") -> bool:
return self.nsec > other.nsec if self.sec == other.sec else self.sec > other.sec
def __lt__(self, other: "Timestamp") -> bool:
return self.nsec < other.nsec if self.sec == other.sec else self.sec < other.sec
# Timestamp and exemplar are optional.
# Value can be an int or a float.
# Timestamp can be a float containing a unixtime in seconds,
# a Timestamp object, or None.
# Exemplar can be an Exemplar object, or None.
class Exemplar(NamedTuple):
labels: Dict[str, str]
value: float
timestamp: Optional[Union[float, Timestamp]] = None
class Sample(NamedTuple):
name: str
labels: Dict[str, str]
value: float
timestamp: Optional[Union[float, Timestamp]] = None
exemplar: Optional[Exemplar] = None
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| bridge | Folder | 0755 |
|
|
| openmetrics | Folder | 0755 |
|
|
| twisted | Folder | 0755 |
|
|
| __init__.py | File | 1.77 KB | 0644 |
|
| asgi.py | File | 1.57 KB | 0644 |
|
| context_managers.py | File | 2.29 KB | 0644 |
|
| core.py | File | 860 B | 0644 |
|
| decorator.py | File | 15.43 KB | 0644 |
|
| exposition.py | File | 25.56 KB | 0644 |
|
| gc_collector.py | File | 1.48 KB | 0644 |
|
| metrics.py | File | 27.45 KB | 0644 |
|
| metrics_core.py | File | 15.18 KB | 0644 |
|
| mmap_dict.py | File | 5.27 KB | 0644 |
|
| multiprocess.py | File | 7.36 KB | 0644 |
|
| parser.py | File | 7.26 KB | 0644 |
|
| platform_collector.py | File | 1.83 KB | 0644 |
|
| process_collector.py | File | 3.77 KB | 0644 |
|
| py.typed | File | 0 B | 0644 |
|
| registry.py | File | 6.05 KB | 0644 |
|
| samples.py | File | 1.65 KB | 0644 |
|
| utils.py | File | 594 B | 0644 |
|
| values.py | File | 4.88 KB | 0644 |
|