You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some clarifications needed on TransmitProfile and EventPriority #914
Can we set the transmit profile to the LogManager multiple times? Eg: Set different transmit profile based on the network strength
What priority events will be skipped for NearRealTime and BestEffort transmit profiles? It was mentioned in the documentation that “Low priority events will not be transmitted, except for the RealTime transmit profile, unless it will not incur additional cost to the client application in terms of resource consumption, which mostly means when the device is on plug-in power and on a non-metered network”
ODWEventPriorityUnspecified -> This is the default event priority being used. In what cases events will be skipped with this priority?
What's the order of the event priorities for being skipped?
We would want to specify custom TransmitProfile instead of the default ones provided by the SDK. As per the below documentation, we need to set the timer value seconds for the associated event priorities. We would want to control these values through ECS settings.
Is there any recommendation on the range of the timer values that can be set?
The timer definitions for NearRealTime and BestEffort can be found in lib/tmp/TransmitProfiles.cpp starting on line 373. If I'm reading them correctly, in both cases they are skipping EventLatency_Normal and EventLatency_CostDeferred events on metered networks.
In the case of ODWEventPriorityUnspecified, it is using the default value for the underlying native EventProperties object, which is EventLatency_Normal.
"Priority" is overloaded to mean both upload latency and storage retention. Per custom-transmit-profile.md, the first digit of the profile controls EventLatency_Normal and EventLatency_CostDeferred, the second digit is not used (but should be set to the same value as the first digit), and the final digit controls the EventLatency_Realtime upload cadence.
The obj-c wrapper doesn't provide a way to set a custom transmit profile; I'd recommend logging an issue (or submitting a PR). I don't know if there are formal recommendations, but I can share that we use a five minute upload cadence, and block upload for Normal/CostDeferred events on metered networks. We've tried to minimize cost to consumers both in terms of bandwidth costs and battery drain via network wakeups. In terms of testing data loss, I don't know if evt_stats captures how many events are skipped, but that might be one way. Another might be adding your own sequence number and looking for gaps.
Can we switch from custom transmit profile to built-in transmit profile and vice versa at any point in the applifecycle?
In Android, we use only these 2 event latencies as per this logic: EventLatency.RealTime (for High, Immediate Priority), EventLatency.Normal (for Low, Normal Priority) i.e we do not use EventLatency.CostDeferred at all. Do we need to set the 2nd value of timer equal to the first one as per this wiki? Because as per timer definitions of built-in NearRealTime here in code, the timer values of first and second are different. We want to initially replicate exactly the built-in NearRealTime profile and want to experiment changing the timer value via ECS.
What happens to the events where timer is set to -1 (e.g EventLatency.Normal in metered condition), will they be stored in-memory/cache and be uploaded once the conditions are better?
Can we expect any gains in terms of perf/power/COGS by increasing the timer value in custom profile (e.g from 3 seconds for built-in NearRealTime profile in Unmetered charging to some other value say 5 or 10 seconds)?
Even as per debug logs, we are seeing that the timer values are matching to that mentioned here in code. Can we get a confirmation on what should be the ideal JSON for built-in NearRealTime transmit profile i.e if we should follow as per wiki or the code?
Surya Namavaram (@suryatn) - I can reply to a few of your queries. Others on the issue can pitch in for other queries or correct me, else I will reply to the rest tomorrow after validating the code. Would also like to hear the result of Surya's experiments.
Yes, you should be able to switch across different transmit profiles ( custom or default ) in between the app processing.
Events are not lost or dropped as long as they don't cross the configured memory/DB limit. They are stored, and transmitted once the network condition, battery condition, or transmit profile is changed.
Yes, theoretically you should see a gain in perf/power with an increase in the time between uploads, best would be to profile the application against different values to see the result.
So to achieve the near-realtime transmissions, the first two values shouldn't be equal, and the second value is ignored in code ( other than in the above comparison ). I would stick to the values in the code for near-real-time transmission.
Else. If the first timer value is negative, it would be the real-time transmission.
What would happen in case of Roaming rule where all the timers are [-1, -1, -1] (ref)? I am assuming even the EventLatency_RealTime events will not be sent over wire as its timer value is -1.
Else transmission latency alternates between normal and real time.
Does it mean that if the first and second timers are > 0 (ref), sometimes EventLatency_RealTime events get sent over wire and other time EventLatency_Normal events get sent and it alternates between the two? also when does it alternate?
Checked with Martin Harriman (@larvacea). As per him the values mentioned in code and the format suggested in wiki should both work fine for NearRealTime transmissions. He can provide more details / context here.
Activity
kindbe commentedon Aug 17, 2021
https://github.com/microsoft/cpp_client_telemetry/blob/master/docs/custom-transmit-profile.md has some more details about decoding the transmit profiles. Others on the issue, please jump in and correct any of the below if I'm wrong:
suryatn commentedon Sep 23, 2021
David Brown (@kindbe) Max Golovanov (@maxgolov) Lalit Kumar Bhasin (@lalitb) Martin Harriman (@larvacea) Sid Dahiya (@sid-dahiya) Matthew Koscumb (@mkoscumb) - we have below follow up queries regarding custom transmit profile:
Please help in clarifying these queries as we want to start experimenting with custom transmit profiles in Teams Android.
cc aamittal1989 Nishchith C P (@nishchith-cp)
lalitb commentedon Sep 24, 2021
Surya Namavaram (@suryatn) - I can reply to a few of your queries. Others on the issue can pitch in for other queries or correct me, else I will reply to the rest tomorrow after validating the code. Would also like to hear the result of Surya's experiments.
lalitb commentedon Sep 24, 2021
Surya Namavaram (@suryatn), regarding 2 and 5 queries as per the code below:
cpp_client_telemetry/lib/tpm/TransmissionPolicyManager.cpp
Lines 358 to 378 in 0fa60bb
So to achieve the near-realtime transmissions, the first two values shouldn't be equal, and the second value is ignored in code ( other than in the above comparison ). I would stick to the values in the code for near-real-time transmission.
Tagging Martin Harriman (@larvacea) as the author of the wiki doc, if he has other/more recommedations.
suryatn commentedon Sep 25, 2021
Thanks Lalit Kumar Bhasin (@lalitb). We will stick to the values mentioned in the code for NearRealTime transmission for now.
Can you also help explain the below:
What would happen in case of Roaming rule where all the timers are [-1, -1, -1] (ref)? I am assuming even the EventLatency_RealTime events will not be sent over wire as its timer value is -1.
Does it mean that if the first and second timers are > 0 (ref), sometimes EventLatency_RealTime events get sent over wire and other time EventLatency_Normal events get sent and it alternates between the two? also when does it alternate?
Martin Harriman (@larvacea) can you also please check once and provide your inputs? Tagging Max Golovanov (@maxgolov) incase you have some suggestions as well.
suryatn commentedon Sep 29, 2021
Checked with Martin Harriman (@larvacea). As per him the values mentioned in code and the format suggested in wiki should both work fine for NearRealTime transmissions. He can provide more details / context here.