U
    4Je8                     @   s*   d dl mZ d dlmZ G dd dZdS )    )Union)
Attributesc                   @   sv   e Zd ZdZdeeef eddddZe	eeef dddZ
e	edd	d
ZeedddZedddZdS )ObservationzA measurement observed in an asynchronous instrument

    Return/yield instances of this class from asynchronous instrument callbacks.

    Args:
        value: The float or int measured value
        attributes: The measurement's attributes
    N)value
attributesreturnc                 C   s   || _ || _d S N)_value_attributes)selfr   r    r   U/tmp/pip-unpacked-wheel-7_167w8m/mysql/opentelemetry/metrics/_internal/observation.py__init__   s    zObservation.__init__)r   c                 C   s   | j S r   )r	   r   r   r   r   r   "   s    zObservation.valuec                 C   s   | j S r   )r
   r   r   r   r   r   &   s    zObservation.attributes)otherr   c                 C   s"   t |to | j|jko | j|jkS r   )
isinstancer   r   r   )r   r   r   r   r   __eq__*   s
    


zObservation.__eq__c                 C   s   d| j  d| j dS )NzObservation(value=z, attributes=))r   r   r   r   r   r   __repr__1   s    zObservation.__repr__)N)__name__
__module____qualname____doc__r   intfloatr   r   propertyr   r   objectboolr   strr   r   r   r   r   r      s   	r   N)typingr   Zmysql.opentelemetry.util.typesr   r   r   r   r   r   <module>   s   