snowplow / snowplow-python-tracker

Snowplow event tracker for Python. Add analytics to your Python and Django apps, webapps and games
Apache License 2.0
43 stars 67 forks source link

Test compression strategies #353

Open Jack-Keene opened 11 months ago

Jack-Keene commented 11 months ago

This PR adds a compression option to the Emitter.

Pass in a compression function to the compression parameter when initialising the emitter, eg:


def gzip_compression(data): 
    return gzip.compress(bytes(data, "UTF-8"))   

e = Emitter("localhost", compression=gzip_compression)
coveralls commented 11 months ago

Coverage Status

coverage: 95.85% (-0.1%) from 95.946% when pulling 4220b0aaaf9fb6bd3b661cf6f85051b38d1e896d on test-compression-strategies into b29a57d91ebe88c4fa104f905c12040d3d7296c6 on master.