nextcloud / nextcloud/serverinfo

Common interface for all statistic classes

Open
#284 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

technical debt
Dominant language
JavaScript
Stars
130
Forks
64
Avg merge
1d 1h
Merged PRs (30d)
49

Description

  • Write IStatisticsProvider interface
    • getName() to retrieve the name of the key to publish the statistics under
    • getGroup() to retrieve the name of the group key to publish the statistics under
    • getStatistics() returns the stats to retrieve
  • Write StatisticsService
    • registerStatisticsProvider(IStatisticsProvider)
    • IStatisticsProvider[] getStatisticsProviders()
  • adjust ApiController
    • receive StatisticsProvider injected instead of all the custom classes
    • query StatisticsProvider->getStatisticsProviders() and iterate and compile the stats
  • cleanup ApiControllerTest
  • rewrite the custom classes to implement IStatisticsProvider
  • register the custom classes in the application initialization

This cleantup and enhancement would also open the door to allowing third party apps to register their own statistics providers in the future.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing ApiController, ApiControllerTest, the existing custom statistic classes, and application initialization. Trace how current statistics providers are supplied and compiled, then define the shared interface and service, update registration and injection, and confirm the controller tests cover the new provider iteration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.