def METHOD_NAME(infobase_config, openlibrary_config, coverstore_config, ndays=1):
    logging.basicConfig(
        level=logging.DEBUG,
        format="%(levelname)-8s : %(filename)-12s:%(lineno)4d : %(message)s",
    )
    logger.info("Parsing config file")
    try:
        infobase_db = connect_to_pg(infobase_config)
        coverstore_db = connect_to_pg(coverstore_config)
        logroot = get_config_info(infobase_config)
    except KeyError as k:
        logger.critical("Config file section '%s' missing", k.args[0])
        return -1
    setup_ol_config(openlibrary_config)
    # Gather delta and total counts
    # Total counts are simply computed and updated for the current day
    # Delta counts are computed by subtracting the current total from yesterday's total
    today = datetime.datetime.now()
    yesterday = today - datetime.timedelta(days=1)
    data = {}
    logger.info("Gathering total data")
    data.update(
        run_gathering_functions(
            infobase_db,
            coverstore_db,
            yesterday,
            today,
            logroot,
            prefix="admin_total__",
            key_prefix="total",
        )
    )
    logger.info("Gathering data using difference between totals")
    data.update(
        run_gathering_functions(
            infobase_db,
            coverstore_db,
            yesterday,
            today,
            logroot,
            prefix="admin_delta__",
        )
    )
    store_data(data, today.strftime("%Y-%m-%d"))
    # Now gather data which can be queried based on date ranges
    # The queries will be from the beginning of today till right now
    # The data will be stored as the counts of the current day.
    end = datetime.datetime.now()  # - datetime.timedelta(days = 10)# Right now
    start = datetime.datetime(
        hour=0, minute=0, second=0, day=end.day, month=end.month, year=end.year
    )  # Beginning of the day
    logger.info("Gathering range data")
    data = {}
    for i in range(int(ndays)):
        logger.info(" %s to %s", start, end)
        data.update(
            run_gathering_functions(
                infobase_db, coverstore_db, start, end, logroot, prefix="admin_range__"
            )
        )
        store_data(data, start.strftime("%Y-%m-%d"))
        end = start
        start = end - datetime.timedelta(days=1)
    return 0