-
Notifications
You must be signed in to change notification settings - Fork 24
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
processors: calculate visitor_id and session_id #53
Conversation
invenio_stats/processors.py
Outdated
user_id = doc.pop('user_id', '') | ||
session_id = doc.pop('session_id', '') | ||
user_agent = doc.pop('user_agent', '') | ||
timestamp = arrow.get(doc.get('timestamp')).replace(minute=0, second=0)\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shorter version with strftime
invenio_stats/processors.py
Outdated
session_id = doc.pop('session_id', '') | ||
user_agent = doc.pop('user_agent', '') | ||
timestamp = arrow.get(doc.get('timestamp')).replace(minute=0, second=0)\ | ||
.isoformat() | ||
|
||
m = hashlib.sha224() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistent naming with visitor_id
(also for unique_session_id
)
ef96f6e
to
79b44d5
Compare
invenio_stats/processors.py
Outdated
user_id = doc.pop('user_id', '') | ||
session_id = doc.pop('session_id', '') | ||
user_agent = doc.pop('user_agent', '') | ||
timestamp = arrow.get(doc.get('timestamp')).strftime('%Y%m%d%H') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this to timeslice
and explain in a comment what this is (w.r.t. COUNTER terminology)
cf1c4ae
to
8744ed7
Compare
No description provided.