History of events - complex-event-processing

We have a scenario in which we need to check the status of different devices and create an event "completed". We need to check the history of events and check the status of different devices if any of them are in "stop" status. how can we check the history of events?
Devices - D1, D2, D3, D4
Each device will have status "start" and "stop". If all the devices are in "stop" stage then I should trigger new event "completed". If any of the devices are in "start" stage we shouldn't trigger "completed" event. For this, we need to know about the past events. how can we do this?
Please help.

There is a list of functions available that can be used to query historical data from within the esper engine: http://cumulocity.com/guides/event-language/functions/
In the end they offer similar functionality as the REST API.

Related

MIKROS Analytics not showing (Unity project)

I do not see any tracked events on MIKROS Analytics. I have followed all the steps from the Get Started guide.
My app is approved and I already have an "appGameId" and my "apiKey". I am using the Production "apiKey" for now.
Some other information. I have auto initialization enabled under Mikros Settings in the Inspector. I also tested without auto initialization and initialized the MIKROS SDK at app start like this,
MikrosManager.Instance.InitializeMikrosSDK();
I tried to log a custom event like this,
// log events
AnalyticsController.LogEvent("mikros_analytics_test", "parameter", "app_open", (Hashtable customEventWholeData) =>
{
// handle success
},
onFailure =>
{
// handle failure
});
Any idea why I am unable to see any events on the dashboard? Or what step(s) I am missing?
Don't forget to define the namespaces at the top of your scripts as well.
using MikrosApiClient;
using MikrosApiClient.MikrosAnalytics;
It takes some time after the app is not being used before all events are fully logged. However, you can manually log them by calling:
AnalyticsController.FlushEvents();
Also make sure you have the following at the top of your script:
using MikrosApiClient;
using MikrosApiClient.MikrosAnalytics;
Ref: https://developer.tatumgames.com/documentation/log-events
Similar to other analytic services such as Firebase Analytics or Unity Analytics, MIKROS Analytics queues your events and will send them out in batches. There are certain criteria required in order for the batched events to be sent off.
While both Firebase and Unity can take up to a maximum of 24 hours before events can be viewed on their dashboards, MIKROS has a max time of about 10 hours. However, in most cases MIKROS tracked events will be posted more immediately. The 10 hour timeframe is when the entire batch of events is forced cleared from the queue.
If you want more control of how immediate events are sent off you could force event uploads using flush(). Call the method after you have tracked your events.
MikrosManager.Instance.AnalyticsController.FlushEvents();
It is not really necessary, but it's an option available to you.

Moodle Event Heirarchy

What core Moodle events will allow me to see when a student navigates between areas of a course? I need to build an event trigger plugin, to call an external REST endpoint, every time a student navigates between screens, begins or ends a course module, etc. The Event API docs has a long list of events, however I cannot find anything which details when the event will actually fire. Also, the only activity I can find, which seems to remotely relate to what I'm looking for is course_module_viewed and, unfortunately, that event name repeats in many areas:
core\event\course_module_viewed
mod_lti\event\course_module_viewed
mod_page\event\course_module_viewed
mod_resource\event\course_module_viewed
mod_url\event\course_module_viewed
I think you're right that you want "course_module_viewed" events - but that event is (should be, because it ties into default activity completion options) implemented by each activity/resource type, because it could mean different things. So if the activity is a "page", then viewing it will trigger mod_page\event\course_module_viewed and if the activity is a SCORM package, mod_scorm\event\course_module_viewed. All of these should extend the abstract core\event\course_module_viewed class.
There is not a default event for moving between pages within an activity - at that level of granularity you are dependent on whether the implementers of that plugin decided to log events for this or not, or indeed whether the activity even has pages.
Other events you may be interested in are core\event\course_viewed and core\event\course_completed which only exist in core, and the various other events that each individual activity you're likely to encounter in your course content fires off. Eg. for a SCORM activity, you might be interested in the "mod_scorm\event\status_submitted" event

Flutter/firebase: execute function at specific time

How can I execute a function at a specific time with flutter and firebase? I want to allow the user of my app to send messages to other users at a specific time. Right now, they are sent when the message is created, but I would like to allow the user to schedule the message.
Any idea? I have looked at the Timer class of Flutter, but it does not seem to be useful for this.
According to me handling this on flutter(frontend) will be a bad idea. You can look into firebase cloud function and scheduling of cloud functions to achieve the result. For example, you can have a boolean to show/hide the message in your message model and use cloud function to update it accordingly on the scheduled time.

Google Calendar API Watch Channel Should I get a push notification for each resource?

When subscribing to Calendar Channel, https://developers.google.com/google-apps/calendar/v3/push, should I expect to get a push notification for each new event created?
In testing, if I create 21 events (each at 2 second intervals), I get about 7 notifications.
It's hard to tell from the docs if I should be getting a notification for each event created, or if I should use the notification to do a sync?
What are you guys doing for your apps?
Google Calendar watches only make sense when you're also using the sync token feature. They are basically instructions to do another sync, which will bring in 1 or more event changes. The reason you got less than 21 messages is because Google rate limits the messages (in your case to what looks like every ~3 seconds... my experience is closer to 10s).
The callout about not being 100% reliable is actually a bit of a different concern than the "only 7" callbacks issue. Until yesterday, my experience was that watches were 99.9% reliable in terms of delivering a notification within a few seconds of a change. But for the 0.1%, you'll want to have some sort of fallback force sync... could be once an hour, could be upon login, etc.
I've noticed similar. Scroll down to the very bottom of that page you linked:
Notifications are not 100% reliable. Expect a small percentage of messages to get dropped under normal working conditions. Make sure to handle these missing messages gracefully, so that the application still syncs even if no push messages are received.
If you've called watch on the calendar to register/create a notification channel, I'm assuming they're doing some throttling/bucketing to push out notifications at a coarse-grained level. Testing this out myself but I believe the original intention of asking for incremental changes via setting timeMin equal to a previously requested syncTime still holds true:
https://developers.googleblog.com/2013/07/google-calendar-api-push-notifications.html

iOS: does google analytics SDK caches all data for sending them later if no internet is available?

Does google analytics SDK caches all data for sending them later if no Wifi is available? I guess everything is OK when iPhone/iPad is online (has internet available) then it sends all events data. But what about its functionality when the device has no internet connection? Do I have manually to check for internet connection (for example with apple reachability class) and maintain the data cache for later use myself?
Short answer: yes.
More details:
In case you use dispatch period greater than zero (let's say 15):
every 15 seconds GA tracker will try to dispatch events, AND
if no network connection is available, tracker will try to dispatch after another 15 seconds until success, AND
if it fails and you quit the app (it's not paused in the background), on next application session, tracker will try to dispatch your events again according to dispatch period.
In case you use dispatch period is equal to -1, which means you dispatch your events manually by calling [[GANTracker sharedTracker] dispatch]:
if you call dispatch but connection is not available, event will get cached, so next dispatch call will try to send cached events in a batch,
again, events are cached between application sessions.
The above also applies to a mix of above two cases: you use dispatch period > 0, but you decide to dispatch some events manually.
Note: I have no idea how much events/data can GA tracker cache before its' buffers get overwritten or go haywire.
Some other tips for using GA:
if you're unsure about something, set option dryRun to YES and test
your scenario. Also you can use some other account ID for testing
without dry run.
use GANTrackerDelegate methods to see if hits were dispatched.
This is a related question, basically you need to use batching. I think Flurry analytics makes this aspect more transparent (you just log events and it takes care of everything).