HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/mysql/opentelemetry/sdk/metrics/_internal/__pycache__/view.cpython-39.pyc
a

�,�h�@snddlmZddlmZddlmZmZmZddlmZddl	m
Z
mZddlm
Z
ee�ZGdd�d�Zd	S)
�)�fnmatch)�	getLogger)�Optional�Set�Type)�
Instrument)�Aggregation�DefaultAggregation)�finalc@sveZdZdZe�Zd	eeeee	ee	ee	ee	ee	ee	ee
e	eed�	dd�Ze
eed�dd��ZdS)
�Viewa�
    A `View` configuration parameters can be used for the following
    purposes:

    1. Match instruments: When an instrument matches a view, measurements
       received by that instrument will be processed.
    2. Customize metric streams: A metric stream is identified by a match
       between a view and an instrument and a set of attributes. The metric
       stream can be customized by certain attributes of the corresponding view.

    The attributes documented next serve one of the previous two purposes.

    Args:
        instrument_type: This is an instrument matching attribute: the class the
            instrument must be to match the view.

        instrument_name: This is an instrument matching attribute: the name the
            instrument must have to match the view. Wild card characters are supported. Wild
            card characters should not be used with this attribute if the view has also a
            ``name`` defined.

        meter_name: This is an instrument matching attribute: the name the
            instrument meter must have to match the view.

        meter_version: This is an instrument matching attribute: the version
            the instrument meter must have to match the view.

        meter_schema_url: This is an instrument matching attribute: the schema
            URL the instrument meter must have to match the view.

        name: This is a metric stream customizing attribute: the name of the
            metric stream. If `None`, the name of the instrument will be used.

        description: This is a metric stream customizing attribute: the
            description of the metric stream. If `None`, the description of the instrument will
            be used.

        attribute_keys: This is a metric stream customizing attribute: this is
            a set of attribute keys. If not `None` then only the measurement attributes that
            are in ``attribute_keys`` will be used to identify the metric stream.

        aggregation: This is a metric stream customizing attribute: the
            aggregation instance to use when data is aggregated for the
            corresponding metrics stream. If `None` an instance of
            `DefaultAggregation` will be used.

    This class is not intended to be subclassed by the user.
    N)	�instrument_type�instrument_name�
meter_name�
meter_version�meter_schema_url�name�description�attribute_keys�aggregationc

Cs�||ur2|ur2|ur2|ur2durDnntd|����|durt|durtd|vsdd|vrttd|�d���||_||_||_||_||_||_||_||_|	p�|j	|_
dS)Nz=Some instrument selection criteria must be provided for View �*�?zView z5 declared with wildcard characters in instrument_name)�	Exception�_name�_instrument_type�_instrument_name�_meter_name�_meter_version�_meter_schema_urlZ_descriptionZ_attribute_keys�_default_aggregationZ_aggregation)
�selfrr
rrrrrrr�r �a/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/sdk/metrics/_internal/view.py�__init__TsH
�����
������
�z
View.__init__)�
instrument�returncCs�|jdurt||j�sdS|jdur6t|j|j�s6dS|jdurR|jj|jkrRdS|jdurn|jj|jkrndS|j	dur�|jj
|j	kr�dSdS)NFT)r�
isinstancerrrrZinstrumentation_scoper�versionrZ
schema_url)rr#r r r!�_match�s 




zView._match)	NNNNNNNNN)�__name__�
__module__�__qualname__�__doc__r	rrrr�strrrr"r
�boolr'r r r r!r s01�

�1rN)r�loggingr�typingrrrZmysql.opentelemetry.metricsrZ5mysql.opentelemetry.sdk.metrics._internal.aggregationrr	Ztyping_extensionsr
r(�_loggerrr r r r!�<module>s