Skip to content

Commit e429c81

Browse files
sharvaniharanSharvani Haran
andauthored
Keeping : as the consistent delimiter between key : value pairs (#3927)
Co-authored-by: Sharvani Haran <[email protected]>
1 parent 02256a6 commit e429c81

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

app/src/main/java/org/wikipedia/analytics/eventplatform/MachineGeneratedArticleDescriptionsAnalyticsHelper.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ class MachineGeneratedArticleDescriptionsAnalyticsHelper {
2828

2929
fun logAttempt(context: Context, finalDescription: String, wasChosen: Boolean, wasModified: Boolean, title: PageTitle) {
3030
log(context, composeLogString(title) + ".attempt:$finalDescription" +
31-
".suggestion1:${encode(apiOrderList.first())}" + (if (apiOrderList.size > 1) ".suggestion2.${encode(apiOrderList.last())}" else "") +
32-
getOrderString(wasChosen, chosenSuggestion) + ".modified:$wasModified.timeSpentMs.${timer.elapsedMillis}")
31+
".suggestion1:${encode(apiOrderList.first())}" + (if (apiOrderList.size > 1) ".suggestion2:${encode(apiOrderList.last())}" else "") +
32+
getOrderString(wasChosen, chosenSuggestion) + ".modified:$wasModified.timeSpentMs:${timer.elapsedMillis}")
3333
}
3434

3535
fun logSuccess(context: Context, finalDescription: String, wasChosen: Boolean, wasModified: Boolean, title: PageTitle, revId: Long) {
3636
log(context, composeLogString(title) + ".success:$finalDescription" +
37-
".suggestion1:${encode(apiOrderList.first())}" + (if (apiOrderList.size > 1) ".suggestion2.${encode(apiOrderList.last())}" else "") +
38-
getOrderString(wasChosen, chosenSuggestion) + ".modified:$wasModified.timeSpentMs.${timer.elapsedMillis}.revId:$revId")
37+
".suggestion1:${encode(apiOrderList.first())}" + (if (apiOrderList.size > 1) ".suggestion2:${encode(apiOrderList.last())}" else "") +
38+
getOrderString(wasChosen, chosenSuggestion) + ".modified:$wasModified.timeSpentMs:${timer.elapsedMillis}.revId:$revId")
3939
}
4040

4141
fun logSuggestionsReceived(context: Context, isBlp: Boolean, title: PageTitle) {
4242
apiFailed = false
4343
log(context, composeLogString(title) + ".blp:$isBlp.count:${apiOrderList.size}.suggestion1:${encode(apiOrderList.first())}" +
44-
if (apiOrderList.size > 1) ".suggestion2.${encode(apiOrderList.last())}" else "")
44+
if (apiOrderList.size > 1) ".suggestion2:${encode(apiOrderList.last())}" else "")
4545
}
4646

4747
fun logSuggestionsShown(context: Context, title: PageTitle) {
4848
log(context, composeLogString(title) + ".count:${displayOrderList.size}.display1:${encode(displayOrderList.first())}" +
49-
if (displayOrderList.size > 1) ".display2.${encode(displayOrderList.last())}" else "")
49+
if (displayOrderList.size > 1) ".display2:${encode(displayOrderList.last())}" else "")
5050
}
5151

5252
fun logSuggestionChosen(context: Context, suggestion: String, title: PageTitle) {
@@ -60,7 +60,7 @@ class MachineGeneratedArticleDescriptionsAnalyticsHelper {
6060

6161
fun logSuggestionReported(context: Context, suggestion: String, reportReasonsList: List<String>, title: PageTitle) {
6262
val reportReasons = reportReasonsList.joinToString("|")
63-
log(context, composeLogString(title) + ".reportDialog.${encode(suggestion)}${getOrderString(true, suggestion)}.reasons:$reportReasons.reported")
63+
log(context, composeLogString(title) + ".reportDialog.suggestion:${encode(suggestion)}${getOrderString(true, suggestion)}.reasons:$reportReasons.reported")
6464
}
6565

6666
fun logReportDialogDismissed(context: Context) {
@@ -76,7 +76,7 @@ class MachineGeneratedArticleDescriptionsAnalyticsHelper {
7676
}
7777

7878
fun logApiFailed(context: Context, throwable: Throwable, title: PageTitle) {
79-
log(context, composeLogString(title) + ".apiError.${throwable.message}")
79+
log(context, composeLogString(title) + ".apiError:${throwable.message}")
8080
apiFailed = true
8181
}
8282

@@ -88,7 +88,7 @@ class MachineGeneratedArticleDescriptionsAnalyticsHelper {
8888
}
8989

9090
private fun getOrderString(wasChosen: Boolean, suggestion: String): String {
91-
return ".chosenApiIndex.${if (!wasChosen) -1 else apiOrderList.indexOf(suggestion) + 1}" +
91+
return ".chosenApiIndex:${if (!wasChosen) -1 else apiOrderList.indexOf(suggestion) + 1}" +
9292
".chosenDisplayIndex:${if (!wasChosen) -1 else displayOrderList.indexOf(suggestion) + 1}"
9393
}
9494

0 commit comments

Comments
 (0)