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

Feat: Metrics! #245

Closed
7 tasks done
nelsonic opened this issue Jan 4, 2023 · 10 comments · Fixed by #250
Closed
7 tasks done

Feat: Metrics! #245

nelsonic opened this issue Jan 4, 2023 · 10 comments · Fixed by #250
Assignees
Labels
BLOCKED :fire: Core team's HIGHEST priority, blocking critical work bug Suspected or confirmed bug (defect) in the code chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! needs-design A feature idea that needs some interface design in order to be discussed/built. priority-1 Highest priority issue. This is costing us money every minute that passes. T4h Time Estimate 4 Hours tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Jan 4, 2023

At present I don't have any metrics/stats for my usage of the MVP. 😞

Story

People Using the MVP

As a person using the @dwyl MVP to test the features and give feedback #140
I want a quick way of viewing basic aggregate stats on how many items and timers I have created
So that I know how much I'm using the MVP to improve my personal effectiveness.

People Building the MVP

As a person building the @dwyl MVP to solve a personal problem faced with existing task trackers or ["personal productivity" tools...]
I want to know if the MVP is being used by anyone
So that I know if the features are being used.

Todo

  • Create a new endpoint /stats
  • Create a LiveView page that renders the data and is updated in real-time
  • The stats channel should only be used for aggregate data i.e. nothing personally identifiable.

Build a basic metrics dashboard that displays:

  • person_id

  • Number of items

  • Number of timers

  • Display the data as a <table> (we can create pretty graphs later!)

Note: this will be an internal dashboard for now and will remain "anonymous".
But in the future it will be a personal dashboard for the person using the App to see how much and when they are using it.

So we will want a visual representation of their usage similar to what GitHub has with their contribution graph:

image

image

We will encourage people to have "streaks" or at least to know they are making progress toward their goals.
This is "Step 1" on the Roadmap: github.com/dwyl/product-roadmap#why-are-we-building-an-app
Knowing that you are making daily progress towards your goals is the secret to personal effectiveness and staying focussed long-term and not getting distracted ... See: mattcutts.com/blog/seinfeld-calendar-trick

Longer term this will be a feature in itself. But for now we just need something basic. 🙏

@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! technical A technical issue that requires understanding of the code, infrastructure or dependencies T4h Time Estimate 4 Hours priority-1 Highest priority issue. This is costing us money every minute that passes. discuss Share your constructive thoughts on how to make progress with this issue needs-ui labels Jan 4, 2023
@nelsonic nelsonic moved this to 📋 Backlog in dwyl app kanban Jan 4, 2023
@LuchoTurtle LuchoTurtle self-assigned this Jan 4, 2023
@LuchoTurtle LuchoTurtle moved this from 📋 Backlog to 🏗 In progress in dwyl app kanban Jan 4, 2023
@LuchoTurtle
Copy link
Member

I can take this issue but I just have two questions:

  • The dashboard is internal correct? It should show metrics for all users. How should I block access for 'regular users" so only dwyl members can access it? (implementation-wise)
  • Would re-using the live channel that already exists be better? Or should I create a new channel dedicated to metrics? I feel like re-using would be easier/more readable but I can't figure out if it can be "too coupled" for long-term maintainability.

@nelsonic
Copy link
Member Author

nelsonic commented Jan 6, 2023

Hi @LuchoTurtle thanks for reading and replying. 🙏
really hope you're feeling much better. 🤒 -> 😊 🤞

To answer your two questions:

  1. Yes, for now, the dashboard is "internal" but it won't be hidden or restricted by any RBAC, so anyone/everyone using the MVP can see the stats and consider it a "leaderboard" of sorts. 😜
  2. On a small MVP it doesn't really matter if you re-use the live channel cause the amount of data being sent will be tiny. But I'd say that the "best practice" would be to have a stats channel that is specific to the /stats page to reduce noise on the wire. 💭

Thanks for looking into this. Will be great to have some stats/metrics! 🎉
And once the basics are done, we can do graphs too! 📈

@nelsonic
Copy link
Member Author

This is what I had in mind:

SELECT i.person_id,
COUNT(distinct i.id) AS "num_items", 
COUNT(distinct t.id) AS "num_timers"
FROM items i
LEFT JOIN timers t ON t.item_id = i.id
GROUP BY person_id
ORDER BY person_id

@nelsonic
Copy link
Member Author

Basic AF:
image

But it's all we need to get started. 👌

@nelsonic
Copy link
Member Author

Compact table:

image

@nelsonic
Copy link
Member Author

https://mvp.fly.dev/stats
image

@LuchoTurtle please investigate why. 🔍
If you get stuck ping me on Signal and we can remote-pair/debug via Zoom. 💭

@nelsonic nelsonic reopened this Jan 12, 2023
@nelsonic nelsonic added bug Suspected or confirmed bug (defect) in the code chore a tedious but necessary task often paying technical debt BLOCKED :fire: Core team's HIGHEST priority, blocking critical work tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written labels Jan 12, 2023
@nelsonic nelsonic moved this from ✅ Done to 🏗 In progress in dwyl app kanban Jan 12, 2023
@SimonLab
Copy link
Member

SimonLab commented Jan 12, 2023

It looks like the query is not correct:

** (Postgrex.Error) ERROR 42702 (ambiguous_column) column reference "person_id" is ambiguous

image

(you can see the logs running flyctl logs inside the mvp app folder)

@LuchoTurtle
Copy link
Member

Yeah @SimonLab , I'm working on a PR to fix this.
The PR will also address a few bugs introduced which don't update the stats properly.
I'll be opening an issue shortly.

@LuchoTurtle
Copy link
Member

Created an issue #261 and associated PR #262.

@nelsonic
Copy link
Member Author

https://mvp.fly.dev/stats
image

Appears to be working. 👍
Thanks again @LuchoTurtle

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in dwyl app kanban Jan 12, 2023
@nelsonic nelsonic added needs-design A feature idea that needs some interface design in order to be discussed/built. and removed needs-ui labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKED :fire: Core team's HIGHEST priority, blocking critical work bug Suspected or confirmed bug (defect) in the code chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! needs-design A feature idea that needs some interface design in order to be discussed/built. priority-1 Highest priority issue. This is costing us money every minute that passes. T4h Time Estimate 4 Hours tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants