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

processors: calculate visitor_id and session_id #53

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

ChiaraBi
Copy link
Member

No description provided.

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)\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shorter version with strftime

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()
Copy link
Member

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)

@ChiaraBi ChiaraBi force-pushed the anonymize_user branch 5 times, most recently from ef96f6e to 79b44d5 Compare June 13, 2018 11:22
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')
Copy link
Member

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)

@slint
Copy link
Member

slint commented Jun 14, 2018

@ChiaraBi Also if possible rebase, since #54 was merged

@ChiaraBi ChiaraBi force-pushed the anonymize_user branch 2 times, most recently from cf1c4ae to 8744ed7 Compare June 15, 2018 07:37
@slint slint merged commit 51bc405 into inveniosoftware:counter-sprint Jun 18, 2018
@ChiaraBi ChiaraBi deleted the anonymize_user branch June 28, 2018 08:29
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

Successfully merging this pull request may close these issues.

None yet

2 participants