Update split SDK to 6.0.2 to fix sync bug (#17060)
* Update split SDK to 6.0.2 to fix sync bug * Vendor and tidy
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fa2ecad0a9
Коммит
aba00a3cfd
43
vendor/github.com/splitio/go-split-commons/v3/util/metrics.go
сгенерированный
поставляемый
Обычный файл
43
vendor/github.com/splitio/go-split-commons/v3/util/metrics.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,43 @@
|
||||
package util
|
||||
|
||||
var latencyBuckets = [23]float64{
|
||||
1.00,
|
||||
1.50,
|
||||
2.25,
|
||||
3.38,
|
||||
5.06,
|
||||
7.59,
|
||||
11.39,
|
||||
17.09,
|
||||
25.63,
|
||||
38.44,
|
||||
57.67,
|
||||
86.50,
|
||||
129.75,
|
||||
194.62,
|
||||
291.93,
|
||||
437.89,
|
||||
656.84,
|
||||
985.26,
|
||||
1477.89,
|
||||
2216.84,
|
||||
3325.26,
|
||||
4987.89,
|
||||
7481.83,
|
||||
}
|
||||
|
||||
// Bucket returns the bucket where the received latency falls
|
||||
func Bucket(latency int64) int {
|
||||
floatLatency := float64(latency) / 1000 // Convert to millisencods
|
||||
|
||||
index := 0
|
||||
for index < len(latencyBuckets) && floatLatency > latencyBuckets[index] {
|
||||
index++
|
||||
}
|
||||
|
||||
if index == len(latencyBuckets) {
|
||||
return index - 1
|
||||
}
|
||||
|
||||
return index
|
||||
}
|
||||
30
vendor/github.com/splitio/go-split-commons/v3/util/mode.go
сгенерированный
поставляемый
Обычный файл
30
vendor/github.com/splitio/go-split-commons/v3/util/mode.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,30 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/splitio/go-split-commons/v3/conf"
|
||||
)
|
||||
|
||||
// ShouldAddPreviousTime returns if previous time should be set up or not depending on operationMode
|
||||
func ShouldAddPreviousTime(managerConfig conf.ManagerConfig) bool {
|
||||
switch strings.ToLower(managerConfig.OperationMode) {
|
||||
case conf.ProducerSync:
|
||||
fallthrough
|
||||
case conf.Standalone:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// ShouldBeOptimized returns if should dedupe impressions or not depending on configs
|
||||
func ShouldBeOptimized(managerConfig conf.ManagerConfig) bool {
|
||||
if !ShouldAddPreviousTime(managerConfig) {
|
||||
return false
|
||||
}
|
||||
if strings.ToLower(managerConfig.ImpressionsMode) == conf.ImpressionsModeOptimized {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
11
vendor/github.com/splitio/go-split-commons/v3/util/time.go
сгенерированный
поставляемый
Обычный файл
11
vendor/github.com/splitio/go-split-commons/v3/util/time.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,11 @@
|
||||
package util
|
||||
|
||||
import "time"
|
||||
|
||||
const dedupWindowSizeMs = 3600 * 1000
|
||||
|
||||
// TruncateTimeFrame truncates de time frame received with the time window
|
||||
func TruncateTimeFrame(timestampInNs int64) int64 {
|
||||
timestampInMs := timestampInNs / int64(time.Millisecond)
|
||||
return timestampInMs - (timestampInMs % dedupWindowSizeMs)
|
||||
}
|
||||
Ссылка в новой задаче
Block a user