Exemplo n.º 1
0
def check_multihistogram_fields(fields):
    """
    Returns multihistogram type if all the given fields are of the same histogram type.
    Return false otherwise, or if any of the fields are not a compatible histogram type.
    Possible histogram types: measurements, span_op_breakdowns

    :param [str] fields: The list of fields for which you want to generate histograms for.
    """
    histogram_type = False
    for field in fields:
        if histogram_type is False:
            if is_measurement(field):
                histogram_type = "measurements"
            elif is_span_op_breakdown(field):
                histogram_type = "span_op_breakdowns"
            else:
                return False
        elif histogram_type == "measurements" and not is_measurement(field):
            return False
        elif histogram_type == "span_op_breakdowns" and not is_span_op_breakdown(field):
            return False
    return histogram_type
Exemplo n.º 2
0
 def is_duration_key(self, key):
     return (key in self.duration_keys or is_duration_measurement(key)
             or is_span_op_breakdown(key))
Exemplo n.º 3
0
 def is_span_op_breakdown(self):
     return is_span_op_breakdown(self.name) and self.name not in SEARCH_MAP
Exemplo n.º 4
0
def is_fuzzy_numeric_key(key):
    return key in FUZZY_NUMERIC_KEYS or snuba.is_measurement(key) or snuba.is_span_op_breakdown(key)
Exemplo n.º 5
0
 def is_numeric_key(self, key):
     return key in self.config.numeric_keys or is_measurement(key) or is_span_op_breakdown(key)