mirror of
https://github.com/elyby/chrly.git
synced 2024-12-23 21:50:03 +05:30
Fix stats reporting for batch UUIDs provider
This commit is contained in:
parent
1b9e943c0e
commit
436d98e1a0
@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- [#24](https://github.com/elyby/chrly/issues/24): Added a new batch Mojang UUIDs provider strategy `full-bus` and
|
- [#24](https://github.com/elyby/chrly/issues/24): Added a new batch Mojang UUIDs provider strategy `full-bus` and
|
||||||
corresponding configuration param `QUEUE_STRATEGY` with the default value `periodic`.
|
corresponding configuration param `QUEUE_STRATEGY` with the default value `periodic`.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- `ely.skinsystem.{hostname}.app.mojang_textures.usernames.round_time` timer will not be recorded if the iteration was
|
||||||
|
empty.
|
||||||
|
|
||||||
## [4.4.1] - 2020-04-24
|
## [4.4.1] - 2020-04-24
|
||||||
### Added
|
### Added
|
||||||
- [#20](https://github.com/elyby/chrly/issues/20): Print hostname in the `version` command output.
|
- [#20](https://github.com/elyby/chrly/issues/20): Print hostname in the `version` command output.
|
||||||
|
@ -96,12 +96,12 @@ func (s *StatsReporter) ConfigureWithDispatcher(d Subscriber) {
|
|||||||
d.Subscribe("mojang_textures:batch_uuids_provider:round", func(usernames []string, queueSize int) {
|
d.Subscribe("mojang_textures:batch_uuids_provider:round", func(usernames []string, queueSize int) {
|
||||||
s.UpdateGauge("mojang_textures.usernames.iteration_size", int64(len(usernames)))
|
s.UpdateGauge("mojang_textures.usernames.iteration_size", int64(len(usernames)))
|
||||||
s.UpdateGauge("mojang_textures.usernames.queue_size", int64(queueSize))
|
s.UpdateGauge("mojang_textures.usernames.queue_size", int64(queueSize))
|
||||||
|
if len(usernames) != 0 {
|
||||||
|
s.startTimeRecording("batch_uuids_provider_round_time_" + strings.Join(usernames, "|"))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
d.Subscribe("mojang_textures:batch_uuids_provider:before_round", func() {
|
d.Subscribe("mojang_textures:batch_uuids_provider:result", func(usernames []string, profiles []*mojang.ProfileInfo, err error) {
|
||||||
s.startTimeRecording("batch_uuids_provider_round_time")
|
s.finalizeTimeRecording("batch_uuids_provider_round_time_"+strings.Join(usernames, "|"), "mojang_textures.usernames.round_time")
|
||||||
})
|
|
||||||
d.Subscribe("mojang_textures:batch_uuids_provider:after_round", func() {
|
|
||||||
s.finalizeTimeRecording("batch_uuids_provider_round_time", "mojang_textures.usernames.round_time")
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,19 +337,24 @@ var statsReporterTestCases = []*StatsReporterTestCase{
|
|||||||
{
|
{
|
||||||
Events: [][]interface{}{
|
Events: [][]interface{}{
|
||||||
{"mojang_textures:batch_uuids_provider:round", []string{"username1", "username2"}, 5},
|
{"mojang_textures:batch_uuids_provider:round", []string{"username1", "username2"}, 5},
|
||||||
|
{"mojang_textures:batch_uuids_provider:result", []string{"username1", "username2"}, []*mojang.ProfileInfo{}, nil},
|
||||||
},
|
},
|
||||||
ExpectedCalls: [][]interface{}{
|
ExpectedCalls: [][]interface{}{
|
||||||
{"UpdateGauge", "mojang_textures.usernames.iteration_size", int64(2)},
|
{"UpdateGauge", "mojang_textures.usernames.iteration_size", int64(2)},
|
||||||
{"UpdateGauge", "mojang_textures.usernames.queue_size", int64(5)},
|
{"UpdateGauge", "mojang_textures.usernames.queue_size", int64(5)},
|
||||||
|
{"RecordTimer", "mojang_textures.usernames.round_time", mock.AnythingOfType("time.Duration")},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Events: [][]interface{}{
|
Events: [][]interface{}{
|
||||||
{"mojang_textures:batch_uuids_provider:before_round"},
|
{"mojang_textures:batch_uuids_provider:round", []string{}, 0},
|
||||||
{"mojang_textures:batch_uuids_provider:after_round"},
|
// This event will be not emitted, but we emit it to ensure, that RecordTimer will not be called
|
||||||
|
{"mojang_textures:batch_uuids_provider:result", []string{}, []*mojang.ProfileInfo{}, nil},
|
||||||
},
|
},
|
||||||
ExpectedCalls: [][]interface{}{
|
ExpectedCalls: [][]interface{}{
|
||||||
{"RecordTimer", "mojang_textures.usernames.round_time", mock.AnythingOfType("time.Duration")},
|
{"UpdateGauge", "mojang_textures.usernames.iteration_size", int64(0)},
|
||||||
|
{"UpdateGauge", "mojang_textures.usernames.queue_size", int64(0)},
|
||||||
|
// Should not call RecordTimer
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user