Skip to content

Commit 4a68b7c

Browse files
authored
Merge pull request #489 from Countly/hc_metric_extend
Hc metric extend
2 parents e831d00 + 83f58cb commit 4a68b7c

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
## XX.XX.XX
2+
3+
* Health check requests now include additional metrics.
4+
25
* Mitigated an issue where behavior settings were not stored when only provided through configuration during initialization.
36
* Mitigated an issue where, on the first run of the SDK, behavior settings returned null if none were previously stored.
47
* Mitigated an issue where first behavior settings update calls sent twice.
58

9+
610
## 25.4.2
711
* Mitigated an issue where latest fetched behavior settings were replacing the current settings instead of merging.
812

sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -674,32 +674,6 @@ String getMetrics(@NonNull final Context context, @Nullable final Map<String, St
674674
return result;
675675
}
676676

677-
@NonNull
678-
String getMetricsHealthCheck(@NonNull final Context context, @Nullable final Map<String, String> metricOverride) {
679-
Map<String, Object> metrics = new ConcurrentHashMap<>();
680-
681-
String appVersion = mp.getAppVersion(context);
682-
683-
if (metricOverride != null) {
684-
if (metricOverride.containsKey("_app_version")) {
685-
appVersion = metricOverride.get("_app_version");
686-
}
687-
}
688-
689-
metrics.put("_app_version", appVersion);
690-
691-
String result = new JSONObject(metrics).toString();
692-
693-
try {
694-
result = java.net.URLEncoder.encode(result, "UTF-8");
695-
} catch (UnsupportedEncodingException ex) {
696-
// should never happen because Android guarantees UTF-8 support
697-
Countly.sharedInstance().L.e("[getMetrics] encode failed, [" + ex + "]");
698-
}
699-
700-
return result;
701-
}
702-
703677
/**
704678
* Returns a JSON object containing the device crash report
705679
*/

sdk/src/main/java/ly/count/android/sdk/ModuleHealthCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void sendHealthCheck() {
6262

6363
healthCheckSent = true;
6464

65-
String preparedMetrics = deviceInfo.getMetricsHealthCheck(_cly.context_, _cly.config_.metricOverride);
65+
String preparedMetrics = deviceInfo.getMetrics(_cly.context_, _cly.config_.metricOverride, L);
6666

6767
StringBuilder requestData = new StringBuilder(requestQueueProvider.prepareHealthCheckRequest(preparedMetrics));
6868
ConnectionProcessor cp = requestQueueProvider.createConnectionProcessor();

0 commit comments

Comments
 (0)