コード例 #1
0
def generate_json_general_reports(init_date, last_date):
    """
    Calculate the report values and return and print them to a JSON file.
    This will be made the night of the first day of the next month of the report.
    :return: None
    """

    total_devices_of_period = total_devices_registred(init_date, last_date)
    total_devices = total_devices_registred(max_date=last_date)

    total_sims_of_period = total_sims_registered(init_date, last_date)
    total_sims = total_sims_registered(max_date=last_date)

    total_gsm_of_period = total_gsm_events(init_date, last_date)
    total_gsm = total_gsm_events(max_date=last_date)

    total_device_carrier_of_period = total_device_for_carrier(
        init_date, last_date)
    total_device_carrier = total_device_for_carrier(max_date=last_date)

    total_sims_carrier_of_period = total_sims_for_carrier(init_date, last_date)
    total_sims_carrier = total_sims_for_carrier(max_date=last_date)

    total_gsm_carrier_of_period = total_gsm_events_for_carrier(
        init_date, last_date)
    total_gsm_carrier = total_gsm_events_for_carrier(max_date=last_date)

    final_json = {
        "total_devices_of_period":
        total_devices_of_period,
        "total_devices":
        total_devices,
        "total_sims_of_period":
        total_sims_of_period,
        "total_sims":
        total_sims,
        "total_gsm_of_period":
        total_gsm_of_period,
        "total_gsm":
        total_gsm,
        "total_gsm_carrier_of_period":
        serialize_pairs(total_gsm_carrier_of_period),
        "total_gsm_carrier":
        serialize_pairs(total_gsm_carrier),
        "total_sims_carrier_of_period":
        serialize_pairs(total_sims_carrier_of_period),
        "total_sims_carrier":
        serialize_pairs(total_sims_carrier),
        "total_device_carrier_of_period":
        serialize_pairs(total_device_carrier_of_period),
        "total_device_carrier":
        serialize_pairs(total_device_carrier)
    }

    save_json_report_to_file(final_json, init_date.year, init_date.month,
                             "general_report_")  # Total devices registred
コード例 #2
0
def generate_json_app_reports(init_date, last_date):
    """
    Calculate the app report values and return and print them to a JSON file.
    This will be made the night of the first day of the next month of the report.
    :return: None
    """

    report = app_report(init_date, last_date)
    save_json_report_to_file(report, init_date.year, init_date.month,
                             "apps_report_")
コード例 #3
0
def generate_json_app_reports(init_date, last_date):
    """
    Calculate the app report values and return and print them to a JSON file.
    This will be made the night of the first day of the next month of the report.
    :return: None
    """

    report = app_report(init_date, last_date)

    save_json_report_to_file(report, init_date.year, init_date.month,
                             "apps_report_")
コード例 #4
0
def generate_json_signal_reports(init_date, last_date):
    """
    Calculate the signal antenna reports and print them to a JSON file.
    This will be made the night of the first day of the next month of the report.
    :return: None
    """

    report = signal_strength_mean_for_antenna(init_date, last_date)

    save_json_report_to_file(report, init_date.year, init_date.month,
                             "signal_report_")
def generate_json_network_reports(init_date, last_date):
    """
    Calculate the network report values and return and print them to a JSON file.
    This will be made the night of the first day of the next month of the report.
    :return: None
    """

    report = network_report_for_carrier(init_date, last_date)

    save_json_report_to_file(report, init_date.year, init_date.month,
                             "network_report_")
コード例 #6
0
def generate_json_general_reports(init_date, last_date):
    """
    Calculate the report values and return and print them to a JSON file.
    This will be made the night of the first day of the next month of the report.
    :return: None
    """

    total_devices = total_devices_registred(init_date, last_date)
    total_sims = total_sims_registered(init_date, last_date)
    total_gsm = total_gsm_events(init_date, last_date)
    total_device_carrier = total_device_for_carrier(init_date, last_date)
    total_sims_carrier = total_sims_for_carrier(init_date, last_date)
    total_gsm_carrier = total_gsm_events_for_carrier(init_date, last_date)

    final_json = {"total_sims": total_sims,
                  "total_devices": total_devices, "total_gsm": total_gsm,
                  "total_gsm_carrier": serialize_pairs(total_gsm_carrier),
                  "total_sims_carrier": serialize_pairs(total_sims_carrier),
                  "total_device_carrier": serialize_pairs(total_device_carrier)}

    save_json_report_to_file(final_json, init_date.year, init_date.month,
                             "general_report_")  # Total devices registred