Documentation
¶
Index ¶
- Constants
- func MustTemplate(name string, contents []string) *template.Template
- type Charter
- type Layout
- type Markdown
- type Page
- type Renderer
- type StatsServer
- func (server *StatsServer) ActivePlayersMonthly() *charts.Line
- func (server *StatsServer) ActivePlayersPie() *charts.Pie
- func (server *StatsServer) BarChartByRandomBattles() *charts.Bar
- func (server *StatsServer) DistributionByWinRate(minBattles int, step float64) *charts.Line
- func (server *StatsServer) DivVsSoloWR() *charts.Scatter
- func (server *StatsServer) GenerateReport()
- func (server *StatsServer) MonthlyBattleEstimation() *charts.Line
- func (server *StatsServer) PieClanProfiles() *charts.Pie
- func (server *StatsServer) PieHiddenProfiles() *charts.Pie
- func (server *StatsServer) PlayerGainLossBar(minBattles int) []*charts.Bar
- func (server *StatsServer) PlayerStartStopChart() *charts.Bar3D
- func (server *StatsServer) WinRateByBattles() *charts.Bar
Constants ¶
View Source
const ( OtherNotes = ` ## Data Collection ### Code You can find the code in the following file: [wows.go](https://github.com/wows-tools/wows-stats/blob/main/backend/wows.go). ### Methodology To collect player statistics, the code utilizes the [WoWs API provided by Wargaming](https://developers.wargaming.net/). However, due to limitations in the API, it is not possible to retrieve a complete list of all players directly. Instead, a search endpoint is available, which allows searching for players based on a nickname prefix. The prefix must have a minimum length of 3 characters, and the API returns a maximum of 100 profiles sorted alphabetically. To overcome these limitations, a creative algorithm is implemented with the following steps: 1. Start with the shortest prefix '000' (the first prefix alphabetically). 2. Perform a search using the current prefix. 3. If the search result contains fewer than 100 players: - If the prefix ends with the last character in the alphabet ("` + "`" + `_` + "`" + `"), reduce the prefix size by 1 and move to the next prefix. - If the prefix does not end with the last character, set the prefix to the first len(current_prefix) + 1 characters of the last entry's nickname from the search result and move to the next prefix. 4. Repeat steps 2-3 until the prefix loops back to '000\*'. Once all the players are retrieved using this method, an iteration is performed to gather additional details such as the number of battles, account creation date, etc. Clans are also scanned. Additionally, the code includes a clean-up process to identify and remove potential QA/test accounts created by Wargaming. These accounts exhibit similar nickname patterns and identical statistics. Examples of these patterns are "pt\*tpt," "lp\_ru\_prod\*," and "auto\_\*." On the European server alone, there are approximately 330,000 such accounts. The implementation of this algorithm is complex and error-prone. However, the code has successfully collected the following player counts (as of 2023/05/24) which looks consistent: - EU: 7,058,091 players - NA: 3,576,287 players - ASIA: 3,894,958 players Please note that running the complete data collection process for each server takes a considerable amount of time, approximately 1 to 2 days per server. ### Collect/Report Genation Frequency This project collects data and generate the present report once per month, toward the end of the month. ## About the CIS -> EU migration Apparently, accounts which were migration from CIS to EU where migrated in full, including account creation date. This means that charts related to accounts on the EU server are actually: * EU + migrated portion of CIS before September 2022 * EU alone after September 2022 (with the influx of CIS players) This is why no spikes are visible around that time. Clans were recreated fresh however. ## Final Notes This project is on going and still early on. New charts will be added, problematic charts will be deleted and existing charts tweaked/improved. This project will also improve over time by having a data history. One of its big flaw currently is the lack of historic data, which leads to numerous approximations. With historic data, these approximations will partially disappear over time. ` SeePrevious = ` ### Description See Previous chart(s) description. ` )
View Source
const ( ModChart = "chart" ModPage = "page" )
View Source
const (
ActivePlayersMonthlyMethodology = `` /* 760-byte string literal not displayed */
)
View Source
const (
ActivePlayersPieMethodology = `` /* 483-byte string literal not displayed */
)
View Source
const (
BarChartByRandomBattlesMethodology = `` /* 535-byte string literal not displayed */
)
View Source
const (
DistributionByWinRateMethodology = `` /* 2613-byte string literal not displayed */
)
View Source
const (
DivVsSoloWRMethodology = `` /* 735-byte string literal not displayed */
)
View Source
const (
MonthlyBattleEstimationMethodology = `` /* 1558-byte string literal not displayed */
)
View Source
const (
PieClanProfilesMethodology = `` /* 295-byte string literal not displayed */
)
View Source
const (
PieHiddenProfilesMethodology = `` /* 308-byte string literal not displayed */
)
View Source
const (
PlayerGainLossBarMethodology = `` /* 1292-byte string literal not displayed */
)
View Source
const (
PlayerGainLossBarNetMethodology = `` /* 1391-byte string literal not displayed */
)
View Source
const (
PlayerGainLossBarNetMethodology2000 = `
### Description
TODO
### Code
TODO
### Methodology
TODO
### Caveats
TODO
`
)
View Source
const (
PlayerGainLossBarNetWithBattlesMethodoloy = `` /* 1190-byte string literal not displayed */
)
View Source
const (
PlayerGainLossBarNetWithBattlesMethodoloy2000 = `
### Description
TODO
### Code
TODO
### Methodology
TODO
### Caveats
TODO
`
)
View Source
const (
PlayerGainLossBarWithBattlesMethodoloy = `` /* 1511-byte string literal not displayed */
)
View Source
const (
PlayerStartStopChartMethodology = `` /* 1019-byte string literal not displayed */
)
View Source
const (
WinRateByBattlesMethodology = `` /* 536-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Charter ¶
Charter represents a chart value which provides its type, assets and can be validated.
type Markdown ¶
type Markdown struct {
MDText string
}
func NewMarkdown ¶
func (Markdown) FillDefaultValues ¶
func (md Markdown) FillDefaultValues()
type Page ¶
type Page struct { Renderer opts.Initialization opts.Assets ChartRows [][]interface{} Layout Layout }
Page represents a page chart.
type Renderer ¶
func NewPageRender ¶
func NewPageRender(c interface{}, before ...func()) Renderer
NewPageRender returns a render implementation for Page.
type StatsServer ¶
func NewStatsServer ¶
func NewStatsServer(output string, logger *zap.SugaredLogger, db *gorm.DB, realm string) *StatsServer
func (*StatsServer) ActivePlayersMonthly ¶
func (server *StatsServer) ActivePlayersMonthly() *charts.Line
func (*StatsServer) ActivePlayersPie ¶
func (server *StatsServer) ActivePlayersPie() *charts.Pie
func (*StatsServer) BarChartByRandomBattles ¶
func (server *StatsServer) BarChartByRandomBattles() *charts.Bar
func (*StatsServer) DistributionByWinRate ¶
func (server *StatsServer) DistributionByWinRate(minBattles int, step float64) *charts.Line
minBattles: Minimum number of battles step: size for win rate increments
func (*StatsServer) DivVsSoloWR ¶
func (server *StatsServer) DivVsSoloWR() *charts.Scatter
func (*StatsServer) GenerateReport ¶
func (server *StatsServer) GenerateReport()
func (*StatsServer) MonthlyBattleEstimation ¶
func (server *StatsServer) MonthlyBattleEstimation() *charts.Line
func (*StatsServer) PieClanProfiles ¶
func (server *StatsServer) PieClanProfiles() *charts.Pie
func (*StatsServer) PieHiddenProfiles ¶
func (server *StatsServer) PieHiddenProfiles() *charts.Pie
func (*StatsServer) PlayerGainLossBar ¶
func (server *StatsServer) PlayerGainLossBar(minBattles int) []*charts.Bar
func (*StatsServer) PlayerStartStopChart ¶
func (server *StatsServer) PlayerStartStopChart() *charts.Bar3D
func (*StatsServer) WinRateByBattles ¶
func (server *StatsServer) WinRateByBattles() *charts.Bar
Click to show internal directories.
Click to hide internal directories.