coenm / RepoM

👨‍💻 A minimal-conf git repository hub for Windows . This project is a fork of RepoZ
MIT License
12 stars 2 forks source link

Documentation for usage-scorer@1 and ordering in general #173

Open gabriel-vanca opened 2 months ago

gabriel-vanca commented 2 months ago

Please provide more info on how usage-scorer@1

From the documentation:

usage-scorer@1
Repository scorer based on it's usage by RepoM. The more it's used, the higher the score.

Properties:

windows: Specific 'windows' to calculate the score for.
max-score: The maximum score a repository can get.

It's unclear how the windows, until, max-items and max-score fields work.

coenm commented 2 months ago

I'll try to explain by first explaining an other comparer:

  - type: score-comparer@1
    score-provider:
      type: tag-scorer@1
      weight: 1
      tag: work

score-comparer@1 compares two repositories in order to determine the ordering in the UI. How the score of a repository is calculated is defined using the score-provider. In this case, it is the tag-scorer@1 which calculates the score of a repository by using the tags of the repository. For this config, a repository gets the value 1 if it contains the work tag and 0 otherwise.

This configuration results in that repositories with work tags are listed before repositories without.

The usage-scorer@1 creates a score based on the usage of the repository. This 'usage' is the number of times a repository action is performed on the repository. When you click a number of times on an action, this repository will have an higher score than others.

How does this work?

How to configure the usage-scorer@1?

I'll try to exmplain using this example:

  - type: score-comparer@1
    score-provider:
      type: usage-scorer@1
      max-score: 15
      windows:
      - until: 00:15:00
        weight: 4
        max-items: 2
      - until: 01:00:00
        weight: 3
        max-items: 3
      - until: 24:00:00
        weight: 2
        max-items: 5
      - until: 168:00:00
        weight: 1
        max-items: 10

This means:

I'll find in difficult to find the right words to explain this as clear as possible. If you still have some questions, please ask.

coenm commented 2 months ago

By the way,

The statistics module provides a variable (for debug puposes) to show the number of recorded calls of the repository:

  - type: just-text@1
    name: 'Usage counter: {{ statistics.count }}'

Currently, in the main branch, this documentation can be found here