Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate stats collection and presentation logic #1

Open
lukasgraf opened this issue Aug 22, 2017 · 0 comments
Open

Separate stats collection and presentation logic #1

lukasgraf opened this issue Aug 22, 2017 · 0 comments
Assignees

Comments

@lukasgraf
Copy link
Contributor

The logic for collecting stats and preparing them for presentation should be separated more cleanly, so we can introduce a bin/dump-content-stats command at a later point that dumps lines of JSON stats to a logfile like var/log/content-stats.log.

Currently all the logic lives in browser/content_stats.py

Ideally this would be split up into:

  • A utility (not necessarily a zope.component utilty, just an encapsulated class) that knows how to collect stats, returning a Python data structure (nested dicts)
  • A browser view that post-processes the output from that utility and renders it as JSON to be used on the frontend
  • Templates that use C3 JS in such a way that it just loads the data from that JSON endpoint using data-url instead of injecting the stats data into data- attributes using server-side templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants