File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
core/src/main/java/com/segment/analytics/kotlin/core Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ object Telemetry: Subscriber {
119
119
// Assume sampleRate is now set and everything in the queue hasn't had it applied
120
120
if (Math .random() > sampleRate) {
121
121
resetQueue()
122
+ } else {
123
+ queue.forEach {
124
+ it.value = (it.value / sampleRate).roundToInt()
125
+ }
122
126
}
123
127
124
128
telemetryJob = telemetryScope.launch(telemetryDispatcher) {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ internal class Mediator(internal var plugins: CopyOnWriteArrayList<Plugin> = Cop
37
37
try {
38
38
Telemetry .increment(Telemetry .INTEGRATION_METRIC ) {
39
39
it[" message" ] = " event-${event.type} "
40
- " plugin" to " ${plugin.type} -${plugin.javaClass} "
40
+ it[ " plugin" ] = " ${plugin.type} -${plugin.javaClass} "
41
41
}
42
42
when (plugin) {
43
43
is DestinationPlugin -> {
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ internal class Timeline {
80
80
}
81
81
Telemetry .increment(Telemetry .INTEGRATION_METRIC ) {
82
82
it[" message" ] = " added"
83
- it[" plugin" ] = " ${plugin.type.toString() } -${plugin.javaClass.toString() } "
83
+ it[" plugin" ] = " ${plugin.type} -${plugin.javaClass} "
84
84
}
85
85
plugins[plugin.type]?.add(plugin)
86
86
with (analytics) {
@@ -109,7 +109,7 @@ internal class Timeline {
109
109
list.remove(plugin)
110
110
Telemetry .increment(Telemetry .INTEGRATION_METRIC ) {
111
111
it[" message" ] = " removed"
112
- it[" plugin" ] = " ${plugin.type.toString() } -${plugin.javaClass.toString() } "
112
+ it[" plugin" ] = " ${plugin.type} -${plugin.javaClass} "
113
113
}
114
114
}
115
115
}
You can’t perform that action at this time.
0 commit comments