from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

from performanceplatform.collector.ga.core \
    import create_client, query_documents_for, send_data

from performanceplatform.client import DataSet


def main(credentials, data_set_config, query, options, start_at, end_at):
    client = create_client(credentials)

    documents = query_documents_for(
        client, query, options,
        data_set_config['data-type'],
        start_at, end_at)

    data_set = DataSet.from_config(data_set_config)
    chunk_size = options.get('chunk-size', 0)

    send_data(data_set, documents, chunk_size)

from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

from performanceplatform.collector.ga.core \
    import create_client, query_documents_for, send_data

from performanceplatform.client import DataSet


def main(credentials, data_set_config, query, options, start_at, end_at):
    client = create_client(credentials)

    documents = query_documents_for(
        client, query, options,
        data_set_config['data-type'],
        start_at, end_at)

    data_set = DataSet.from_config(data_set_config)
    chunk_size = options.get('chunk-size', 100)

    send_data(data_set, documents, chunk_size)

Set default chunk size for GA collector to 100
Set default chunk size for GA collector to 100

We would like requests chunked up when talking to backdrop as not doing
so has been shown to bring it down. This sets the default to 100 records
so that we don't have to remember to set it explicitly in every config.
