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

[Prototype] Daily/Weekly statistics for Grafana Infinity plugin #18

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lkiesow
Copy link
Member

@lkiesow lkiesow commented Jan 26, 2025

This is an experimental extension for generating daily and weekly usage
statistics to be visualized using Grafana's Infinity plugin.

Currently missing are:

  • Store generated statistics data
    • Should improve boot performance quite a bit
    • Handles users deleting old messages
  • Simplify update mechanism
    • Only generate what's necessary
    • Put update code in a single function
  • Handle monthly and yearly statistics
  • Handle from and to parameters

This includes #17

Screenshot from 2025-01-26 23-57-09
This is how something like this could look in Grafana

{
  "daily": [
    {
      "date": "2025-01-15",
      "user": 2
    },
    {
      "date": "2025-01-16",
      "user": 0
    },
    {
      "date": "2025-01-17",
      "user": 0
    },
    {
      "date": "2025-01-18",
      "user": 0
    },
    {
      "date": "2025-01-19",
      "user": 0
    },
    {
      "date": "2025-01-20",
      "user": 0
    },
    {
      "date": "2025-01-21",
      "user": 0
    },
    {
      "date": "2025-01-22",
      "user": 0
    },
    {
      "date": "2025-01-23",
      "user": 0
    },
    {
      "date": "2025-01-24",
      "user": 0
    },
    {
      "date": "2025-01-25",
      "user": 0
    }
  ],
  "weekly": [
    {
      "date": "2025-01-13",
      "user": 2
    }
  ]
}

This is more or less how the output looks like

This patch switches to using twisted as web server. This makes signal
handling quite a bit easier, while allowing for more control about what
is being served and how it is served.

Mostly, though, this is a preparation for service additional statistics
data later on since this allows us to easily add new endpoints for
serving data.
This is an experimental extension for generating daily and weekly usage
statistics to be visualized using Grafana's Infinity plugin.

Currently missing are:

- Store generated statistics data
  - Should improve boot performance quite a bit
  - Handles users deleting old messages
- Simplify update mechanism
  - Only generate what's necessary
  - Put update code in a single function
- Handle monthly and yearly statistics
@lkiesow lkiesow changed the title Infinity [Prototype] Daily/Weekly statistics for Grafana Infinity plugin Jan 26, 2025
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.

1 participant