def get_sensor_network_flows(querier, query_window):
    """
    Performs Prometheus queries relevant to sensor network flows

    :param querier: An object containing information
    needed to query the Prometheus API
    :param query_window: The window over which rates are computed by Prometheus

    :return: Json containing information about sensor network flows
    """
    res = {}
    for flow_type in ["incoming", "outgoing"]:
        for protocol in ["L4_PROTOCOL_TCP", "L4_PROTOCOL_UDP"]:
            metric = 'rox_sensor_network_flow_total_per_node'
            query = f'({metric}{{Protocol="{protocol}",Type="{flow_type}"}})'
            query_name = f'{flow_type}_{protocol}'

            res[query_name] = querier.get_stats_for_query(query)
            res[query_name]['description'] = f'Number of {flow_type} {protocol} network flows over pods'

    metrics = [
                "rox_sensor_network_flow_host_connections_added",
                "rox_sensor_network_flow_host_connections_removed",
                "rox_sensor_network_flow_external_flows"
            ]

    for metric in metrics:
        query = metric
        rate_query = f'rate({metric}[{query_window}])'

        query_name = metric
        rate_query_name = f'{metric}_rate'

        res[query_name] = {'value': querier.query_and_get_value(query)}
        res[rate_query_name] = {'value': querier.query_and_get_value(rate_query)}
        res[rate_query_name]['description'] = f'Average {metric}'
        res[rate_query_name]['units'] = 'per seconds'

    return res