Skip to content

Commit

Permalink
Improve Gauge typing for param multiprocess_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rafsaf committed Jul 11, 2023
1 parent c72c4f3 commit bb99445
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion prometheus_client/metrics.py
@@ -1,4 +1,5 @@
import os
import sys
from threading import Lock
import time
import types
Expand All @@ -17,6 +18,9 @@
from .samples import Exemplar, Sample
from .utils import floatToGoString, INF

if sys.version_info >= (3, 8, 0):
from typing import Literal

T = TypeVar('T', bound='MetricWrapperBase')
F = TypeVar("F", bound=Callable[..., Any])

Expand Down Expand Up @@ -357,7 +361,7 @@ def __init__(self,
unit: str = '',
registry: Optional[CollectorRegistry] = REGISTRY,
_labelvalues: Optional[Sequence[str]] = None,
multiprocess_mode: str = 'all',
multiprocess_mode: "Literal['all', 'liveall', 'min', 'livemin', 'max', 'livemax', 'sum', 'livesum']" = 'all',
):
self._multiprocess_mode = multiprocess_mode
if multiprocess_mode not in self._MULTIPROC_MODES:
Expand Down

0 comments on commit bb99445

Please sign in to comment.