Comments (4)
I disagree with this proposal. It is convenient and generally suitable for a timepoint to be represented in a simple type, such as uint64_t inside the SDK. This is not something that is exposed on API surface to the customer.
from cpp_client_telemetry.
How is using a std::chrono type inconvenient?
Not only does it prevent mistakes from assumptions around the period of the data (does the uint64_t represent seconds? milliseconds? nanoseconds? 100ns (like ETW)?), it allows does the time related math for you (e.g. no manually multiplying by 1000 to go from seconds to milliseconds) as well as the useful helpers of:
time_point + duration = time_point;
duration + duration = duration; (check out std::chrono::duration_cast, it's super neato)
time_point - time_point = duration;
All this is done in a type-safe manner, and will produce errors at compile time (rather than run-time) if a conversion cannot be performed. We should not let developer convenience trump correctness, and prevent an easy class of bugs all-together by leveraging the type system.
Addendum: The Mars Climate Orbiter's crash is the best example of why we should take advantage of the type-system to prevent bugs.
from cpp_client_telemetry.
Thanks for bringing this up @mkoscumb, good topic!
For interface (e.g. exposed APIs, data types, schema), we should follow something like ISO 8601, we should not expose implementation detail (e.g. types that are specific to OS, runtime or language) via the interface unless we have a good control of the ABI.
For implementation (e.g. the internal data exchange within the SDK), having a consistent data format is great, as long as the data format we choose meets with the following criteria:
- It is widely adopted and is considered the de facto standard.
- It has a good performance, and works across the targeted platforms/runtimes.
- It is language idiomatic.
from cpp_client_telemetry.
@mkoscumb - this one appears to be stale. Do you have some thoughts on further improvements or can we close it?
from cpp_client_telemetry.
Related Issues (20)
- Timeline to deprecate Bond serializer HOT 5
- Pause Manager causes events not being uploaded on FlushAndTeardown
- PrivacyGuard: `StampEventIKeyForConcerns` was not added to iOS SDK
- Very large timeout when sending event HOT 3
- libmaesdk.so SIGABRT on HttpClient_Android::SendRequestAsync()
- Expose setTicketToken() for Java for Android apps to set AAD(other tokens)
- Make non-static LogManager class accessible through WinRT
- Crash in SetTransmitProfile HOT 1
- Memory Leak in initializing database HOT 3
- How to compile the SDK with CS 4.0 in Android in command line? HOT 2
- Linker errors on macOS sample project HOT 1
- How is the value for DeviceInfo_Id getting populated by the 1DS sdk? HOT 1
- No separation between sent and sending events HOT 1
- Multi-process support for Android HOT 1
- Crash during Upload on OfflineStorageSQLite HOT 1
- Change CFG_STR_COLLECTOR_URL after initializing HOT 4
- How to set cV, ingest PartA extension, user#authId through SDK? HOT 6
- Consecutive event loss with log "Maximum number of HTTP requests reached" HOT 1
- FlushAndTeardown is insufficient to save data to disk
- Unable to determine when all events have been uploaded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp_client_telemetry.