A few questions relating to events
PinnedOriginally from ticket #743.
Sir or Madam,
I have a few questions about generic and timed events that I don’t recall seeing in your documentation.
1) How do timed events work? When is there server communication? Is the server communication only at the very end of the event transaction? Below are two plausible scenarios as to how we believe the eventing API may work. Could you please clarify?
a. Create new timed event called, GUID generated locally. Timed event closed/finished, server upload happens, or
b. Create new timed event called, Server contacted and notified of event start. Someone generates a GUID (could be server or client). Timed event closed/finished, server upload happens.
2) What happens with orphaned timed events (those events started but not closed or purged). Are they persisted between application instances? Will they eventually build up and impact performance? Are they lost on application shutdown?
Thank you.
--Ben
Ben,
Thanks for reaching out, sorry the documentation was not complete enough. Answers to your questions:
1. Timed events work on the premise of you stating when a timed event starts, and ends. Designated by the two calls, startTimedEvent and endTimedEvent.
1. Timed events are sent at the end of the event, or if the network is not available, at the launch of the next session.
1. It depends on the agent setting "send events immediately", if this is set to yes, then they are sent at the end, if no, then they are sent along with session and log data at the start/end of the next session depending on the setting: "upload on exit".
1a. That is correct as long as "send events immediately" is not set, or set to "true".
1b. No, the server is not contacted until the event is ended, otherwise there is more chatter than required for timed events.
2. Events that are never closed may be cleaned up by calling "[EmbeddedAgent clearTimedEvent:eventID]" if you know the event id, or "[EmbeddedAgent clearTimedEventsOlderThanTimeInterval:seconds]" where seconds is the number of seconds to clear events. For example setting it to zero will clear all orphaned events, setting it to 60 will clear events that were started over 1 minute ago and not ended.
Please let me know if this answers your questions.
Please sign in to leave a comment.
Comments
0 comments