def aggregate_log_dict(agg_dict, new_dict) -> dict:
    """
    Aggregate the statistics of a log dict
    :param agg_dict: aggregation dictionary
    :param new_dict: dict with new stats
    :return: new aggregation dict with aggregated
    """
    for k in new_dict:
        # init new if not present
        if k not in agg_dict:
            agg_dict[k] = {
                'n': 0,
                'sum': 0.0,
                'max': new_dict[k],
                'min': new_dict[k],
            }
        # aggregate
        agg_dict[k]['n'] += 1
        agg_dict[k]['sum'] += new_dict[k]
        agg_dict[k]['max'] = max(new_dict[k], agg_dict[k]['max'])
        agg_dict[k]['min'] = min(new_dict[k], agg_dict[k]['min'])

    return agg_dict