Граф коммитов

69 Коммитов

Автор SHA1 Сообщение Дата
larvacea c81d46aae2 Offline storage using Android Room
Use the androidx Room package for offline storage. This is a drop-in replacement
for the OfflineStorage_SQLite implementation. This includes unit tests (used as
pinning tests) for the three implementations of IOfflineStorage. Using androidx
Room reduces file size for AAR and APK files.
2020-06-02 17:41:12 -07:00
larvacea e7ebf9b9b8 Build and run C++ and Java unit tests for Android 2020-05-04 17:28:33 -07:00
kindbe b117357e9f Propagating a couple of test infra tweaks from Office to github (#300)
Co-authored-by: David Brown (XBOX) <dabrow@microsoft.com>
2020-03-25 13:36:02 -07:00
kindbe 1c3b666c5d Fixes for clang -Werror reorder and overloaded-virtual (#265) 2020-01-31 14:28:33 -08:00
David Brown 6797bac81d Add functests to CI validation 2019-10-24 10:34:42 -07:00
Max Golovanov 9ce0fce6a4 Make debug logging for HTTPS server unit test more consistent
Stylistic non-functional clean-up
2019-10-09 10:00:34 -07:00
Max Golovanov b74366268c Fix HTTP server unit test on Mac 2019-10-09 01:36:55 -07:00
Max Golovanov f5639c51cd Unit tests fix for all platforms, clean-up test scripts 2019-09-29 17:55:27 -07:00
Max Golovanov 5e1b8c5c99 Fix build break on gcc 2019-09-29 17:32:04 -07:00
Max Golovanov 1e7086ebd1 Add more tests for Mac and implement HTTP server for Mac using kqueue 2019-09-29 17:17:51 -07:00
Max Golovanov 239f11b83f Working implementation of HTTP stack notifications passed to app, with sample app 2019-09-26 01:39:56 -07:00
Trevor Lacey ce624cce52 Custom WorkerThread (#68)
* Initial change + http tests

* Plumb worker thread instance

* Fix whitespace

* Fix mac/linux

* Add unit tests

* C API should follow "worker thread" naming

* Address nit comments

* Fix UT build

* Move http client and worker thread to IModule

* Rename to task dispatcher

* shared_ptr IModules

* Address nit CR feedback

* Fix UtcTelemetrySystem initialization

* Update submodule
2019-09-09 12:57:20 -07:00
Max Golovanov 5e60108115 Add API for setting ext.app.name Part A field. Make sure that if ext.app.name is not set, the value of ext.app.id is populated in ext.app.name -> AppInfo.Id legacy transform in Aria pipeline. This is needed to upgrade legacy SDK customers to 1DS. 2019-04-30 15:01:45 -07:00
Miguel Casillas 0ae8aa30ed Clean-up build to use MAT SDK alias 2019-04-15 13:46:30 -07:00
Max Golovanov fda182f66e Addressing code review comments and suggestions 2019-04-01 13:34:51 -07:00
Max Golovanov b9bd9b5119 Merge branch 'onesdk' of https://msasg.visualstudio.com/DefaultCollection/Shared%20Data/_git/Aria.SDK.Cpp into maxgolov/onesdk/1035555_github_cleanup 2019-03-29 11:57:27 -07:00
Max Golovanov 3ef0bd8ca1 GitHub clean-up drafts 2019-03-28 16:40:31 -07:00
Max Golovanov 1ad6a0233d Merged PR 974444: Keep reference to ILogConfiguration rather than doing deep-copy.
* Keep reference to ILogConfiguration rather than doing deep-copy.
* If stats timer has already scheduled, re-check the timer again when it's the time to send.
* Adjust the tests to account for the fact that RuntimeConfig object now requires a ref to ILogConfiguration.
* Remove dynamic_cast
* Re-enable stats acquiring common Part A props (device id,etc.) but not the custom Part C contexts
* Make sure the ILogger detached from parent LogManager context can still acquire common Part A props

Related work items: #1696789
2019-03-22 18:30:48 +00:00
Brandon Busby c61fed4a2b Merged PR 960376: Adding a SAL annotation so that any automated tools looking at the "int recv(void* buffer, unsigned size)" function definition know that size is the capacity of buffer.
Adding a SAL annotation so that any automated tools looking at the "int recv(void* buffer, unsigned size)" function definition know that size is the capacity of buffer.
2019-03-15 20:28:39 +00:00
Max Golovanov bfc3bc45ec Merged PR 883086: Lightweight SDK for embedding in installer packages
Reducing / disabling non-essential features and setting various build flags to optimize for small size.
x5 times size reduction.

Functional changes to common core SDK:
* Had to rename IStorage to IDataStorage, as IStorage is a macro defined in Windows SDK.
* Had to refactor user analytics feature storage (SDK UUID / install id) to utilize plain text file rather than FIFO ..
FIFO storage is a legacy structure, bloatware, had to be deprecated and removed going forward anyways.
It wasn't even present in v1 Aria SDK, but somehow slipped thru into v3..

Features excluded from lightweight SDK:
* JSON
* ZLIB
* ECS client
* SQLite DB (only ram queue, no offline storage)
* Transmit Profiles

Related work items: #1550785
2019-03-08 05:24:15 +00:00
Miguel Angel Casillas Maldonado 306a8257be Merged PR 940316: KillSwitch tests
Added FunctTests to check KillSwitch feature:

- killSwitchWorks checks that a token is banned and events are dropped
- killIsTemporary checks that a token is banned for an amount of time and no events are dropped after that

Related work items: #1608758
2019-03-05 19:56:07 +00:00
Max Golovanov f132bd1c36 Merged PR 935910: Kill switch feature, proper offline storage trim logic and tests
Kill-switch feature:
* collector may decide to kill all events associated with a token
* basic functional test(s) for the feature

Offline storage clean-up:
* if device experiences connectivity issues, then its offline storage may grow too big.
* DB may also contain old records from v1 that we are not processing. Delete those.

Related work items: #1403105, #1403106, #1445871, #1608757
2019-02-26 00:00:36 +00:00
Miguel Angel Casillas Maldonado 07ef4d24eb Merged PR 904184: Start building functional and unit tests for clang on Windows and Mac
Start building functional and unit tests for clang on Windows and Mac

Related work items: #1548039, #1548040
2019-02-01 09:08:09 +00:00
Max Golovanov c99f64fe61 Merged PR 865786: Implementation of M365a Commercial Id (Enrolled Tenant Id) field
Implementation of M365a Commercial Id (Enrolled Tenant Id) field:
* new bond schema definition
* reading reg key at SDK initialization on Win32 Desktop only (value is empty on Win 10 UWP and Mac OS X)
* other platforms may manually populate the field value using semantic context API

Verified manually:
* reg key show in Aria event inspector matches the reg key on my machine.
* the value is not populated if reg key is missing.
* semantic context can be used to override the value.

Related work items: #1292874
2018-12-11 19:45:52 +00:00
Matt Koscumb 741b55c7c0 Rather than return a raw pointer std::vector<StorageRecord>, thus inducing memory managment on the caller and breaking the raw-pointers-are-non-owning rule, IOfflineStorgage::GetRecords should just return the vector. std::vector<T> is cheap to move, and thus can easily be returned from a function on any modern compiler without inducing a massive copy cost. 2018-11-09 16:25:02 -08:00
Matt Koscumb 65fbd69976 Fix all non-OSS pass-by-value OACR errors that should be pass-by-const-ref 2018-10-17 14:20:32 -07:00
Matt Koscumb 429a70c35c Googletest's macros don't play nice with some compiler warnings. 2018-10-17 10:59:32 -07:00
Max Golovanov eb551cbf57 Merged PR 799323: Stats improvements, tests + fixes for recent OTEL issues discovered in dogfood
Fixes:
* implement HTTP stack passing of request body to callback for DDV tool
* add Microsoft googletest nupkg to enable visualization of test results in Visual Studio
* fix stats and stats session IDs
* MS Edge: fix telemetry not working if RO context is already inited
* Fix SetType API not working that breaks ODIN annotation processor
* BVT test fixes

Related work items: #1403111, #1403119, #1459042
2018-10-16 05:01:28 +00:00
Matt Koscumb 1ea5d8653e Use SAL notation to indicate the capacity parameter. 2018-10-11 10:51:49 -07:00
Max Golovanov 7de57751ed Merged PR 771012: FlushAndTeardown behaviour fixes
* address an issue with FlushAndTeardown taking too long: check for DB record count and pending uploads
* address an issue with possible duplication on shutdown (in-flight records successfully uploaded have not been unmarked)
* make API test with respect to logging and upload more strict
* remove Mincore.lib from the build, use Version.lib instead (needed for Win 7 compat)
* downgrade several printouts from INFO to TRACE to reduce the noise at INFO level
* send ram records first and respect their latency: critical goes to in-flight first prior to normal
* respect the "wantMore" flag. We were getting a situation where some records were "stuck" in marked state without being uploaded if these didn't fit into HTTP request

Related work items: #1400900
2018-09-18 00:38:25 +00:00
Max Golovanov 854c433dc2 Revert "Fixes for FlushAndTeardown behavior:"
This reverts commit 7c38f45ef2.
2018-09-14 17:04:14 -07:00
Max Golovanov 7c38f45ef2 Fixes for FlushAndTeardown behavior:
* must respect DB record count rather than DB size (issue reported by Walter)
* ensure that while we have pending requests - we wait for request completion before canceling them on timeout
* fix for duplicate events saved to disk on shutdown
* records were indefinitely marked as 'reserved' (in-flight) until shutdown in case if ram queue grows larger than max. HTTP request size
* respect latency (priority) of in-ram records: push critical events first prior to pushing lower pri
* push ram first: Why? Because if we have too much in ram, and try to push disk first, in a stress ram goes to disk, we churn extra cycles by going to write and read from disk
* push ram first and in a separate HTTP request: another reason is that when consumer for in-ram records is full, we have no API to indicate that further disk-read shouldn't be done..
So we push ram and disk in a separate request, as it was done in v1. There's no overhead since we use persistent keep-alive connection, reusing SSL socket.
2018-09-14 16:50:33 -07:00
Matt Koscumb 0dc15480e0 Build break fixes in Devmain 2018-09-11 11:55:39 -07:00
Max Golovanov e06cca7b44 Fix building unit and functional tests from command line 2018-09-04 10:24:51 -07:00
Max Golovanov 182347d4b9 Fix functional and unit tests 2018-08-31 18:01:32 -07:00
Max Golovanov 387c6c43ed Mock must implemented default configuration 2018-08-31 01:00:31 -07:00
Max Golovanov 37ea3109d7 Fix HttpServer test error that happens with vs2017 compiler but wasn't happening with vs2015 2018-08-29 17:15:25 -07:00
Max Golovanov 47b0381702 - proper handling of offline storage path passed down via configuration
- implementation of Flush method - to move records from in-ram sqlite to on-disk sqlite db
- ability to forward debug callbacks to outside shim (needed for templated LogManager impl). No API changes, but internal impl!
- DebugSource.cpp : forward events to outside shim located at LogManager impl templated surface
- RuntimeConfig_Default.hpp : no longer need to set the path here, as it's done in LogManagerImpl
- ESCConfigCache.cpp : format changes and moved GetAppLocalTempDirectory to MAT as common cross-plat routine
- HttpResponseDecoder.cpp : temporary debug-only change to catch references to deallocated ptrs and assert on that
- IOfflineStorage.hpp : add Flush method (move ram to disk) and a callback for records saved to disk
- DebugEvents.hpp : proxy-forward callbacks to another "cascaded" listener
- ILogManager.hpp : AttachEventSource / DetachEventSource - attach "cascaded" proxy source (as there could be many templ ref to one instance)
- LogManagerBase.hpp : save primary tenant token back to configuration and attach "local" Debug event source proxy on a template
- NullObjects.hpp : add stubs to NULL-object pattern implementation
- Variant.hpp / VariantType.hpp : add draft implementation of thread-safe variants and fix vs201x memory corruption in destructor
- ISqlite3Proxy.hpp : expose v3 close method
- OfflineStorage_SQLite.cpp : move lock to outside of m_db check (race condition fix)
- OfflineStorageHandler.cpp : implementation of async flush copy from ram to disk + callback for records saved to disk
- Move local temp dir detection from UTC helpers to common MAT code
- Statistics.cpp : fix stats record decoration
- TelemetrySystem.cpp : reenable stats and move storage stop after telemetry system stop (otherwise there is a race condition)
- TPM : proper atomic check for uploads scheduled
- Added couple common utils from v1 codebase
2018-05-14 10:32:05 -07:00
Max Golovanov 947ad01eab Fixed unit tests build break 2018-04-20 16:45:45 -07:00
Max Golovanov 14fcd476a7 Reinstate ILogController and associated permission checks.
Provide an example of how to use LogManager singleton in Guest mode (guest.cpp)
Rename EVTStatus to SDK name-neutral status_t as described in design doc.
2018-04-19 14:03:47 -07:00
Max Golovanov 09dc3caa24 Mac OS X C++ SDK build fixes 2018-04-17 13:49:57 -07:00
Max Golovanov dedfb11382 Fixing unit tests` 2018-04-13 13:25:33 -07:00
Max Golovanov 04b3db4135 2nd round of Unit and Functional test fixes after refactor; plus add mocks for System 2018-04-06 18:17:59 -07:00
Max Golovanov da431306b1 Fixing Win 10 native, Win 10 C# and .NET SDKs; plus Functional Tests. 2018-04-05 13:58:33 -07:00
Max Golovanov d46f98350c Drafts for v3 2018-03-30 17:05:05 -07:00
sanjayga 99adc8cc0f Fixed tests 2018-02-07 12:20:41 -08:00
sanjayga 8f5d211f99 Added Simple interface
fixed stats to be the same as ObjC
added per tenant stats
2018-01-10 16:06:39 -08:00
sanjayga 022572cb47 Changes names to Events SDK 2017-12-14 14:02:04 -08:00
sanjayga b873cfc432 Dave recommended changes on std strings 2017-12-08 15:20:19 -08:00
sanjayga fa823ebcfd New interface for LogController and Moved tickets to its own interface 2017-12-06 20:57:51 -08:00