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

Tag usage statistics #16

Closed
kirillt opened this issue Oct 9, 2021 · 2 comments
Closed

Tag usage statistics #16

kirillt opened this issue Oct 9, 2021 · 2 comments

Comments

@kirillt
Copy link
Member

kirillt commented Oct 9, 2021

For usage in tag selectors, it would be convenient to have tag stats: kind of metrics, which we can't count just by looking at resources in corresponding collections. Stats can be, e.g. amount of times tag was used or how recently tag was used.

These stats can be kept in Room, but this way stats from one device will not transport to another. Sometimes it might be preferred to treat devices differently though (e.g. a phone and a laptop could be used for different workflows). In terms of performance, we will not have penalty if we will write stats into tags storage (we write to it every time we tag a resource anyway). We can allow a user to set her preferences regarding to persist stats or not.

Statistics to consider:

  1. How many times the tag was queried — the simplest one to implement.
  2. How many times a resource was labeled with the tag — should not be confused with popularity metric, since popularity is "final state" and tags can also be used temporary, e.g. "todo", which are removed from a resource after some time.
  3. How recently the tag was queried.
  4. How recently a resource was labeled with the tag.

Here, 1 and 3 are query stats and 2 and 4 are label stats, but I am not sure that this separation of stats is really useful. It is based on the fact that we have query tag selector and label tag selector, they are similar but not the same and we can sort tags in them basing on different stats. On other hand, we can simplify 4 stats into just 2.

About 3 and 4: "how recently" doesn't necessarily mean "time". We can implement these stats using timestamps, but we need to sort tags by them, so might be more practical to just keep stack and put a tag on top of it when it is used.

@kirillt
Copy link
Member Author

kirillt commented Jul 23, 2022

Each of these stats could be stored in its own file of persisted/replicated storage a.k.a. .ark folder:

  1. How many times the tag was queried
    .ark/stats/tag-queried-n
  2. How many times a resource was labeled with the tag
    .ark/stats/tag-labeled-n
  3. How recently the tag was queried
    .ark/stats/tag-queried-ts
  4. How recently a resource was labeled with the tag
    .ark/stats/tag-labeled-ts

See ARK-Builders/arklib-android#86 for concrete task about 2 and 4.

@kirillt
Copy link
Member Author

kirillt commented Nov 1, 2022

ARK-Builders/ARK-Navigator#310 implements all 4 of the statistics.

@kirillt kirillt closed this as completed Nov 1, 2022
@kirillt kirillt transferred this issue from ARK-Builders/ARK-Navigator Aug 30, 2023
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

1 participant