def measure(obj, depth=0):
    """
    Returns the number of nodes, properties and the depth of an inspect tree.
    `obj` is a dict read from JSON that represents inspect data
    """
    nodes = 0
    properties = 0
    max_depth = depth
    for (_, child) in obj.items():
        # ensure this is a node that is not a histogram
        if type(child) is dict and 'buckets' not in child:
            (child_nodes, child_properties, child_depth) = measure(
                child, depth=depth + 1)
            nodes += child_nodes + 1
            properties += child_properties
            max_depth = max(max_depth, child_depth)
            continue
        properties += 1
    return nodes, properties, max_depth