Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Metrics dash board #168

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Metrics dash board #168

wants to merge 8 commits into from

Conversation

hc00364289
Copy link
Contributor

@zlavergne :Please review

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 5, 2021
@gaoxm gaoxm requested review from gaoxm and zlavergne March 25, 2021 19:34
Copy link

@gaoxm gaoxm left a comment

Choose a reason for hiding this comment

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

some comments for the backend changes for the first round. will share comments on the UI part later.

backend/api/users/statistics.py Outdated Show resolved Hide resolved
backend/api/users/statistics.py Outdated Show resolved Hide resolved
backend/api/users/statistics.py Outdated Show resolved Hide resolved
backend/api/users/statistics.py Outdated Show resolved Hide resolved
backend/api/users/statistics.py Outdated Show resolved Hide resolved
backend/services/users/user_service.py Outdated Show resolved Hide resolved
backend/services/users/user_service.py Outdated Show resolved Hide resolved
backend/services/users/user_service.py Outdated Show resolved Hide resolved
Comment on lines +2204 to +2212
task_query = (TaskHistory.query.with_entities(TaskHistory.task_id)
.filter(TaskHistory.user_id==user.id)
.group_by(TaskHistory.task_id)
).all()

pro_query=(TaskHistory.query.with_entities(TaskHistory.project_id)
.filter(TaskHistory.user_id==user.id)
.group_by(TaskHistory.project_id)
).all()
Copy link

Choose a reason for hiding this comment

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

since the same task ID may appear in multiple projects, this way of querying task IDs and project IDs separately and then iterate through all combinations seems very inefficient. Ideally this part should do one query like
SELECT DISTINCT project_id, task_id FROM task_history WHERE user_id = {user.id},
and then the query below should use the (project_id, task_id) tuples returned from this query to find relevant tasks and compute the "time spent on actions".

I'll let @zlavergne comment on how to do that in TM codebase.

frontend/src/components/teamsAndOrgs/teams.js Outdated Show resolved Hide resolved
@zlavergne zlavergne added the PRIORITY Work on these first label Nov 9, 2021
@zlavergne zlavergne linked an issue Nov 9, 2021 that may be closed by this pull request
@zlavergne zlavergne added this to the Hi-Pri Features milestone Nov 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Component: Backend Component: Frontend PRIORITY Work on these first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metrics Dashboard
4 participants