Skip to content

Basic FastStats setup#211

Draft
Nadwey wants to merge 4 commits into
masterfrom
feat/faststats
Draft

Basic FastStats setup#211
Nadwey wants to merge 4 commits into
masterfrom
feat/faststats

Conversation

@Nadwey

@Nadwey Nadwey commented Apr 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@Thorinwasher Thorinwasher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good, I do have some ideas on how it could be done in another way, but feel free to ignore them as your solution works fine as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way to make this more extensible is to have an interface type, i.e Metrics, and then have the types FastStats, BStatsBrewery, BStatsBreweryX implement that interface.

With that you could just store all the different metrics in a list, like this:

List<Metrics> metrics = List.of(new FastStats(), new BStatsBrewery(), new BStatsBreweryX());

And then access those like this:

// Enable all metrics
metrics.forEach(Metrics::enable);
// Disable all metrics
metrics.forEach(Metrics::disable);

Right now you essentially just have a wrapper class that does this, which does not scale as well. (Honestly does not matter, as this solution works on small scales, and it's probably not going to change)

}
}

public void forDrink(Brew brew) {

@Thorinwasher Thorinwasher May 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other stats being tracked like this could be done through another class, maybe a StatsCache, and then it could be accessed with the statistics clients.

Also this one is stupid, as I don't think it's being stored persistently. So this statistic is going to be directly related to server restarts.

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.

2 participants