
6]c           @  sk   d  d l  m Z d  d l Z d  d l Z d d l m Z d d l m Z d e f d     YZ	 e	   Z
 d S(   i(   t   unicode_literalsNi   (   t   CounterMetricFamily(   t   REGISTRYt   GCCollectorc           B  s#   e  Z d  Z e d  Z d   Z RS(   u,   Collector for Garbage collection statistics.c         C  s7   t  t d  s" t j   d k r& d  S| j |   d  S(   Nu	   get_statsu   CPython(   t   hasattrt   gct   platformt   python_implementationt   register(   t   selft   registry(    (    s=   lib/python2.7/site-packages/prometheus_client/gc_collector.pyt   __init__   s    "c         C  s   t  d d d d g } t  d d d d g } t  d d d d g } xz t t j    D]f \ } } t |  } | j | g d	 | d
 | j | g d	 | d | j | g d	 | d q[ W| | | g S(   Nu   python_gc_objects_collectedu   Objects collected during gct   labelsu
   generationu   python_gc_objects_uncollectableu$   Uncollectable object found during GCu   python_gc_collectionsu-   Number of times this generation was collectedt   valueu	   collectedu   uncollectableu   collections(   R   t	   enumerateR   t	   get_statst   strt
   add_metric(   R	   t	   collectedt   uncollectablet   collectionst
   generationt   stat(    (    s=   lib/python2.7/site-packages/prometheus_client/gc_collector.pyt   collect   s$    (   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s=   lib/python2.7/site-packages/prometheus_client/gc_collector.pyR      s   (   t
   __future__R    R   R   t   metrics_coreR   R
   R   t   objectR   t   GC_COLLECTOR(    (    (    s=   lib/python2.7/site-packages/prometheus_client/gc_collector.pyt   <module>   s   #	