Skip to content

Commit 514030f

Browse files
authored
Remove CountAggregator usages (#415)
1 parent c32700f commit 514030f

24 files changed

+4
-71
lines changed

AndroidSDKCore/src/main/java/com/leanplum/ActionContext.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ public void runActionNamed(String name) {
369369
createActionContextForMessageId(messageAction.toString(), args, messageId, name, false);
370370
}
371371
}
372-
Leanplum.countAggregator().incrementCount("run_action_named");
373372
}
374373

375374
/**
@@ -527,7 +526,6 @@ public void runTrackedActionNamed(String name) {
527526
} catch (Throwable t) {
528527
Log.exception(t);
529528
}
530-
Leanplum.countAggregator().incrementCount("run_tracked_action_named");
531529
}
532530

533531
/**

AndroidSDKCore/src/main/java/com/leanplum/Leanplum.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ public static void trackAllAppScreens() {
302302
*/
303303
public static void setVariantDebugInfoEnabled(boolean variantDebugInfoEnabled) {
304304
LeanplumInternal.setIsVariantDebugInfoEnabled(variantDebugInfoEnabled);
305-
countAggregator.incrementCount("set_variant_debug_info_enabled");
306305
}
307306

308307
/**
@@ -402,7 +401,6 @@ public static void syncResources() {
402401
} catch (Throwable t) {
403402
Log.exception(t);
404403
}
405-
countAggregator.incrementCount("sync_resources");
406404
}
407405

408406
/**
@@ -418,7 +416,6 @@ public static void syncResourcesAsync() {
418416
} catch (Throwable t) {
419417
Log.exception(t);
420418
}
421-
countAggregator.incrementCount("sync_resources");
422419
}
423420

424421
/**
@@ -440,7 +437,6 @@ public static void syncResources(
440437
} catch (Throwable t) {
441438
Log.exception(t);
442439
}
443-
countAggregator.incrementCount("sync_resource_paths");
444440
}
445441

446442
/**
@@ -462,7 +458,6 @@ public static void syncResourcesAsync(
462458
} catch (Throwable t) {
463459
Log.exception(t);
464460
}
465-
countAggregator.incrementCount("sync_resource_paths");
466461
}
467462

468463
/**
@@ -632,7 +627,6 @@ public void run() {
632627
} catch (Throwable t) {
633628
Log.exception(t);
634629
}
635-
countAggregator.incrementCount("start_with_user_id");
636630
}
637631

638632
/**
@@ -766,7 +760,6 @@ public void error(Exception e) {
766760

767761
private static void handleStartResponse(final JSONObject response) {
768762
boolean success = RequestUtil.isResponseSuccess(response);
769-
Leanplum.countAggregator().incrementCount("on_start_response");
770763
if (!success) {
771764
try {
772765
LeanplumInternal.setHasStarted(true);
@@ -1471,7 +1464,6 @@ private static void defineAction(String name, int kind, ActionArgs args,
14711464
} catch (Throwable t) {
14721465
Log.exception(t);
14731466
}
1474-
Leanplum.countAggregator().incrementCount("define_action");
14751467
}
14761468

14771469
/**
@@ -1670,7 +1662,6 @@ private static void setTrafficSourceInfoInternal(HashMap<String, Object> params)
16701662
public static void track(final String event, double value, String info,
16711663
Map<String, ?> params) {
16721664
LeanplumInternal.track(event, value, info, params, null);
1673-
countAggregator.incrementCount("track");
16741665
}
16751666

16761667
/**
@@ -1869,9 +1860,6 @@ public static void track(String event, double value, String info) {
18691860
public static void trackGeofence(GeofenceEventType event, String info) {
18701861
if (featureFlagManager().isFeatureFlagEnabled("track_geofence")) {
18711862
LeanplumInternal.trackGeofence(event, 0.0, info, null, null);
1872-
countAggregator().incrementCount("track_geofence");
1873-
} else {
1874-
countAggregator().incrementCount("track_geofence_disabled");
18751863
}
18761864
}
18771865

@@ -1913,7 +1901,6 @@ public void run() {
19131901
} catch (Throwable t) {
19141902
Log.exception(t);
19151903
}
1916-
countAggregator.incrementCount("advance_to");
19171904
}
19181905

19191906
/**
@@ -2115,7 +2102,6 @@ public void error(Exception e) {
21152102
} catch (Throwable t) {
21162103
Log.exception(t);
21172104
}
2118-
countAggregator.incrementCount("force_content_update");
21192105
}
21202106

21212107
/**
@@ -2211,7 +2197,6 @@ public static Map<String, Object> getVariantDebugInfo() {
22112197
*/
22122198
public static void setDeviceLocation(Location location) {
22132199
setDeviceLocation(location, LeanplumLocationAccuracyType.CELL);
2214-
Leanplum.countAggregator().incrementCount("setDeviceLocation");
22152200
}
22162201

22172202
/**
@@ -2227,7 +2212,6 @@ public static void setDeviceLocation(Location location, LeanplumLocationAccuracy
22272212
"call setDeviceLocation. If you prefer to always set location manually, " +
22282213
"then call disableLocationCollection.");
22292214
}
2230-
Leanplum.countAggregator().incrementCount("setDeviceLocation_type");
22312215
LeanplumInternal.setUserLocationAttribute(location, type,
22322216
new LeanplumInternal.locationAttributeRequestsCallback() {
22332217
@Override
@@ -2270,7 +2254,6 @@ private static void parseVariantDebugInfo(JSONObject response) {
22702254
*/
22712255
public static void clearUserContent() {
22722256
VarCache.clearUserContent();
2273-
countAggregator.incrementCount("clear_user_content");
22742257
}
22752258

22762259
@VisibleForTesting

AndroidSDKCore/src/main/java/com/leanplum/LeanplumInbox.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ private List<LeanplumInboxMessage> allMessages(List<LeanplumInboxMessage> messag
442442
} catch (Throwable t) {
443443
Log.exception(t);
444444
}
445-
Leanplum.countAggregator().incrementCount("all_messages_inbox");
446445
return messages;
447446
}
448447

AndroidSDKCore/src/main/java/com/leanplum/callbacks/RegisterDeviceCallback.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public void run() {
4747

4848
public void setResponseHandler(EmailCallback callback) {
4949
this.callback = callback;
50-
Leanplum.countAggregator().incrementCount("init_with_callback");
5150
}
5251

5352
public void run() { this.onResponse(callback);

AndroidSDKCore/src/main/java/com/leanplum/internal/APIConfig.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public void setAppId(String appId, String accessKey) {
5555
if (!TextUtils.isEmpty(accessKey)) {
5656
this.accessKey = accessKey.trim();
5757
}
58-
Leanplum.countAggregator().incrementCount("set_app_id");
5958
}
6059

6160
public void loadToken(String token) {
@@ -92,7 +91,6 @@ public String token() {
9291

9392
public void setToken(String token) {
9493
this.token = token;
95-
Leanplum.countAggregator().incrementCount("set_token");
9694
}
9795

9896
public void loadToken() {
@@ -104,7 +102,6 @@ public void loadToken() {
104102
return;
105103
}
106104
setToken(token);
107-
Leanplum.countAggregator().incrementCount("load_token");
108105
}
109106

110107
public void saveToken() {

AndroidSDKCore/src/main/java/com/leanplum/internal/ActionArg.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ private static <T> ActionArg<T> argNamed(String name, T defaultValue, String kin
4747
arg.name = name;
4848
arg.kind = kind;
4949
arg.defaultValue = defaultValue;
50-
Leanplum.countAggregator().incrementCount("arg_named");
5150
return arg;
5251
}
5352

AndroidSDKCore/src/main/java/com/leanplum/internal/ActionManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ public void recordMessageTrigger(String messageId) {
450450
int occurrences = getMessageTriggerOccurrences(messageId);
451451
occurrences++;
452452
saveMessageTriggerOccurrences(occurrences, messageId);
453-
Leanplum.countAggregator().incrementCount("record_message_trigger");
454453
}
455454

456455
/**

AndroidSDKCore/src/main/java/com/leanplum/internal/CountAggregator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
import java.util.Map;
99
import java.util.Set;
1010

11+
/**
12+
* Counter is not currently used and will be removed in the future.
13+
* It is still functional both on client and server side.
14+
*/
1115
public class CountAggregator {
1216
private Set<String> enabledCounters = new HashSet<>();
1317
private final Map<String, Integer> counts = new HashMap<>();

AndroidSDKCore/src/main/java/com/leanplum/internal/FeatureFlagManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public void setEnabledFeatureFlags(Set<String> enabledFeatureFlags) {
2424
}
2525

2626
public Boolean isFeatureFlagEnabled(String featureFlagName) {
27-
Leanplum.countAggregator().incrementCount("is_feature_flag_enabled");
2827
return this.enabledFeatureFlags.contains(featureFlagName);
2928
}
3029
}

AndroidSDKCore/src/main/java/com/leanplum/internal/FileManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public static DownloadFileResult maybeDownloadFile(boolean isResource, String st
117117
}
118118
}
119119
}
120-
Leanplum.countAggregator().incrementCount("maybe_download_file");
121120
return DownloadFileResult.NONE;
122121
}
123122

0 commit comments

Comments
 (0)