Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 24.4.0 #266

Merged
merged 208 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
175799a
refactor: remove useless paranthesis
arifBurakDemiray Feb 20, 2024
3e3c4bb
Update CountlyTests.java
arifBurakDemiray Feb 20, 2024
2269dff
Update ModuleRemoteConfigTests.java
arifBurakDemiray Feb 20, 2024
11d3cf7
refactor: delete useless parantheses
arifBurakDemiray Feb 20, 2024
5905886
Merge pull request #220 from Countly/codacy_uselessparanthesis
ArtursKadikis Feb 21, 2024
4ecdace
Merge pull request #221 from Countly/codacy_up2
ArtursKadikis Feb 21, 2024
9a73a51
Update ModuleAPMTests.java
arifBurakDemiray Feb 22, 2024
b1768cf
Update proguard-rules.pro
arifBurakDemiray Feb 22, 2024
694829b
Merge pull request #223 from Countly/arifBurakDemiray-patch-1
ArtursKadikis Feb 22, 2024
cca0dd9
Merge pull request #224 from Countly/arifBurakDemiray-patch-2
ArtursKadikis Feb 28, 2024
05ac7bf
Update codeql-analysis.yml
arifBurakDemiray Feb 28, 2024
0e8db8d
Merge pull request #225 from Countly/arifBurakDemiray-patch-1
ArtursKadikis Feb 28, 2024
d63c923
doc: fix deprecation messages
arifBurakDemiray Mar 4, 2024
e9f0a8f
Merge pull request #226 from Countly/update_deprecatemsg
ArtursKadikis Mar 4, 2024
5fcd0ea
refactor
ArtursKadikis Mar 4, 2024
715ce1f
Merge branch 'staging' of https://github.com/Countly/countly-sdk-andr…
ArtursKadikis Mar 4, 2024
44308d0
refactor: upload scripty
arifBurakDemiray Mar 8, 2024
26f3d4b
feat: crash filter
arifBurakDemiray Mar 8, 2024
e4d605a
feat: config crashes
arifBurakDemiray Mar 8, 2024
f54f57c
feat: changelog
arifBurakDemiray Mar 8, 2024
135b1cd
feat: add default
arifBurakDemiray Mar 8, 2024
5d9ace6
feat: impl of change flag
arifBurakDemiray Mar 8, 2024
941f6ba
feat: add comments
arifBurakDemiray Mar 8, 2024
a09a3ce
feat: add some logging
arifBurakDemiray Mar 12, 2024
fb405b3
feat: rename some configs
arifBurakDemiray Mar 12, 2024
0e02a56
feat: breadcrumbs as list
arifBurakDemiray Mar 12, 2024
b63742b
feat: bring legacy code to work
arifBurakDemiray Mar 12, 2024
e5071ee
feat: add missing params
arifBurakDemiray Mar 12, 2024
4a98c61
feat: add missing changelog
arifBurakDemiray Mar 12, 2024
a8f6e61
fix: missing params
arifBurakDemiray Mar 12, 2024
5135e07
feat: deprecate check for native crash dumps
arifBurakDemiray Mar 12, 2024
dd9fdc4
feat: change bits for crash data
arifBurakDemiray Mar 12, 2024
2452142
feat: add filters
arifBurakDemiray Mar 12, 2024
272693d
feat: crash metrics
arifBurakDemiray Mar 12, 2024
c7a3512
feat: revert crash filter
arifBurakDemiray Mar 12, 2024
d396ecd
feat: add protection for json obj
arifBurakDemiray Mar 12, 2024
6ba3c00
feat: add tests
arifBurakDemiray Mar 12, 2024
fca19ff
feat: more tests
arifBurakDemiray Mar 12, 2024
4153c8e
feat: add loggig
arifBurakDemiray Mar 12, 2024
b1f88e6
feat: sdk internal limits config
arifBurakDemiray Mar 13, 2024
af475c3
feat: further comments
arifBurakDemiray Mar 13, 2024
8f88797
Merge pull request #230 from Countly/internallimits
ArtursKadikis Mar 13, 2024
3f8c2dc
Merge pull request #227 from Countly/refactor_uploadscrpt
ArtursKadikis Mar 13, 2024
5ca52f3
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 14, 2024
57d66c3
fix: after merge
arifBurakDemiray Mar 14, 2024
f2e7d0f
More session tests
ArtursKadikis Mar 14, 2024
9f824e0
Merge branch 'staging' of https://github.com/Countly/countly-sdk-andr…
ArtursKadikis Mar 14, 2024
d2c8a68
Refactoring benchmark app, capturing additional perf counters in case…
ArtursKadikis Mar 14, 2024
4c2c7c8
Some more benchmark app refactoring
ArtursKadikis Mar 14, 2024
a693ad1
Renaming "eventData" to "requestData"
ArtursKadikis Mar 14, 2024
c5aa5b1
Enabling multidex in the SDk
ArtursKadikis Mar 14, 2024
dbe92f0
"connection" -> "request"
ArtursKadikis Mar 14, 2024
8917d2a
"Collection" -> "list". Removing unused "join"
ArtursKadikis Mar 14, 2024
4efc061
Renaming funciton. Adding more counters. Reordering of checks.
ArtursKadikis Mar 15, 2024
df520bd
feat: utils internal limits
arifBurakDemiray Mar 19, 2024
4370692
feat: new test utils func and tests
arifBurakDemiray Mar 19, 2024
c1a0080
feat: crash config refactoring
arifBurakDemiray Mar 19, 2024
5a333f0
feat: add changelog
arifBurakDemiray Mar 19, 2024
cfddfe8
feat: introduce crash data obj
arifBurakDemiray Mar 19, 2024
4106022
feat: update getContext
arifBurakDemiray Mar 19, 2024
056f33e
feat: update getContext 2
arifBurakDemiray Mar 19, 2024
594fca8
refactor change test context 2
arifBurakDemiray Mar 19, 2024
6ea6eae
feat: add two more tweak funcs
arifBurakDemiray Mar 19, 2024
7f90b05
Update CHANGELOG.md
arifBurakDemiray Mar 19, 2024
14080b5
Update CHANGELOG.md
ArtursKadikis Mar 19, 2024
9083375
Merge pull request #234 from Countly/crash_config
ArtursKadikis Mar 19, 2024
9b6b497
Merge pull request #237 from Countly/test_context_2
ArtursKadikis Mar 19, 2024
91e3e39
Merge pull request #236 from Countly/test_context
ArtursKadikis Mar 19, 2024
730fbd6
Update CrashData.java
arifBurakDemiray Mar 19, 2024
5f4cf65
refactor: use sha
arifBurakDemiray Mar 19, 2024
7952689
Merge branch 'crash_data' of https://github.com/Countly/countly-sdk-a…
arifBurakDemiray Mar 19, 2024
119c974
Merge branch 'staging' into test_utils
ArtursKadikis Mar 19, 2024
9336e33
Update TestUtils.java
ArtursKadikis Mar 19, 2024
74f1069
Merge pull request #233 from Countly/test_utils
ArtursKadikis Mar 19, 2024
aa69895
Merge pull request #232 from Countly/utils_limits
ArtursKadikis Mar 19, 2024
1d8c1cd
Update CrashData.java
ArtursKadikis Mar 19, 2024
d0c3067
Update CrashData.java
ArtursKadikis Mar 19, 2024
938777d
Merge pull request #235 from Countly/crash_data
ArtursKadikis Mar 19, 2024
a4b8863
Update TestUtilsTests.java
arifBurakDemiray Mar 19, 2024
11c1133
Update TestUtilsTests.java
arifBurakDemiray Mar 19, 2024
75e9cc1
Update TestUtilsTests.java
ArtursKadikis Mar 19, 2024
d187e62
Update TestUtilsTests.java
arifBurakDemiray Mar 19, 2024
21374c8
Merge pull request #238 from Countly/arifBurakDemiray-patch-1
ArtursKadikis Mar 19, 2024
d31b90c
revert: config reorder things
arifBurakDemiray Mar 19, 2024
ea8cb71
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 19, 2024
2e19541
fix: merge errors
arifBurakDemiray Mar 19, 2024
690f1fd
fix: merge conflict
arifBurakDemiray Mar 19, 2024
398ef07
refactor: move truncate segmentation values
arifBurakDemiray Mar 19, 2024
1b1919e
refactor: move fill in segm
arifBurakDemiray Mar 19, 2024
d87bf7f
refactor: move remove reserved keys
arifBurakDemiray Mar 19, 2024
888e5f1
refactor: move remove unsupported data types
arifBurakDemiray Mar 19, 2024
d908548
revert: some changes of auto order
arifBurakDemiray Mar 19, 2024
105f797
refactor: crash request gen and crash metrics
arifBurakDemiray Mar 19, 2024
6c25938
Merge pull request #239 from Countly/move_utils
ArtursKadikis Mar 19, 2024
690687c
feat: test utils get rq test case
arifBurakDemiray Mar 20, 2024
b9ae325
feat: initial breacrumb helper
arifBurakDemiray Mar 21, 2024
296ad31
feat: breacrumb helper tests
arifBurakDemiray Mar 21, 2024
97103c5
Merge pull request #240 from Countly/crash_metrics
ArtursKadikis Mar 22, 2024
d8e4d17
Merge pull request #241 from Countly/testutilsrqtest
ArtursKadikis Mar 22, 2024
fd5d7c2
refactor: remove static accesses to the logs
arifBurakDemiray Mar 22, 2024
4d3ef35
refactor: integrate crash data to the flow
arifBurakDemiray Mar 22, 2024
7635022
refactor: event class to have one segmentation
arifBurakDemiray Mar 22, 2024
cc2d17d
feat: validate event from RQ
arifBurakDemiray Mar 22, 2024
16b50f2
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 25, 2024
2da1cad
fix: merge conflict
arifBurakDemiray Mar 25, 2024
4ce77c8
fix: pr mege
arifBurakDemiray Mar 25, 2024
fad5883
feat: add nonnull nullable annotations
arifBurakDemiray Mar 25, 2024
9981172
refactor: crash data and movement
arifBurakDemiray Mar 25, 2024
29cae2a
feat: add nonnull to class
arifBurakDemiray Mar 25, 2024
78f17e6
Merge pull request #243 from Countly/intcrashd
ArtursKadikis Mar 25, 2024
5399814
Merge pull request #244 from Countly/refactor_eventmap
ArtursKadikis Mar 25, 2024
204d91e
Merge branch 'staging' into breadcrumbref
arifBurakDemiray Mar 25, 2024
e43cd4d
refactor: after merge
arifBurakDemiray Mar 25, 2024
3b078a3
refactor: move it to not static
arifBurakDemiray Mar 25, 2024
2eb5406
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 25, 2024
001b446
feat: integrate crash filtering
arifBurakDemiray Mar 25, 2024
f40d3d6
Adding session limitations and session health check empty calls.
ArtursKadikis Mar 25, 2024
91e6d59
Merge branch 'staging' into session_changes
ArtursKadikis Mar 25, 2024
cbe3109
Merge pull request #245 from Countly/session_changes
ArtursKadikis Mar 25, 2024
9e3c07e
Adding alternative calls. Adding more performance counters in the SDK.
ArtursKadikis Mar 25, 2024
9e4fc59
Adding asserts to the SDK
ArtursKadikis Mar 25, 2024
8479b65
24.1.2-RC1 setup
ArtursKadikis Mar 25, 2024
d28116f
feat: initial asserts
arifBurakDemiray Mar 26, 2024
0788a85
Merge branch 'staging' of https://github.com/Countly/countly-sdk-andr…
ArtursKadikis Mar 26, 2024
feaf765
Adding asserts
ArtursKadikis Mar 26, 2024
bd3e617
Merge pull request #242 from Countly/breadcrumbref
ArtursKadikis Mar 26, 2024
f39baee
Merge branch 'staging' of https://github.com/Countly/countly-sdk-andr…
ArtursKadikis Mar 26, 2024
677e1a8
Renaming utility function. Adding more asserts
ArtursKadikis Mar 26, 2024
70f59ae
Adding time and event related asserts. Removing thrown exceptions for…
ArtursKadikis Mar 26, 2024
0f3f41a
Adding, enabling asserts to UtilsNetworking and CrashData.
ArtursKadikis Mar 26, 2024
7229544
Merge pull request #247 from Countly/asserting
ArtursKadikis Mar 26, 2024
34dcc04
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 27, 2024
d67fdaa
fix: merge conflicst
arifBurakDemiray Mar 27, 2024
35511a8
feat: integrate filtering
arifBurakDemiray Mar 27, 2024
34865a7
feat: param validating
arifBurakDemiray Mar 27, 2024
87411f3
SDK cleanup
ArtursKadikis Mar 27, 2024
44ec8c8
Merge branch 'staging' of https://github.com/Countly/countly-sdk-andr…
ArtursKadikis Mar 27, 2024
c622bef
Merge pull request #248 from Countly/cleanup
ArtursKadikis Mar 27, 2024
4a9fd25
Merge branch 'staging' into crashfiltering
ArtursKadikis Mar 27, 2024
64f53eb
revert: handled to fatal
arifBurakDemiray Mar 27, 2024
6890c92
doc: add comment to indicate checksum indices
arifBurakDemiray Mar 27, 2024
b067a8c
refactor: mainly crash filtering method coverted to CrashData way
arifBurakDemiray Mar 27, 2024
267865f
Update TestUtils.java
arifBurakDemiray Mar 27, 2024
77fe00b
Update ModuleEventsTests.java
arifBurakDemiray Mar 27, 2024
6d35da8
Update ModuleCrashTests.java
arifBurakDemiray Mar 27, 2024
ea743b5
feat: add base param validation
arifBurakDemiray Mar 27, 2024
714dff5
Update CrashData.java
arifBurakDemiray Mar 27, 2024
53294c1
Update CrashDetailsTests.java
arifBurakDemiray Mar 27, 2024
0ddd5ba
Update CrashDataTests.java
arifBurakDemiray Mar 27, 2024
a397ef8
Update ModuleCrashTests.java
arifBurakDemiray Mar 27, 2024
4082f74
refactor: crash data
arifBurakDemiray Mar 27, 2024
c0eb51d
fix: merge
arifBurakDemiray Mar 27, 2024
c79ffb7
fix: merge
arifBurakDemiray Mar 27, 2024
b997c0c
feat: global filter callback test
arifBurakDemiray Mar 27, 2024
17e10b5
feat: validate harder
arifBurakDemiray Mar 27, 2024
032f5f3
feat: try catch json put test util
arifBurakDemiray Mar 27, 2024
8a2c41a
doc: test func comment
arifBurakDemiray Mar 27, 2024
4b907a7
feat: convert to number way
arifBurakDemiray Mar 27, 2024
6cb112d
Update ModuleCrashTests.java
arifBurakDemiray Mar 28, 2024
08edd4e
feat: global crash filter callback null empty
arifBurakDemiray Mar 28, 2024
b659369
Update ModuleCrashTests.java
arifBurakDemiray Mar 28, 2024
e430a7c
Update DeviceInfo.java
arifBurakDemiray Mar 28, 2024
87d088d
feat: dropping with global crash filter test
arifBurakDemiray Mar 28, 2024
3e68b38
feat: deprecated filter and global test case
arifBurakDemiray Mar 28, 2024
885d58e
Merge pull request #251 from Countly/crashdataref
ArtursKadikis Mar 28, 2024
99b8936
Merge branch 'staging' into crashrefactorin
arifBurakDemiray Mar 28, 2024
c1cc579
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 28, 2024
a98f29c
slight refactor, adding asserts
ArtursKadikis Mar 28, 2024
6788b24
Merge pull request #249 from Countly/crashrefactorin
ArtursKadikis Mar 28, 2024
7a1ccd7
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 28, 2024
8d2b68c
fix: metric source and get app
arifBurakDemiray Mar 28, 2024
bedc868
fixing a test
ArtursKadikis Mar 28, 2024
6a31856
Cleaning up
ArtursKadikis Mar 28, 2024
649031c
Merge branch 'staging' of https://github.com/Countly/countly-sdk-andr…
ArtursKadikis Mar 28, 2024
6664a09
fix: bits to ob
arifBurakDemiray Mar 28, 2024
b4aa46d
Moving running time to metric provider. Introducing mocked metric pro…
ArtursKadikis Mar 28, 2024
0b24d13
Merge pull request #250 from Countly/validationutili
ArtursKadikis Mar 28, 2024
7e5365e
Merge branch 'staging' into crashfiltering
arifBurakDemiray Mar 28, 2024
eab5421
fix: after merge
arifBurakDemiray Mar 28, 2024
3b8f7ac
feat: ne wtest cases
arifBurakDemiray Mar 28, 2024
a531897
feat: native crash testing
arifBurakDemiray Mar 29, 2024
35180f8
feat: map string object
arifBurakDemiray Mar 29, 2024
c3c6bbb
feat: map string object
arifBurakDemiray Mar 29, 2024
158b6f2
Merge pull request #253 from Countly/ref_crashdata
arifBurakDemiray Mar 29, 2024
67e061e
fix: serialization issue
arifBurakDemiray Mar 29, 2024
db1119a
Merge pull request #254 from Countly/ref_crashdata
arifBurakDemiray Mar 29, 2024
ce3551b
fix: map error
arifBurakDemiray Mar 29, 2024
ef9dc96
feat: global crash filter change
arifBurakDemiray Mar 29, 2024
4f2b301
fix: native crash test
arifBurakDemiray Mar 29, 2024
56be04d
feat: native crash tests
arifBurakDemiray Mar 29, 2024
098c18c
revert: uncaught handler
arifBurakDemiray Mar 29, 2024
64d2981
refactor: improve tick logs
arifBurakDemiray Apr 1, 2024
1a69f2f
fix: nul checl
arifBurakDemiray Apr 2, 2024
e24f0b5
Adding asserts for the future
ArtursKadikis Apr 2, 2024
05008b0
Merge pull request #258 from Countly/improve_ticklogs
ArtursKadikis Apr 2, 2024
ad3bb23
chore: rename loggings
arifBurakDemiray Apr 2, 2024
69b2b5d
feat: update the SDK version to 24.4.0
arifBurakDemiray Apr 2, 2024
7ea6452
Merge pull request #263 from Countly/prep_for_relsease
ArtursKadikis Apr 2, 2024
7a76c31
Merge pull request #260 from Countly/rename_logs
ArtursKadikis Apr 2, 2024
4feed12
revert: sout
arifBurakDemiray Apr 2, 2024
9ad4190
Merge pull request #252 from Countly/ref_crashdata
ArtursKadikis Apr 2, 2024
b232ff9
Merge pull request #265 from Countly/staging
arifBurakDemiray Apr 2, 2024
c65b46c
feat: collapse if
arifBurakDemiray Apr 2, 2024
35d0bcc
feat: change how it acts before filtering
arifBurakDemiray Apr 2, 2024
06a7541
Simplifying changed field calculation
ArtursKadikis Apr 3, 2024
9bf8ff8
Merge pull request #229 from Countly/crashfiltering
ArtursKadikis Apr 3, 2024
ed0a8a2
24.4.0-RC1 version
ArtursKadikis Apr 3, 2024
0955718
real version
ArtursKadikis Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
3 changes: 3 additions & 0 deletions .idea/inspectionProfiles/Countly.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 24.4.0
* ! Minor breaking change ! If a manual session is already started, it will not be possible to call "BeginSession" without stopping the previous one
* ! Minor breaking change ! If a manual session has not been started, it will not be possible to call "UpdateSession"
* ! Minor breaking change ! If a manual session has not been started, it will not be possible to call "EndSession"
* ! Minor breaking change ! Setting for enabling/disabling for native crash dumps will be always enabled

* Added an extended way of crash filtering
* Added SDK internal limits configuration interface

* Deprecated the following calls from "CountlyConfig":
* "setMaxSegmentationValues(maxSegmentationValues)" instead use "sdkInternalLimits.setMaxSegmentationValues(maxSegmentationValues)"
* "setMaxBreadcrumbCount(maxBreadcrumbCount)" instead use "sdkInternalLimits.setMaxBreadcrumbCount(maxBreadcrumbCount)"
* "setCrashFilterCallback(crashFilterCallback)" instead use "crashes.setGlobalCrashFilterCallback(globalCrashFilterCallback)"
* "enableCrashReporting()" instead use "crashes.enableCrashReporting()"
* "setCustomCrashSegment(crashSegmentation)" instead use "crashes.setCustomCrashSegmentation(crashSegmentation)"
* "setRecordAllThreadsWithCrash()" instead use "crashes.enableRecordAllThreadsWithCrash()"
* "checkForNativeCrashDumps(checkForDumps)", it will be removed in the future, there is no replacement

## 24.1.1
* Added a new metric for detecting whether or not a device has a hinge

Expand Down
17 changes: 9 additions & 8 deletions app-benchmark/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
android:name=".App"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme">
Expand All @@ -20,9 +21,9 @@
android:configChanges="orientation|screenSize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Expand Down
37 changes: 33 additions & 4 deletions app-benchmark/src/main/java/ly/count/android/benchmark/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,54 @@ public class App extends Application {
public void onCreate() {
super.onCreate();

CountlyConfig config = (new CountlyConfig(this, COUNTLY_APP_KEY, COUNTLY_SERVER_URL))
CountlyConfig config = new CountlyConfig(this, COUNTLY_APP_KEY, COUNTLY_SERVER_URL)
.setDeviceId(DEVICE_ID)
.setLoggingEnabled(true)
.giveAllConsents()
.setRequestDropAgeHours(10)//to trigger the age blocks
.setEventQueueSizeToSend(10)//for testing the main use case
.setEventQueueSizeToSend(100)//for testing the main use case
.setParameterTamperingProtectionSalt("test-benchmark-salt");

appPcc = new PerformanceCounterCollector();
config.pcc = appPcc;

Countly.sharedInstance().init(config);

//clear initial state to erase past data
Countly.sharedInstance().requestQueue().flushQueues();

Benchmark.countlyStore = new CountlyStore(this, new ModuleLog());
}

/**
* Benchmark scenario - 1
* EQ size 10
* 5 segm values
* Generate events and not requests: yes
* wait: yes
* EQ threshold: 10
* segm values per event: 5
* Generated request count: value doesn't matter
* Event count: 10000
* Fill to 1000 requests which equals to 10000 events generated
*
* steps:
* 1) turn off internet
* 2) clear counters
* 3) Fill RQ/EQ
* 4) turn on internet
* 5) send requests
* 6) wait till all sent
* 7) print counters
*/

/**
* Scenario 2
* RQ size 1000
* Generate a mix of 1200 requests
* EQ threshold 100
* 4 direct requests : 1 event request
* direct requests - 960
* event requests - 240
* events generated - 24000
* segm values per event: 6
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.concurrent.ConcurrentHashMap;
import ly.count.android.sdk.Countly;
import ly.count.android.sdk.CountlyStore;
import ly.count.android.sdk.UtilsTime;
import org.json.JSONException;

public class Benchmark {
Expand All @@ -15,7 +16,7 @@ protected Benchmark() {
}

public void fillRequestQueue(int rqSize, int eventSize, int segmentSize) {
Countly.sharedInstance().requestQueue().flushQueues();
//Countly.sharedInstance().requestQueue().flushQueues();
print("[Benchmark] fillRequestQueue, Filling request queue, rq is flushed");
for (int i = 0; i < rqSize; i++) {
Map<String, String> additionalParams = null;
Expand All @@ -34,11 +35,47 @@ public void fillRequestQueue(int rqSize, int eventSize, int segmentSize) {
}

public void fillEventQueue(int eventSize, int segmentSize) {
Countly.sharedInstance().requestQueue().flushQueues();
//Countly.sharedInstance().requestQueue().flushQueues();

print("[Benchmark] fillEventQueue, Filling event queue, rq is flushed");
for (int i = 0; i < eventSize; i++) {
long tsStartGen = UtilsTime.getNanoTime();
Object[] randomEvent = benchmarkUtil.generateRandomEventBase(segmentSize);
App.appPcc.TrackCounterTimeNs("Benchmark_genTime", UtilsTime.getNanoTime() - tsStartGen);

long tsStartAction = UtilsTime.getNanoTime();
Countly.sharedInstance().events().recordEvent(randomEvent[0].toString(), (Map<String, Object>) randomEvent[1], (int) randomEvent[2], (double) randomEvent[3], (double) randomEvent[4]);
App.appPcc.TrackCounterTimeNs("Benchmark_recordEventTime", UtilsTime.getNanoTime() - tsStartAction);
}
print("[Benchmark] fillEventQueue, Request queue size: " + countlyStore.getRequests().length);
}

public void GenerateBenchmarkDataset(int eventSize, int segmentSize) {
Countly.sharedInstance().requestQueue().flushQueues();

int eventsPerChunk = 100;
//int eventChunks = eventSize / eventsPerChunk;

int eventsRecorded = 0;

print("[Benchmark] fillEventQueue, Filling event queue, rq is flushed");
while (eventsRecorded < eventSize) {
//larger RQ filler
long tsStartGenDRequests = UtilsTime.getNanoTime();
fillRequestQueue(4, 2, 2);
App.appPcc.TrackCounterTimeNs("Benchmark_recordDirectRequests", UtilsTime.getNanoTime() - tsStartGenDRequests);

//filling it up by individual events
for (int i = 0; i < eventsPerChunk; i++) {
long tsStartGen = UtilsTime.getNanoTime();
Object[] randomEvent = benchmarkUtil.generateRandomEventBase(segmentSize);
App.appPcc.TrackCounterTimeNs("Benchmark_genTime", UtilsTime.getNanoTime() - tsStartGen);

long tsStartAction = UtilsTime.getNanoTime();
Countly.sharedInstance().events().recordEvent(randomEvent[0].toString(), (Map<String, Object>) randomEvent[1], (int) randomEvent[2], (double) randomEvent[3], (double) randomEvent[4]);
App.appPcc.TrackCounterTimeNs("Benchmark_recordEventTime", UtilsTime.getNanoTime() - tsStartAction);
eventsRecorded++;
}
}
print("[Benchmark] fillEventQueue, Request queue size: " + countlyStore.getRequests().length);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import ly.count.android.sdk.RandomUtil;
import ly.count.android.sdk.UtilsTime;
import org.json.JSONArray;
import org.json.JSONException;
Expand All @@ -17,10 +16,6 @@ protected BenchmarkUtil() {
random = new RandomUtil();
}

protected Map<String, String> generateRequest(int eventSize, int segmentSize) throws JSONException {
return generateRequest(eventSize, segmentSize, null);
}

protected Map<String, String> generateRequest(int eventSize, int segmentSize, Map<String, String> additionalParams) throws JSONException {
Map<String, String> request = new ConcurrentHashMap<>();
List<JSONObject> events = new ArrayList<>();
Expand All @@ -43,7 +38,12 @@ protected Map<String, Object> generateSegmentationMap(int segmentSize) {
Map<String, Object> segment = new ConcurrentHashMap<>();

for (int i = 0; i < segmentSize; i++) {
segment.put(random.generateRandomString(8), random.generateRandomObject());
String key = random.generateRandomString(8);

while (segment.containsKey(key)) {
key = random.generateRandomString(8);
}
segment.put(key, random.generateRandomImmutable());
}

return segment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ public void onPrintCounters(View v) {
benchmark.print(res);
}

public void onClearStorage(View v) {
benchmark.print("[MainActivity] Clear Storage");
Countly.sharedInstance().requestQueue().flushQueues();
}

public void onGenerateBenchmarkData(View v) {
benchmark.print("[MainActivity] Generate benchmark data");

readLoopSegmentEventSize();

futureWrapper(() -> benchmark.GenerateBenchmarkDataset(eventSize, segmentSize));

if (getSwitchValue(R.id.wait)) {
futureWrapper(this::standByForOnTimer);
}
}

protected void BENCHMARK(int loop, Runnable runnable) {
benchmark.print("------------------------------------------------------------");
benchmark.print("[MainActivity] BENCHMARK");
Expand All @@ -94,6 +111,9 @@ protected void BENCHMARK(int loop, Runnable runnable) {
long endTime = System.currentTimeMillis();
benchmark.print("[MainActivity] BENCHMARK, SENDING TOOK: " + (endTime - startTime) + "MS");
benchmark.print("------------------------------------------------------------");

String res = App.appPcc.ReturnResults();
benchmark.print(res);
}

private void readLoopSegmentEventSize() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ly.count.android.sdk;
package ly.count.android.benchmark;

import java.util.Random;

Expand Down Expand Up @@ -38,8 +38,10 @@ protected Object generateRandomImmutable() {
value = random.nextBoolean();
break;
case 2:
//todo put back in when there is long support
//value = random.nextLong();
//break;
value = generateRandomImmutable();
break;
case 3:
value = random.nextFloat();
break;
Expand All @@ -55,43 +57,4 @@ protected Object generateRandomImmutable() {

return value;
}

public Object generateRandomObject() {
int randomInt = random.nextInt(8);
Object value;

//to give it a more chance to create a simple object rather than an array
switch (randomInt) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
value = generateRandomImmutable();
break;
//case 7:
// value = generateRandomArray(this::generateRandomImmutable, random.nextInt(10) + 1);
// break;
default:
value = generateRandomObject();
}

return value;
}

protected Object[] generateRandomArray(Supplier valueSupplier, int times) {
Object[] array = new Object[times];

for (int i = 0; i < times; i++) {
array[i] = valueSupplier.get();
}

return array;
}

protected interface Supplier {
Object get();
}
}
Loading
Loading