@@ -93,7 +93,7 @@ class ProbeUnit(object):
9393 ENUM = 6
9494 """0..n, ordinal of an enum."""
9595
96- # New enum values should be should be converted to a tag to ensure backward
96+ # New enum values should be converted to a tag to ensure backward
9797 # compatibility during compressing the metrics. see ProbeUnit#newUnit
9898 # handling in Java for that. We don't implement this functionality yet in
9999 # the Python client, as we don't use such enum members.
@@ -112,29 +112,29 @@ class ValueType(object):
112112class MetricsCompressor (object ):
113113 """Compresses metrics into a ``bytearray`` blob.
114114
115- The compressor uses dictionary based delta compression and deflates
116- the resulting ``bytearray`` by using ``zlib.compress()``. This
117- compressor doesn't use the textual representation of the
118- :class:`MetricDescriptor` hence it is agnostic to the order of the
119- tags in that representation.
120-
121- Adding metrics by calling :func:`add_long` or :func:`add_double`
122- builds a dictionary by mapping all words found in the passed
123- :class:`MetricDescriptor`s to ``int``s and these ``int``s will be
124- written to the resulting ``bytearray`` blob. Before these ``int``s
125- are written, the current :class:`MetricDescriptor` is compared to the
126- previous one and only the fields of the descriptor that are different
127- from the previous will be written to the metrics blob.
128-
129- When the blob is retrieved from this compressor (when the metrics
130- collection cycle finishes) the dictionary is stored in the dictionary
131- blob. The compressor iterates over the words stored in the dictionary
132- in ascending order and writes them to the blob by skipping the first
133- N characters that are equal to the first N character of the previously
134- written word, hence using delta compression here too.
135-
136- After both the metrics and the dictionary blob is constructed, they
137- are copied into a final blob in the following structure:
115+ The compressor uses dictionary based delta compression and deflates
116+ the resulting ``bytearray`` by using ``zlib.compress()``. This
117+ compressor doesn't use the textual representation of the
118+ :class:`MetricDescriptor` hence it is agnostic to the order of the
119+ tags in that representation.
120+
121+ Adding metrics by calling :func:`add_long` or :func:`add_double`
122+ builds a dictionary by mapping all words found in the passed
123+ :class:`MetricDescriptor`s to ``int``s and these ``int``s will be
124+ written to the resulting ``bytearray`` blob. Before these ``int``s
125+ are written, the current :class:`MetricDescriptor` is compared to the
126+ previous one and only the fields of the descriptor that are different
127+ from the previous will be written to the metrics blob.
128+
129+ When the blob is retrieved from this compressor (when the metrics
130+ collection cycle finishes) the dictionary is stored in the dictionary
131+ blob. The compressor iterates over the words stored in the dictionary
132+ in ascending order and writes them to the blob by skipping the first
133+ N characters that are equal to the first N character of the previously
134+ written word, hence using delta compression here too.
135+
136+ After both the metrics and the dictionary blob is constructed, they
137+ are copied into a final blob in the following structure:
138138
139139 +--------------------------------+--------------------+
140140 | Compressor version | 2 bytes (short) |
@@ -245,7 +245,7 @@ def _calculate_descriptor_mask(self, descriptor):
245245 if descriptor .unit == last_descriptor .unit :
246246 mask |= _MASK_UNIT
247247
248- # include excludedTargets and tags bytes for compatibility purposes
248+ # include excludedTargets and tags bits for compatibility purposes
249249 mask |= _MASK_EXCLUDED_TARGETS
250250 mask |= _MASK_TAG_COUNT
251251
0 commit comments