Skip to main content

backend reporting via a worker/queue system

Project description

event-reporter
===========================

A Python wrapper for backend reporting via a worker/queue system.


[![travis](https://travis-ci.com/e271828-/event-reporter.svg?branch=master)](https://travis-ci.com/e271828-/event-reporter)

[![Codecov](http://codecov.io/github/e271828-/event-reporter/coverage.svg?branch=master)](http://codecov.io/github/e271828-/event-reporter?branch=master)


System flow:

Store event quickly on webserver [e.g. within a flask endpoint]:
```
from event_reporter import EventReporter
from redis import StrictRedis

er = EventReporter(conn=StrictRedis())

er.store('ga', 'event', '<uuid4 clientid>', category='event_category', action='action_name', aip='1', uip='1.2.3.4', ds='web')
```

Fetch event within worker and dispatch to final destination:
```
from event_reporter import EventReporter
from redis import StrictRedis

er = EventReporter(conn=StrictRedis())

r = er.fetch()

er.dispatch(r)
```

## Env vars used
`EVENTREPORTER_QUEUE_NAME` (redis key)
`UA_ID` (GA UA ID)
`EVENTREPORTER_TTL` (int: controls whether to set expire time for redis keys)

## Testing
```
export UA_ID='My_UA_ID'

nosetests -s
```

.. and check your GA property to see the data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

event-reporter-1.0.7.macosx-10.14-intel.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file event-reporter-1.0.7.macosx-10.14-intel.tar.gz.

File metadata

  • Download URL: event-reporter-1.0.7.macosx-10.14-intel.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for event-reporter-1.0.7.macosx-10.14-intel.tar.gz
Algorithm Hash digest
SHA256 aa9547ccf7503cb61c03ce2ff4d9ba5c2d65e0b1015f45e0ffeb2f9e22d0cdcf
MD5 caefc189484283db70cb5d77f1693c4d
BLAKE2b-256 83dd99c2925c52b4edcf78625f8a2a8703b599cd3f14bbf60b5de1a8ff52a834

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page