diff --git a/.venv/lib/python3.11/site-packages/opencensus/__init__.py b/.venv/lib/python3.11/site-packages/opencensus/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa4f9cf4befe34d396ca566b4e4c4947b6f29b64 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/.venv/lib/python3.11/site-packages/opencensus/log/__init__.py b/.venv/lib/python3.11/site-packages/opencensus/log/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2dfc6ed9550bda5dc3c374a3dadf1baa30e2ce93 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/log/__init__.py @@ -0,0 +1,115 @@ +# Copyright 2019, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from collections import namedtuple +from copy import copy + +from opencensus.trace import execution_context + +_meta_logger = logging.getLogger(__name__) + +TRACE_ID_KEY = 'traceId' +SPAN_ID_KEY = 'spanId' +SAMPLING_DECISION_KEY = 'traceSampled' + +LogAttrs = namedtuple('LogAttrs', ['trace_id', 'span_id', 'sampling_decision']) +ATTR_DEFAULTS = LogAttrs("00000000000000000000000000000000", + "0000000000000000", False) + + +def get_log_attrs(): + """Get logging attributes from the opencensus context. + + :rtype: :class:`LogAttrs` + :return: The current span's trace ID, span ID, and sampling decision. + """ + try: + tracer = execution_context.get_opencensus_tracer() + if tracer is None: + raise RuntimeError + except Exception: # noqa + _meta_logger.error("Failed to get opencensus tracer") + return ATTR_DEFAULTS + + try: + trace_id = tracer.span_context.trace_id + if trace_id is None: + trace_id = ATTR_DEFAULTS.trace_id + except Exception: # noqa + _meta_logger.error("Failed to get opencensus trace ID") + trace_id = ATTR_DEFAULTS.trace_id + + try: + span_id = tracer.span_context.span_id + if span_id is None: + span_id = ATTR_DEFAULTS.span_id + except Exception: # noqa + _meta_logger.error("Failed to get opencensus span ID") + span_id = ATTR_DEFAULTS.span_id + + try: + sampling_decision = tracer.span_context.trace_options.get_enabled() + if sampling_decision is None: + sampling_decision = ATTR_DEFAULTS.sampling_decision + except AttributeError: + sampling_decision = ATTR_DEFAULTS.sampling_decision + except Exception: # noqa + _meta_logger.error("Failed to get opencensus sampling decision") + sampling_decision = ATTR_DEFAULTS.sampling_decision + + return LogAttrs(trace_id, span_id, sampling_decision) + + +def _set_extra_attrs(extra): + trace_id, span_id, sampling_decision = get_log_attrs() + extra.setdefault(TRACE_ID_KEY, trace_id) + extra.setdefault(SPAN_ID_KEY, span_id) + extra.setdefault(SAMPLING_DECISION_KEY, sampling_decision) + + +# See +# https://docs.python.org/3.7/library/logging.html#loggeradapter-objects, +# https://docs.python.org/3.7/howto/logging-cookbook.html#context-info +class TraceLoggingAdapter(logging.LoggerAdapter): + """Adapter to add opencensus context attrs to records.""" + def process(self, msg, kwargs): + kwargs = copy(kwargs) + if self.extra: + extra = copy(self.extra) + else: + extra = {} + extra.update(kwargs.get('extra', {})) + _set_extra_attrs(extra) + kwargs['extra'] = extra + + return (msg, kwargs) + + +# This is the idiomatic way to stack logger customizations, see +# https://docs.python.org/3.7/library/logging.html#logging.getLoggerClass +class TraceLogger(logging.getLoggerClass()): + """Logger class that adds opencensus context attrs to records.""" + def makeRecord(self, *args, **kwargs): + try: + extra = args[8] + if extra is None: + extra = {} + args = tuple(list(args[:8]) + [extra] + list(args[9:])) + except IndexError: # pragma: NO COVER + extra = kwargs.setdefault('extra', {}) + if extra is None: + kwargs['extra'] = extra + _set_extra_attrs(extra) + return super(TraceLogger, self).makeRecord(*args, **kwargs) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__init__.py b/.venv/lib/python3.11/site-packages/opencensus/stats/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e1eca01eaa16bb6f490081015cb2951c179fba21 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/__init__.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0c3f188f9ac438abd9a33da00fb341cb7baf130 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/__init__.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/aggregation.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/aggregation.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..750ecc472b4cb2f7088aa083fd7a574673df6f64 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/aggregation.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/aggregation_data.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/aggregation_data.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a221ec0cb7b9d2d45d9096e1da7927b98f5f48e7 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/aggregation_data.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/base_exporter.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/base_exporter.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df984efda430a15fbb7f8136e78be2f5a847a9cc Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/base_exporter.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/bucket_boundaries.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/bucket_boundaries.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0c4dc1d2a026e252b86347580549e0ed0d9d2d9 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/bucket_boundaries.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/execution_context.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/execution_context.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4572f26515937e93da8c034e0f5e19d7260ba62b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/execution_context.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measure.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measure.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5030ae0ebf82cd81c6f97fe025e10c30059ee7cb Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measure.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measure_to_view_map.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measure_to_view_map.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c327db6dc8ce91ad8093859d98b46222b2e186e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measure_to_view_map.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measurement.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measurement.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..04b0b96f6338c7b381f868626f9095b786049ccb Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measurement.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measurement_map.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measurement_map.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fce17593af0e03ca6599df653d167b8a83c923c Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/measurement_map.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/metric_utils.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/metric_utils.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7b4730549a81caa770ba99284d5a8507664a769 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/metric_utils.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/stats.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/stats.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9f97fc0551c74dc6b288b4fcea79841f01f77c3 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/stats.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/stats_recorder.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/stats_recorder.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e0af7ab69d647c6c01c23285d653efe131d6f9b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/stats_recorder.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ddd0837d1633618a9ce160870ec8598fa92667a6 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view_data.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view_data.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c316778876dc8fbaec0b852af1f9e5d5d6cfa15d Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view_data.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view_manager.cpython-311.pyc b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view_manager.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fd1b092d243a58c708d4b689a28038bc3a73098 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/opencensus/stats/__pycache__/view_manager.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/aggregation.py b/.venv/lib/python3.11/site-packages/opencensus/stats/aggregation.py new file mode 100644 index 0000000000000000000000000000000000000000..ee91eb004a6793647495a82346ced5da1a87c0f8 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/aggregation.py @@ -0,0 +1,144 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging + +from opencensus.metrics.export.metric_descriptor import MetricDescriptorType +from opencensus.stats import aggregation_data +from opencensus.stats import measure as measure_module + +logger = logging.getLogger(__name__) + + +class SumAggregation(object): + """Sum Aggregation describes that data collected and aggregated with this + method will be summed + + :type sum: int or float + :param sum: the initial sum to be used in the aggregation + + """ + def __init__(self, sum=None): + self._initial_sum = sum or 0 + + def new_aggregation_data(self, measure): + """Get a new AggregationData for this aggregation.""" + value_type = MetricDescriptorType.to_type_class( + self.get_metric_type(measure)) + return aggregation_data.SumAggregationData( + value_type=value_type, sum_data=self._initial_sum) + + @staticmethod + def get_metric_type(measure): + """Get the MetricDescriptorType for the metric produced by this + aggregation and measure. + """ + if isinstance(measure, measure_module.MeasureInt): + return MetricDescriptorType.CUMULATIVE_INT64 + if isinstance(measure, measure_module.MeasureFloat): + return MetricDescriptorType.CUMULATIVE_DOUBLE + raise ValueError + + +class CountAggregation(object): + """Describes that the data collected and aggregated with this method will + be turned into a count value + + :type count: int + :param count: the initial count to be used in the aggregation + + """ + def __init__(self, count=0): + self._initial_count = count + + def new_aggregation_data(self, measure=None): + """Get a new AggregationData for this aggregation.""" + return aggregation_data.CountAggregationData(self._initial_count) + + @staticmethod + def get_metric_type(measure): + """Get the MetricDescriptorType for the metric produced by this + aggregation and measure. + """ + return MetricDescriptorType.CUMULATIVE_INT64 + + +class DistributionAggregation(object): + """Distribution Aggregation indicates that the desired aggregation is a + histogram distribution + + :type boundaries: list(:class:'~opencensus.stats.bucket_boundaries. + BucketBoundaries') + :param boundaries: the bucket endpoints + + """ + + def __init__(self, boundaries=None): + if boundaries: + if not all(boundaries[ii] < boundaries[ii + 1] + for ii in range(len(boundaries) - 1)): + raise ValueError("bounds must be sorted in increasing order") + for ii, bb in enumerate(boundaries): + if bb > 0: + break + else: + ii += 1 + if ii: + logger.warning("Dropping %s non-positive bucket boundaries", + ii) + boundaries = boundaries[ii:] + + self._boundaries = boundaries + + def new_aggregation_data(self, measure=None): + """Get a new AggregationData for this aggregation.""" + return aggregation_data.DistributionAggregationData( + 0, 0, 0, None, self._boundaries) + + @staticmethod + def get_metric_type(measure): + """Get the MetricDescriptorType for the metric produced by this + aggregation and measure. + """ + return MetricDescriptorType.CUMULATIVE_DISTRIBUTION + + +class LastValueAggregation(object): + """Describes that the data collected with this method will + overwrite the last recorded value + + :type value: long + :param count: the initial value to be used in the aggregation + + """ + def __init__(self, value=0): + self._initial_value = value + + def new_aggregation_data(self, measure): + """Get a new AggregationData for this aggregation.""" + value_type = MetricDescriptorType.to_type_class( + self.get_metric_type(measure)) + return aggregation_data.LastValueAggregationData( + value=self._initial_value, value_type=value_type) + + @staticmethod + def get_metric_type(measure): + """Get the MetricDescriptorType for the metric produced by this + aggregation and measure. + """ + if isinstance(measure, measure_module.MeasureInt): + return MetricDescriptorType.GAUGE_INT64 + if isinstance(measure, measure_module.MeasureFloat): + return MetricDescriptorType.GAUGE_DOUBLE + raise ValueError diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/aggregation_data.py b/.venv/lib/python3.11/site-packages/opencensus/stats/aggregation_data.py new file mode 100644 index 0000000000000000000000000000000000000000..a5b3827adf055b89ead7d389013461e2e6cf1b91 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/aggregation_data.py @@ -0,0 +1,399 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy +import logging + +from opencensus.metrics.export import point, value +from opencensus.stats import bucket_boundaries + +logger = logging.getLogger(__name__) + + +class SumAggregationData(object): + """Sum Aggregation Data is the aggregated data for the Sum aggregation + + :type value_type: class that is either + :class:`opencensus.metrics.export.value.ValueDouble` or + :class:`opencensus.metrics.export.value.ValueLong` + :param value_type: the type of value to be used when creating a point + :type sum_data: int or float + :param sum_data: represents the initial aggregated sum + + """ + + def __init__(self, value_type, sum_data): + self._value_type = value_type + self._sum_data = sum_data + + def __repr__(self): + return ("{}({})" + .format( + type(self).__name__, + self.sum_data, + )) + + def add_sample(self, value, timestamp=None, attachments=None): + """Allows the user to add a sample to the Sum Aggregation Data + The value of the sample is then added to the current sum data + """ + self._sum_data += value + + @property + def sum_data(self): + """The current sum data""" + return self._sum_data + + @property + def value_type(self): + """The value type to use when creating the point""" + return self._value_type + + def to_point(self, timestamp): + """Get a Point conversion of this aggregation. + + :type timestamp: :class: `datetime.datetime` + :param timestamp: The time to report the point as having been recorded. + + :rtype: :class: `opencensus.metrics.export.point.Point` + :return: a Point with value equal to `sum_data` and of type + `_value_type`. + """ + return point.Point(self._value_type(self.sum_data), timestamp) + + +class CountAggregationData(object): + """Count Aggregation Data is the count value of aggregated data + + :type count_data: long + :param count_data: represents the initial aggregated count + + """ + + def __init__(self, count_data): + self._count_data = count_data + + def __repr__(self): + return ("{}({})" + .format( + type(self).__name__, + self.count_data, + )) + + def add_sample(self, value, timestamp=None, attachments=None): + """Adds a sample to the current Count Aggregation Data and adds 1 to + the count data""" + self._count_data = self._count_data + 1 + + @property + def count_data(self): + """The current count data""" + return self._count_data + + def to_point(self, timestamp): + """Get a Point conversion of this aggregation. + + :type timestamp: :class: `datetime.datetime` + :param timestamp: The time to report the point as having been recorded. + + :rtype: :class: `opencensus.metrics.export.point.Point` + :return: a :class: `opencensus.metrics.export.value.ValueLong`-valued + Point with value equal to `count_data`. + """ + return point.Point(value.ValueLong(self.count_data), timestamp) + + +class DistributionAggregationData(object): + """Distribution Aggregation Data refers to the distribution stats of + aggregated data + + :type mean_data: float + :param mean_data: the mean value of the distribution + + :type count_data: int + :param count_data: the count value of the distribution + + :type sum_of_sqd_deviations: float + :param sum_of_sqd_deviations: the sum of the sqd deviations from the mean + + :type counts_per_bucket: list(int) + :param counts_per_bucket: the number of occurrences per bucket + + :type exemplars: list(Exemplar) + :param: exemplars: the exemplars associated with histogram buckets. + + :type bounds: list(float) + :param bounds: the histogram distribution of the values + + """ + + def __init__(self, + mean_data, + count_data, + sum_of_sqd_deviations, + counts_per_bucket=None, + bounds=None, + exemplars=None): + if bounds is None and exemplars is not None: + raise ValueError + if exemplars is not None and len(exemplars) != len(bounds) + 1: + raise ValueError + + self._mean_data = mean_data + self._count_data = count_data + self._sum_of_sqd_deviations = sum_of_sqd_deviations + + if bounds is None: + bounds = [] + self._exemplars = None + else: + assert bounds == list(sorted(set(bounds))) + assert all(bb > 0 for bb in bounds) + if exemplars is None: + self._exemplars = {ii: None for ii in range(len(bounds) + 1)} + else: + self._exemplars = {ii: ex for ii, ex in enumerate(exemplars)} + self._bounds = (bucket_boundaries.BucketBoundaries(boundaries=bounds) + .boundaries) + + if counts_per_bucket is None: + counts_per_bucket = [0 for ii in range(len(bounds) + 1)] + else: + assert all(cc >= 0 for cc in counts_per_bucket) + assert len(counts_per_bucket) == len(bounds) + 1 + self._counts_per_bucket = counts_per_bucket + + def __repr__(self): + return ("{}({})" + .format( + type(self).__name__, + self.count_data, + )) + + @property + def mean_data(self): + """The current mean data""" + return self._mean_data + + @property + def count_data(self): + """The current count data""" + return self._count_data + + @property + def sum_of_sqd_deviations(self): + """The current sum of squared deviations from the mean""" + return self._sum_of_sqd_deviations + + @property + def counts_per_bucket(self): + """The current counts per bucket for the distribution""" + return self._counts_per_bucket + + @property + def exemplars(self): + """The current counts per bucket for the distribution""" + return self._exemplars + + @property + def bounds(self): + """The current bounds for the distribution""" + return self._bounds + + @property + def sum(self): + """The sum of the current distribution""" + return self._mean_data * self._count_data + + @property + def variance(self): + """The variance of the current distribution""" + if self._count_data <= 1: + return 0 + return self.sum_of_sqd_deviations / (self._count_data - 1) + + def add_sample(self, value, timestamp, attachments): + """Adding a sample to Distribution Aggregation Data""" + self._count_data += 1 + bucket = self.increment_bucket_count(value) + + if attachments is not None and self.exemplars is not None: + self.exemplars[bucket] = Exemplar(value, timestamp, attachments) + if self.count_data == 1: + self._mean_data = value + return + + old_mean = self._mean_data + self._mean_data = self._mean_data + ( + (value - self._mean_data) / self._count_data) + self._sum_of_sqd_deviations = self._sum_of_sqd_deviations + ( + (value - old_mean) * (value - self._mean_data)) + + def increment_bucket_count(self, value): + """Increment the bucket count based on a given value from the user""" + if len(self._bounds) == 0: + self._counts_per_bucket[0] += 1 + return 0 + + for ii, bb in enumerate(self._bounds): + if value < bb: + self._counts_per_bucket[ii] += 1 + return ii + else: + last_bucket_index = len(self._bounds) + self._counts_per_bucket[last_bucket_index] += 1 + return last_bucket_index + + def to_point(self, timestamp): + """Get a Point conversion of this aggregation. + + This method creates a :class: `opencensus.metrics.export.point.Point` + with a :class: `opencensus.metrics.export.value.ValueDistribution` + value, and creates buckets and exemplars for that distribution from the + appropriate classes in the `metrics` package. If the distribution + doesn't have a histogram (i.e. `bounds` is empty) the converted point's + `buckets` attribute will be null. + + :type timestamp: :class: `datetime.datetime` + :param timestamp: The time to report the point as having been recorded. + + :rtype: :class: `opencensus.metrics.export.point.Point` + :return: a :class: `opencensus.metrics.export.value.ValueDistribution` + -valued Point. + """ + if self.bounds: + bucket_options = value.BucketOptions(value.Explicit(self.bounds)) + buckets = [None] * len(self.counts_per_bucket) + for ii, count in enumerate(self.counts_per_bucket): + stat_ex = self.exemplars.get(ii) if self.exemplars else None + if stat_ex is not None: + metric_ex = value.Exemplar(stat_ex.value, + stat_ex.timestamp, + copy.copy(stat_ex.attachments)) + buckets[ii] = value.Bucket(count, metric_ex) + else: + buckets[ii] = value.Bucket(count) + + else: + bucket_options = value.BucketOptions() + buckets = None + return point.Point( + value.ValueDistribution( + count=self.count_data, + sum_=self.sum, + sum_of_squared_deviation=self.sum_of_sqd_deviations, + bucket_options=bucket_options, + buckets=buckets + ), + timestamp + ) + + +class LastValueAggregationData(object): + """ + LastValue Aggregation Data is the value of aggregated data + + :type value_type: class that is either + :class:`opencensus.metrics.export.value.ValueDouble` or + :class:`opencensus.metrics.export.value.ValueLong` + :param value_type: the type of value to be used when creating a point + :type value: long + :param value: represents the initial value + + """ + + def __init__(self, value_type, value): + self._value_type = value_type + self._value = value + + def __repr__(self): + return ("{}({})" + .format( + type(self).__name__, + self.value, + )) + + def add_sample(self, value, timestamp=None, attachments=None): + """Adds a sample to the current + LastValue Aggregation Data and overwrite + the current recorded value""" + self._value = value + + @property + def value(self): + """The current value recorded""" + return self._value + + @property + def value_type(self): + """The value type to use when creating the point""" + return self._value_type + + def to_point(self, timestamp): + """Get a Point conversion of this aggregation. + + :type timestamp: :class: `datetime.datetime` + :param timestamp: The time to report the point as having been recorded. + + :rtype: :class: `opencensus.metrics.export.point.Point` + :return: a Point with value of type `_value_type`. + """ + return point.Point(self._value_type(self.value), timestamp) + + +class Exemplar(object): + """ Exemplar represents an example point that may be used to annotate + aggregated distribution values, associated with a histogram bucket. + + :type value: double + :param value: value of the Exemplar point. + + :type timestamp: time + :param timestamp: the time that this Exemplar's value was recorded. + + :type attachments: dict + :param attachments: the contextual information about the example value. + """ + + def __init__(self, value, timestamp, attachments): + self._value = value + + self._timestamp = timestamp + + if attachments is None: + raise TypeError('attachments should not be empty') + + for key, value in attachments.items(): + if key is None or not isinstance(key, str): + raise TypeError('attachment key should not be ' + 'empty and should be a string') + if value is None or not isinstance(value, str): + raise TypeError('attachment value should not be ' + 'empty and should be a string') + self._attachments = attachments + + @property + def value(self): + """The current value of the Exemplar point""" + return self._value + + @property + def timestamp(self): + """The time that this Exemplar's value was recorded""" + return self._timestamp + + @property + def attachments(self): + """The contextual information about the example value""" + return self._attachments diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/base_exporter.py b/.venv/lib/python3.11/site-packages/opencensus/stats/base_exporter.py new file mode 100644 index 0000000000000000000000000000000000000000..fcb56d6b90f0cf7e5fb3e0606aed96f56bfba720 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/base_exporter.py @@ -0,0 +1,42 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Module containing base class for exporters.""" + + +class StatsExporter(object): + """Base class for opencensus stats exporters. + + Subclasses of :class:`Exporter` must override :meth:`export`. + """ + + def on_register_view(self, view): + """ + :type view: object of :class: + `~opencensus.stats.view.View` + :param object of opencensus.stats.view.View view: + View object to register + """ + raise NotImplementedError # pragma: NO COVER + + def emit(self, view_datas): + """Send view and measurement to exporter record method, + and then it will record on its own way. + + :type view_datas: object of :class: + `~opencensus.stats.view_data.ViewData` + :param list of opencensus.stats.view_data.ViewData ViewData: + list of ViewData object to send to Stackdriver Monitoring + """ + raise NotImplementedError # pragma: NO COVER diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/bucket_boundaries.py b/.venv/lib/python3.11/site-packages/opencensus/stats/bucket_boundaries.py new file mode 100644 index 0000000000000000000000000000000000000000..d7c488d0011838a73e86c5f4362fd48013d891bc --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/bucket_boundaries.py @@ -0,0 +1,41 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +class BucketBoundaries(object): + """The bucket boundaries for a histogram + + :type boundaries: list(float) + :param boundaries: boundaries for the buckets in the underlying histogram + + """ + def __init__(self, boundaries=None): + self._boundaries = list(boundaries or []) + + @property + def boundaries(self): + """the current boundaries""" + return self._boundaries + + def is_valid_boundaries(self, boundaries): + """checks if the boundaries are in ascending order""" + if boundaries is not None: + min_ = boundaries[0] + for value in boundaries: + if value < min_: + return False + else: + min_ = value + return True + return False diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/execution_context.py b/.venv/lib/python3.11/site-packages/opencensus/stats/execution_context.py new file mode 100644 index 0000000000000000000000000000000000000000..3dea5db4388d3e80bac0370cbe28f66fb9560278 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/execution_context.py @@ -0,0 +1,32 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opencensus.common.runtime_context import RuntimeContext + +_measure_to_view_map_slot = RuntimeContext.register_slot( + 'measure_to_view_map', + lambda: {}) + + +def get_measure_to_view_map(): + return RuntimeContext.measure_to_view_map + + +def set_measure_to_view_map(measure_to_view_map): + RuntimeContext.measure_to_view_map = measure_to_view_map + + +def clear(): + """Clear the context, used in test.""" + _measure_to_view_map_slot.clear() diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/measure.py b/.venv/lib/python3.11/site-packages/opencensus/stats/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..eade0bb104b36ce8a7d1febb4150a0dc3252c92f --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/measure.py @@ -0,0 +1,60 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +class BaseMeasure(object): + """ A measure is the type of metric that is being recorded with + a name, description, and unit + + :type name: str + :param name: string representing the name of the measure + + :type description: str + :param description: a string representing the description of the measure + + :type unit: str + :param unit: the units in which the measure values are measured + + """ + def __init__(self, name, description, unit=None): + self._name = name + self._description = description + self._unit = unit + + @property + def name(self): + """The name of the current measure""" + return self._name + + @property + def description(self): + """The description of the current measure""" + return self._description + + @property + def unit(self): + """The unit of the current measure""" + return self._unit + + +class MeasureInt(BaseMeasure): + """Creates an Integer Measure""" + def __init__(self, name, description, unit=None): + super(MeasureInt, self).__init__(name, description, unit) + + +class MeasureFloat(BaseMeasure): + """Creates a Float Measure""" + def __init__(self, name, description, unit=None): + super(MeasureFloat, self).__init__(name, description, unit) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/measure_to_view_map.py b/.venv/lib/python3.11/site-packages/opencensus/stats/measure_to_view_map.py new file mode 100644 index 0000000000000000000000000000000000000000..c0285e529b0eaf1f226649b087b4235e075c846d --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/measure_to_view_map.py @@ -0,0 +1,163 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy +import logging +from collections import defaultdict + +from opencensus.stats import metric_utils +from opencensus.stats import view_data as view_data_module + +logger = logging.getLogger(__name__) + + +class MeasureToViewMap(object): + """Measure To View Map stores a map from names of Measures to + specific View Datas + + """ + + def __init__(self): + # stores the one-to-many mapping from Measures to View Datas + self._measure_to_view_data_list_map = defaultdict(list) + # stores a map from the registered View names to the Views + self._registered_views = {} + # stores a map from the registered Measure names to the Measures + self._registered_measures = {} + # stores the set of the exported views + self._exported_views = set() + # Stores the registered exporters + self._exporters = [] + + @property + def exported_views(self): + """the current exported views""" + return self._exported_views + + @property + def exporters(self): + """registered exporters""" + return self._exporters + + def get_view(self, view_name, timestamp): + """get the View Data from the given View name""" + view = self._registered_views.get(view_name) + if view is None: + return None + + view_data_list = self._measure_to_view_data_list_map.get( + view.measure.name) + + if not view_data_list: + return None + + for view_data in view_data_list: + if view_data.view.name == view_name: + break + else: + return None + + return self.copy_and_finalize_view_data(view_data) + + def filter_exported_views(self, all_views): + """returns the subset of the given view that should be exported""" + views = set(all_views) + return views + + # TODO: deprecate + def register_view(self, view, timestamp): + """registers the view's measure name to View Datas given a view""" + if len(self.exporters) > 0: + try: + for e in self.exporters: + e.on_register_view(view) + except AttributeError: + pass + + self._exported_views = None + existing_view = self._registered_views.get(view.name) + if existing_view is not None: + if existing_view == view: + # ignore the views that are already registered + return + else: + logger.warning( + "A different view with the same name is already registered" + ) # pragma: NO COVER + measure = view.measure + registered_measure = self._registered_measures.get(measure.name) + if registered_measure is not None and registered_measure != measure: + logger.warning( + "A different measure with the same name is already registered") + self._registered_views[view.name] = view + if registered_measure is None: + self._registered_measures[measure.name] = measure + self._measure_to_view_data_list_map[view.measure.name].append( + view_data_module.ViewData(view=view, start_time=timestamp, + end_time=timestamp)) + + def record(self, tags, measurement_map, timestamp, attachments=None): + """records stats with a set of tags""" + assert all(vv >= 0 for vv in measurement_map.values()) + for measure, value in measurement_map.items(): + if measure != self._registered_measures.get(measure.name): + return + view_datas = [] + for measure_name, view_data_list \ + in self._measure_to_view_data_list_map.items(): + if measure_name == measure.name: + view_datas.extend(view_data_list) + for view_data in view_datas: + view_data.record( + context=tags, value=value, timestamp=timestamp, + attachments=attachments) + self.export(view_datas) + + # TODO: deprecate + def export(self, view_datas): + """export view datas to registered exporters""" + view_datas_copy = \ + [self.copy_and_finalize_view_data(vd) for vd in view_datas] + if len(self.exporters) > 0: + for e in self.exporters: + try: + e.export(view_datas_copy) + except AttributeError: + pass + + def get_metrics(self, timestamp): + """Get a Metric for each registered view. + + Convert each registered view's associated `ViewData` into a `Metric` to + be exported. + + :type timestamp: :class: `datetime.datetime` + :param timestamp: The timestamp to use for metric conversions, usually + the current time. + + :rtype: Iterator[:class: `opencensus.metrics.export.metric.Metric`] + """ + for vdl in self._measure_to_view_data_list_map.values(): + for vd in vdl: + metric = metric_utils.view_data_to_metric(vd, timestamp) + if metric is not None: + yield metric + + # TODO(issue #470): remove this method once we export immutable stats. + def copy_and_finalize_view_data(self, view_data): + view_data_copy = copy.copy(view_data) + tvdam_copy = copy.deepcopy(view_data.tag_value_aggregation_data_map) + view_data_copy._tag_value_aggregation_data_map = tvdam_copy + view_data_copy.end() + return view_data_copy diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/measurement.py b/.venv/lib/python3.11/site-packages/opencensus/stats/measurement.py new file mode 100644 index 0000000000000000000000000000000000000000..f71468717fc5e61acbe354ad1694025b5b1bf250 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/measurement.py @@ -0,0 +1,50 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +class Measurement(object): + """ A measurement is an object with a measure and a value attached to it + + :type measure: :class: '~opencensus.stats.measure.Measure' + :param measure: A measure to pass into the measurement + + :type value: int or float + :param value: value of the measurement + + """ + def __init__(self, measure, value): + self._measure = measure + self._value = value + + @property + def value(self): + """The value of the current measurement""" + return self._value + + @property + def measure(self): + """The measure of the current measurement""" + return self._measure + + +class MeasurementInt(Measurement): + """ Creates a new Integer Measurement """ + def __init__(self, measure, value): + super(MeasurementInt, self).__init__(measure, value) + + +class MeasurementFloat(Measurement): + """ Creates a new Float Measurement """ + def __init__(self, measure, value): + super(MeasurementFloat, self).__init__(measure, value) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/measurement_map.py b/.venv/lib/python3.11/site-packages/opencensus/stats/measurement_map.py new file mode 100644 index 0000000000000000000000000000000000000000..efc50d9890cffd82a59b2005c89a10bc30a3a990 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/measurement_map.py @@ -0,0 +1,118 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging + +from opencensus.common import utils +from opencensus.tags import TagContext + +logger = logging.getLogger(__name__) + + +class MeasurementMap(object): + """Measurement Map is a map from Measures to measured values + to be recorded at the same time + + :type measure_to_view_map: :class: '~opencensus.stats.measure_to_view_map. + MeasureToViewMap' + :param measure_to_view_map: the measure to view map that will store the + recorded stats with tags + + :type: attachments: dict + :param attachments: the contextual information about the attachment value. + + """ + def __init__(self, measure_to_view_map, attachments=None): + self._measurement_map = {} + self._measure_to_view_map = measure_to_view_map + self._attachments = attachments + # If the user tries to record a negative value for any measurement, + # refuse to record all measurements from this map. Recording negative + # measurements will become an error in a later release. + self._invalid = False + + @property + def measurement_map(self): + """the current measurement map""" + return self._measurement_map + + @property + def measure_to_view_map(self): + """the current measure to view map for the measurement map""" + return self._measure_to_view_map + + @property + def attachments(self): + """the current contextual information about the attachment value.""" + return self._attachments + + def measure_int_put(self, measure, value): + """associates the measure of type Int with the given value""" + if value < 0: + # Should be an error in a later release. + logger.warning("Cannot record negative values") + self._measurement_map[measure] = value + + def measure_float_put(self, measure, value): + """associates the measure of type Float with the given value""" + if value < 0: + # Should be an error in a later release. + logger.warning("Cannot record negative values") + self._measurement_map[measure] = value + + def measure_put_attachment(self, key, value): + """Associate the contextual information of an Exemplar to this MeasureMap + Contextual information is represented as key - value string pairs. + If this method is called multiple times with the same key, + only the last value will be kept. + """ + if self._attachments is None: + self._attachments = dict() + + if key is None or not isinstance(key, str): + raise TypeError('attachment key should not be ' + 'empty and should be a string') + if value is None or not isinstance(value, str): + raise TypeError('attachment value should not be ' + 'empty and should be a string') + + self._attachments[key] = value + + def record(self, tags=None): + """records all the measures at the same time with a tag_map. + tag_map could either be explicitly passed to the method, or implicitly + read from current runtime context. + """ + if tags is None: + tags = TagContext.get() + if self._invalid: + logger.warning("Measurement map has included negative value " + "measurements, refusing to record") + return + for measure, value in self.measurement_map.items(): + if value < 0: + self._invalid = True + logger.warning("Dropping values, value to record must be " + "non-negative") + logger.info("Measure '{}' has negative value ({}), refusing " + "to record measurements from {}" + .format(measure.name, value, self)) + return + + self.measure_to_view_map.record( + tags=tags, + measurement_map=self.measurement_map, + timestamp=utils.to_iso_str(), + attachments=self.attachments + ) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/metric_utils.py b/.venv/lib/python3.11/site-packages/opencensus/stats/metric_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..067772031a1112e5e1410fdf4ef09809ae773168 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/metric_utils.py @@ -0,0 +1,79 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Utilities to convert stats data models to metrics data models. +""" + +from opencensus.metrics import label_value +from opencensus.metrics.export import metric, metric_descriptor, time_series + + +def is_gauge(md_type): + """Whether a given MetricDescriptorType value is a gauge. + + :type md_type: int + :param md_type: A MetricDescriptorType enum value. + """ + if md_type not in metric_descriptor.MetricDescriptorType: + raise ValueError # pragma: NO COVER + + return md_type in { + metric_descriptor.MetricDescriptorType.GAUGE_INT64, + metric_descriptor.MetricDescriptorType.GAUGE_DOUBLE, + metric_descriptor.MetricDescriptorType.GAUGE_DISTRIBUTION + } + + +def get_label_values(tag_values): + """Convert an iterable of TagValues into a list of LabelValues. + + :type tag_values: list(:class: `opencensus.tags.tag_value.TagValue`) + :param tag_values: An iterable of TagValues to convert. + + :rtype: list(:class: `opencensus.metrics.label_value.LabelValue`) + :return: A list of LabelValues, converted from TagValues. + """ + return [label_value.LabelValue(tv) for tv in tag_values] + + +def view_data_to_metric(view_data, timestamp): + """Convert a ViewData to a Metric at time `timestamp`. + + :type view_data: :class: `opencensus.stats.view_data.ViewData` + :param view_data: The ViewData to convert. + + :type timestamp: :class: `datetime.datetime` + :param timestamp: The time to set on the metric's point's aggregation, + usually the current time. + + :rtype: :class: `opencensus.metrics.export.metric.Metric` + :return: A converted Metric. + """ + if not view_data.tag_value_aggregation_data_map: + return None + + md = view_data.view.get_metric_descriptor() + + # TODO: implement gauges + if is_gauge(md.type): + ts_start = None # pragma: NO COVER + else: + ts_start = view_data.start_time + + ts_list = [] + for tag_vals, agg_data in view_data.tag_value_aggregation_data_map.items(): + label_values = get_label_values(tag_vals) + point = agg_data.to_point(timestamp) + ts_list.append(time_series.TimeSeries(label_values, [point], ts_start)) + return metric.Metric(md, ts_list) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/stats.py b/.venv/lib/python3.11/site-packages/opencensus/stats/stats.py new file mode 100644 index 0000000000000000000000000000000000000000..353efd7eb852c9d9e2f7397c725909057d728c53 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/stats.py @@ -0,0 +1,43 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from datetime import datetime + +from opencensus.metrics.export.metric_producer import MetricProducer +from opencensus.stats.stats_recorder import StatsRecorder +from opencensus.stats.view_manager import ViewManager + + +class _Stats(MetricProducer): + """Stats defines a View Manager and a Stats Recorder in order for the + collection of Stats + """ + + def __init__(self): + self.stats_recorder = StatsRecorder() + self.view_manager = ViewManager() + + def get_metrics(self): + """Get a Metric for each of the view manager's registered views. + + Convert each registered view's associated `ViewData` into a `Metric` to + be exported, using the current time for metric conversions. + + :rtype: Iterator[:class: `opencensus.metrics.export.metric.Metric`] + """ + return self.view_manager.measure_to_view_map.get_metrics( + datetime.utcnow()) + + +stats = _Stats() diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/stats_recorder.py b/.venv/lib/python3.11/site-packages/opencensus/stats/stats_recorder.py new file mode 100644 index 0000000000000000000000000000000000000000..555c07084454ca8b8b1f8912819f717a0ec0363e --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/stats_recorder.py @@ -0,0 +1,34 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opencensus.stats import execution_context +from opencensus.stats.measure_to_view_map import MeasureToViewMap +from opencensus.stats.measurement_map import MeasurementMap + + +class StatsRecorder(object): + """Stats Recorder provides methods to record stats against tags + + """ + def __init__(self): + if execution_context.get_measure_to_view_map() == {}: + execution_context.set_measure_to_view_map(MeasureToViewMap()) + + self.measure_to_view_map = execution_context.get_measure_to_view_map() + + def new_measurement_map(self): + """Creates a new MeasurementMap in order to record stats + :returns a MeasurementMap for recording multiple measurements + """ + return MeasurementMap(self.measure_to_view_map) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/view.py b/.venv/lib/python3.11/site-packages/opencensus/stats/view.py new file mode 100644 index 0000000000000000000000000000000000000000..67212b903fc9d150597587ccd7a7baf1b68a7445 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/view.py @@ -0,0 +1,106 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import threading + +from opencensus.metrics import label_key +from opencensus.metrics.export import metric_descriptor + + +class View(object): + """A view defines a specific aggregation and a set of tag keys + + :type name: str + :param name: name of the view + + :type description: str + :param description: description of the view + + :type columns: (:class: '~opencensus.tags.tag_key.TagKey') + :param columns: the columns that the tag keys will aggregate on for this + view + + :type measure: :class: '~opencensus.stats.measure.Measure' + :param measure: the measure to be aggregated by the view + + :type aggregation: :class: '~opencensus.stats.aggregation.BaseAggregation' + :param aggregation: the aggregation the view will support + + """ + + def __init__(self, name, description, columns, measure, aggregation): + self._name = name + self._description = description + self._columns = columns + self._measure = measure + self._aggregation = aggregation + + # Cache the converted MetricDescriptor here to avoid creating it each + # time we convert a ViewData that realizes this View into a Metric. + self._md_cache_lock = threading.Lock() + self._metric_descriptor = None + + @property + def name(self): + """the name of the current view""" + return self._name + + @property + def description(self): + """the description of the current view""" + return self._description + + @property + def columns(self): + """the columns of the current view""" + return self._columns + + @property + def measure(self): + """the measure of the current view""" + return self._measure + + @property + def aggregation(self): + """the aggregation of the current view""" + return self._aggregation + + def new_aggregation_data(self): + """Get a new AggregationData for this view. + + :rtype: :class: `opencensus.status.aggregation_data.AggregationData` + :return: A new AggregationData. + """ + return self._aggregation.new_aggregation_data(self.measure) + + def get_metric_descriptor(self): + """Get a MetricDescriptor for this view. + + Lazily creates a MetricDescriptor for metrics conversion. + + :rtype: :class: + `opencensus.metrics.export.metric_descriptor.MetricDescriptor` + :return: A converted Metric. + """ # noqa + with self._md_cache_lock: + if self._metric_descriptor is None: + self._metric_descriptor = metric_descriptor.MetricDescriptor( + self.name, + self.description, + self.measure.unit, + self.aggregation.get_metric_type(self.measure), + # TODO: add label key description + [label_key.LabelKey(tk, "") for tk in self.columns]) + return self._metric_descriptor diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/view_data.py b/.venv/lib/python3.11/site-packages/opencensus/stats/view_data.py new file mode 100644 index 0000000000000000000000000000000000000000..aca0ccca6e6540b18775bc905530f3791e715421 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/view_data.py @@ -0,0 +1,96 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opencensus.common import utils + + +class ViewData(object): + """View Data is the aggregated data for a particular view + + :type view: + :param view: The view associated with this view data + + :type start_time: datetime + :param start_time: the start time for this view data + + :type end_time: datetime + :param end_time: the end time for this view data + + """ + def __init__(self, + view, + start_time, + end_time): + self._view = view + self._start_time = start_time + self._end_time = end_time + self._tag_value_aggregation_data_map = {} + + @property + def view(self): + """the current view in the view data""" + return self._view + + # TODO: `start_time` and `end_time` are sometimes a `datetime` object but + # should always be a `string`. + @property + def start_time(self): + """the current start time in the view data""" + return self._start_time + + @property + def end_time(self): + """the current end time in the view data""" + return self._end_time + + @property + def tag_value_aggregation_data_map(self): + """the current tag value aggregation map in the view data""" + return self._tag_value_aggregation_data_map + + def start(self): + """sets the start time for the view data""" + self._start_time = utils.to_iso_str() + + def end(self): + """sets the end time for the view data""" + self._end_time = utils.to_iso_str() + + def get_tag_values(self, tags, columns): + """function to get the tag values from tags and columns""" + tag_values = [] + i = 0 + while i < len(columns): + tag_key = columns[i] + if tag_key in tags: + tag_values.append(tags.get(tag_key)) + else: + tag_values.append(None) + i += 1 + return tag_values + + def record(self, context, value, timestamp, attachments=None): + """records the view data against context""" + if context is None: + tags = dict() + else: + tags = context.map + tag_values = self.get_tag_values(tags=tags, + columns=self.view.columns) + tuple_vals = tuple(tag_values) + if tuple_vals not in self.tag_value_aggregation_data_map: + self.tag_value_aggregation_data_map[tuple_vals] = \ + self.view.new_aggregation_data() + self.tag_value_aggregation_data_map.get(tuple_vals).\ + add_sample(value, timestamp, attachments) diff --git a/.venv/lib/python3.11/site-packages/opencensus/stats/view_manager.py b/.venv/lib/python3.11/site-packages/opencensus/stats/view_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..3ba52685943695afbca36b2a4a0f14c3c3c3aa50 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/opencensus/stats/view_manager.py @@ -0,0 +1,55 @@ +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opencensus.common import utils +from opencensus.stats import execution_context +from opencensus.stats.measure_to_view_map import MeasureToViewMap + + +class ViewManager(object): + """View Manager allows the registering of Views for collecting stats + and receiving stats data as View Data""" + def __init__(self): + self.time = utils.to_iso_str() + if execution_context.get_measure_to_view_map() == {}: + execution_context.set_measure_to_view_map(MeasureToViewMap()) + + self._measure_view_map = execution_context.get_measure_to_view_map() + + @property + def measure_to_view_map(self): + """the current measure to view map for the View Manager""" + return self._measure_view_map + + def register_view(self, view): + """registers the given view""" + self.measure_to_view_map.register_view(view=view, timestamp=self.time) + + def get_view(self, view_name): + """gets the view given the view name """ + return self.measure_to_view_map.get_view(view_name=view_name, + timestamp=self.time) + + def get_all_exported_views(self): + """returns all of the exported views for the current measure to view + map""" + return self.measure_to_view_map.exported_views + + def register_exporter(self, exporter): + """register the exporter""" + self.measure_to_view_map.exporters.append(exporter) + + def unregister_exporter(self, exporter): + """unregister the exporter""" + self.measure_to_view_map.exporters.remove(exporter) diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/__init__.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edec79078de47e7c7f5b1e505204cf3e51ed53b2 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/__init__.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/pem.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/pem.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e78d213b31b1b6b1a913abf8f4d4d475fac37f6c Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/pem.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc1901.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc1901.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cfa5c43c87d43f7096e6273914e3397d739f981a Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc1901.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc2876.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc2876.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8191b507ef4ef472f4932441a2b7207e7e3354b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc2876.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc2985.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc2985.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06a5d8d38256b5a99436360f12fbf58491891181 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc2985.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3058.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3058.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..509e8d9a99ed64e47040d49a5a768f3ab0068707 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3058.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3274.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3274.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a8343053332b7158e817270c21002581f36d913 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3274.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3280.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3280.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b43968a8ca915674f13dcbc3c78405d3108ba17 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3280.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3560.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3560.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..231e595f9ee373c1032fe599b6af385282d6e941 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3560.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3565.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3565.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0be15b9aebc17367cf1375898813aa5df0a7d0e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3565.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3709.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3709.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3d843af33c441e9f21c4f53d7de40ef761a42d1 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3709.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3739.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3739.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5921b2f69350bf3c19d28378e815e68143e3644 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3739.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3852.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3852.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..197dc415ff1148e2536de78e2de8ddc9065f0a3e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc3852.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4010.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4010.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd77840008a33755d3b2b9ee67a8162dd58d8ee1 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4010.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4108.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4108.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..113c1e34331d8f5aafca564a472961c92598f03d Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4108.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4211.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4211.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9ed9db9beb2d511cc2163a79fe40c4336f02781 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4211.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4387.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4387.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9eab8fbaa9b7982da97c2db0e3941bf681643805 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4387.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4476.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4476.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..145d3037f704dd6244e6258d07c424119d13915e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4476.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4985.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4985.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e3081306edaa1c9d93d5b1f83bbc05f3c4e8b7f Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc4985.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5480.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5480.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd215bb13f5359bac4955bba4dbc115a07fe0caf Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5480.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5697.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5697.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64239b8105793860d7cf85c9d9b9f702dd5edd3c Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5697.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5755.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5755.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..978e6330afcff36365b5496d37033f792f666fee Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5755.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5914.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5914.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..352ff038c0eb031b2fb71c9d17d33be679648702 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc5914.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6010.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6010.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c490b5d42536fe27a02ef66693cd3c4e39522ad Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6010.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6019.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6019.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..24296afa74bd6c46e52d11ea6d3ce3a5f713794c Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6019.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6032.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6032.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f34e5a9672d645e9f20c5c28a5dd6da7c9adf2d1 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6032.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6120.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6120.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db6786940154a1664375e33912e89c10e1add112 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6120.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6402.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6402.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..186da6e628df1fe6e7927acdce51ac05f62f165b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6402.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6487.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6487.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b26fd53bbccb7dbd76bc1b5cdf5de52bc85a856b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6487.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6664.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6664.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69b2ede12ef1f38b21dfbbde266190bbbf6eda40 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6664.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6955.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6955.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68e3a535e11b8f5058717a32f4ed54586c2277a3 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6955.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6960.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6960.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb33a373b7d20f1cf6b947174c091f961526608e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc6960.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc7292.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc7292.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40e38f7650e002994fd7910adc3257db9ded6bbf Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc7292.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc7894.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc7894.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f3c0510766cf8a007fe7f03cff1c2cbf93b5546 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc7894.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8018.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8018.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73f22ab912c013ccde60721d47bf73562fedd7f4 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8018.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8418.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8418.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d2bc8c39f6b6c398e616a7ab37aca10ef14ebc7 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8418.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8479.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8479.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea27380d18aac6ae9c3de5cf50aa52be48ebd4db Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8479.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8520.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8520.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c424189c1f02215d5d6115a87548142b3976de1c Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8520.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8619.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8619.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..841cf3021b50cb86d7551bc919b2676683fef22e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8619.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8708.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8708.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a2e2fac3297e41609e8e4055e34b707cc19c80c Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8708.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8769.cpython-311.pyc b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8769.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc2122fe8c68794e61d0ea9bdb88ff5480b4a290 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/pyasn1_modules/__pycache__/rfc8769.cpython-311.pyc differ