Flurry Timed Events tracking multiple of them - flurry

As per Flurry Documentation for timed events you can logEvent and then endTimedEvent which is great.
But my specific question is around what happens when we log multiple timed events at one time and when we call endTimedEvent which one of the open timed events gets closed.
So for Example: If my event is tracking user checkin into a restaurant and how much time does an average guest spends in a restaurant. So my event name would be let's say UserCheckIn. Now multiple users checkin into the restaurant which mean I have multiple timedEvents open and let say one of the guest departs I would close timedEvent.
So does Flurry takes care of this scenario? How would it tie up an open timed even to a closed timed event? Or do I need to do something special in my code.

Related

Working time of webhook in dialogflow or alternative

I'm writing a bot for myself, which could, on request, find torrents and download them to my home media center.
I receive an error with my webhook: request lives only ~ 5 seconds.
Parsers work 1-10 seconds + home server on hackberry is very slow.
With this, my requests die at 50%.
How can I query and receive an answer after more then 5 seconds?
An action is expected to respond within 5 seconds. This does not necessarily have to be the exact answer, but you'll need to have something to let the user know that your action is still processing.
This could be as simple as giving an intermediary state like, "Okay, I'm going to start. Do you want anything else?", or playing a short MediaResponse as "hold music". Then you can store the state in a short-term and quick to access database which is easy to poll and give as a status update when the user asks.
This can be simply done through followUpEvents. You can call any intent through web hook's followUpEvent. So, to solve your problem, you have to maintain states in your web application like "searching", "found", "downloading" and "downloaded", it's completely upto you.
Now, once an initial intent is called, you initiate the process on your server then hold for 3-3.5 seconds and send a followUpEvent to call other intent which will do nothing but wait another 3-3.5 seconds and keep polling your server each second for updated status. You can keep calling next follow up intents till you get your desired status from server.
So if your request die at 50% on a single intent then it should work fine with two follow up intents.

Thermostat to nest.com connection rate

I'm using REST GET calls from a google script to build a temperature profile of my house during the day. The function triggers every 15min. last_connection (and the rest of the data) will sometimes be the same 3-4 calls in a row, other times can be different each time for several hours running, suggesting variable rates at which the thermostat sends data up to the server.
Does anyone know what governs the thermostat's connections to nest.com or if there is a way to force a connection in order to get an up to date profile?
The thermostat connects to Nest's cloud under the following circumstances:
A 'significant' even has occurred (ie the furnace turning on)
A timeout has occurred (ie a scheduled check in appointment)
A thermostat will be considered offline if it misses its check in window, there is more detail on why that would happen in Nest's Troubleshooting Offline Status in the Nest apps support article.
You can force a thermostat to come online by sending a change to it, for example changing the target temperature will necessarily force the thermostat to wake up so the new value can be set, while awake the thermostat will update the cloud service with updated information. Forcing a thermostat to wake as way to get updated data from the thermostat is not recommended as you will run into an API rate limit designed to protect the battery on the thermostat. Charging rates on thermostats are rather limited, wake it too often and it will go offline for a while, annoying the user.
Rest assured, if the ambient temperature or humidity changes by a 'significant' amount, the thermostat will wake up and update the cloud service. The thresholds of what signifies a significant amount are harder to predict as they are partially determined by charging rate. If you want to know why that can vary, Nest has filed a patent which goes into great detail.

Temporarily hiding a message in azure service bus queue/topic

I have a scenario where some of the messages depend no the completion of another messages to be completed. So there is a precondition for a set of messages to be processed that another message should be processed first. The precondition message is a long running process which can take up to 30 minutes to process.
What I would like is to hide a message for lets say 5 minutes from all the subscribers when I sense that precondition is not complete and then after 5 minutes it is available again and hidden for next 5 minutes if cant be processed and so on.
I can see that I can use sessions and defer could be solution but I do not want to go that way. Since that will require to maintain a storage to keep the defered messages in a non queue storage.
Another way could be that I do a peak lock on the message and then leave it alone and let the lock expire so that in due time it will reappear in the queue.
Is there a better way of doing this?
There are a couple ways to achieve this. When you get a message to can choose to Defer it. This will remove it from the active queue and you will have to later ask for this message specifically with a MessageId. For your scenario it may be possible to use Scheduled messages (see below) but that will involve receiving the message and then scheduling another one using the following:
http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebus.messaging.brokeredmessage.scheduledenqueuetimeutc.aspx

How can we map the user's logon and logoff events

I have some knowledge about the events 4624(logon) and 4634(logoff). As microsoft's document suggests, we can correlate these events with the logonid.
Here my question is, is there any other efficient way to do this?
Because my need would be, I have to read events for last 30 days, and correlate logon and logonoff events to find the logon duration.
As per the document, logonid is unique between reboots on the same computer. so in that period(last 30 days) there may be the possibility of computer rebooted several times. so i suspect,there may be the possibility of duplication in logonid while we analyze the events for last 30 days.
If you want to track logon and logoff events I would suggest to use logon and logoff scripts that write this information into a database. Using such an approach you don't need to parse eventlogs (on all servers).

Azure Service Bus - Determine Number of Active Connections (Topic/Queue)

Since Azure Service Bus limits the maximum number of concurrent connections to a Queue or Topic to 100, is there a method that we can use to query our Queues/Topics to determine how many concurrent connections there are?
We are aware that we can capture the throttling events, but would very much prefer an active approach, where we can proactively increase or decrease the number of Queues/Topics when the system is under a heavy load.
The use case here is a process waiting for a reply message, where the reply is coming from a long-running process, and the subscription is using a Correlation Filter to facilitate two-way communication between the Publisher and Subscriber. Thus, we must have a BeginReceive() going in order to await the response, and each such Publisher will be consuming a connection for the duration of their wait time. The system already balances load across multiple Topics, but we need a way to be proactive about how many Topics are created, so that we do not get throttled too often, but at the same time not have an excess of Topics for this purpose.
I don't believe it is currently possile to query the listener counts. I think that the subscriber object also figures into that so in theory, if you have up to 2000 subscribers per topic and if each allows up to 100 connections, that's alot of potential connections. We just need to keep in mind that subscribers are cooperative (each gets a copy of all messages) and receivers on subscriers are competitive (only one gets it).
I've also seen unconfirmed reports of performance delays when you start running > 1,000 subscribers so make sure you test this scenario.
But... given your scenario, I'd deduce that performance time likely isn't the biggest factor (you have long running processes already). So introducing a couple seconds lag into the workflow likely won't be critical. If that's the case, I'd set the timeout for your BeginRecieve to something fairly short (couple seconds) and have a sleep/wait delay between attempts. This gives other listeners an opportnity to get messsages as well. We might also want to consider an approach where we attempt to recieve multiple messages and then assign them out other processes for processing (coorelation in this case?).
Juts some thoughts.

Resources