def run_queue_analysis(trace, threshold):
    """
    Plot the queuing delay distribution and
    severely delayed tasks.

    :param trace: input Trace object
    :type trace: :mod:`libs.utils.Trace`

    :param threshold: plot transactions taken longer than threshold
    :type threshold: int
    """
    df = trace.data_frame.queue_df()
    trace.analysis.binder_transaction.plot_samples(df, "delta_t",
                                                   "transaction samples",
                                                   "wait time (microseconds)")
    trace.analysis.binder_transaction.plot_tasks(df, threshold, "__comm_x",
                                                 "delta_t", "tasks",
                                                 "wait time (microseconds)")
    return df