Azure Application Insights shows the same event at identical timestamps multiple times - azure

I am tracking custom events in Application Insights. In this problematic case I issue one call to "trackEvent" in my browser-front-end when the user loads a component (I am developing an Angular application).
In my Application Insights I run a query to list my custom events. Now in the results-list I have the same events with all fields identical (even the timestamp with miliseconds). Only the itemId is different.
Where could those multiple events of just one call to trackEvent have originated?
I do not have any relevant source code to offer, since I am only using this one call of trackEvent in the library applicationinsights-js (https://github.com/Microsoft/ApplicationInsights-JS)
Well here it goes:
AppInsights.trackEvent(myName, myProperties, myMeasurements);

In my case I could solve the problem by setting
config.isStorageUseDisabled = true;
in the configuration-object that is passed to the downloadAndSetup-Method of Application-Insights-JS. I also set the maxBatchInterval to 0, so that I would not lose any Tracking-Events. I am not sure about that though.

Related

What is the difference between POST UpdateStuff [version] and POST /api/v1/UpdateStuff in Azure AppInsights

In Azure AppInsights, I can see requests from two different sources even though I have only one end point, which is /api/v1/UpdateStuff.
What is the difference between
POST UpdateStuff [version] and POST /api/v1/UpdateStuff in Azure AppInsights?
I believe UpdateStuff is how your method is called in ASP.NET / c# code, and application insights tracks it as well. Should also be visible if you look at the dependency graph of a request. It is shown there as a child of /api/...
I had the same experience after updating some packages. Now all request are logged as POST UpdateStuff [version].
So, I can say there is no differences only different way of logging the requests.

Sequelize - Change Watcher (one database, two different apps)

I have two different Node Projects that access to the same database with sequelize.
One of the Node Apps (kind of backoffice) updates some tables and the other one use the data of that tables to performs some operation.
The thing is that this data should not be changed constantly and the second app need to be as fast as possible, thats why the second app querys the tables once (when app starts) and then stores this data in memory so it can do the operations faster (because the are no i/o to database).
My problem is that sometimes, this data may change throw the first app, and as this two apps have no contact between them (for security reasons) the only way I see is to have some "dirty" flag in some table of the database, and then make the first app to change it after some update and the second app to query each X seconds in order to check if this flag has been changed.
I don't like this approach and that's why I'm posting this question:
Does Sequelize provides a better or fancy way to do this ?
like some kind of "changes/dirty" watcher
Thanks in advance

Getting lots of controller calls with Xamarin Azure Pullasync

We are using xamarin forms to create an Azure backed mobile app. We are using offline data sync to allow offline data storage and processing. This is all hooked up as per the many walkthroughs on the web and all seems to be working fine.
One of our tables contains ~5000 rows which is causing us a few issues. When you do the initial sync with the app using the code;
this.listTable = client.GetSyncTable<Entities.List>();
await this.listTable.PullAsync("allLists", listTable.CreateQuery());
the azure .NET service seems to get his thousands of times. I have debugged the services' GetAllList() method on azure - containing the code;
public IQueryable<List> GetAllList()
{
return Query();
}
and the breakpoint get’s hit a lot. I have checked out what Query() is returning and it looks to be returning the whole dataset (~5000 rows) as I would expect.
Does anybody know what I could be doing wrong to have it called so many times? It looks to be returning the whole dataset for maybe each row in the dataset - causing the sync to be very slow.
I stepped through the controller process when debugging and it doesn’t just look to be calling the GetAllList() method loads of times, it initialises the controller then calls the GetAllList method over and over again.
I’m sure I’ve set something up incorrectly and it’s a simple mistake as I can’t believe this is by design, but can’t for the life of me spot what I have done wrong :(
Any help would be very welcome!
Thanks,
Al.
Turns out the pagesize for the requests is 50 by default. This results in loads of calls to the service to the number of rows I was calling taking loads of time.
I can up the MaxPageSize on the client and the PageSize on the service and it is significantly quicker.
Came across the suggestions here for reference - https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ff5b6ba7-76c7-42fe-847d-9898256e3249/problem-syncing-large-table?forum=azuremobile
There are, of course things that need to be taken into account when upping this value - but at least it explains what was happening.

Chromecast discover with multiple Activities and CCL

I'm developing an Android app for Chromecast which makes use of the Chromecast Companion Library (CCL) together with a MediaRouterButton. When the first activity is created, onCastDeviceDetected is called and MediaRouterButton is set to visible. The second activity is created from within the first activity, but no onCastDeviceDetected is called in the second activity!
What is best practice for keeping state of discovered Chromecast devices with the combination of multiple activities, MediaRouterButton and CCL?
In CCL version 1.8 onCastDeviceDetected was always called when starting a new activity, so this issue seems to be introduced (with purpose) in version 1.9 ?
I am not sure if what you are asking was ever working differently; I looked at the code and there hasn't been any changes in the behavior around that but I could be wrong.
Right now CCL doesn't provide an API for you to do that. From CCL's point of view, availability of routes hasn't changed when you move from one activity to another so it doesn't fire that callback (and the intention was not to do that either). The problem you are facing can be addressed by either of these:
Keep track of the route availability in, say, your Application instance; register a VideoCastConsumer in your Application class and listen to onCastAvailabilityChanged(). Keep the result in your Application instance and then when you start a new activity, ask your application instance if there is any cast device or not (based on the preserved value that I talked about); that would give the initial state. Have your activity register a consumer with the same callback so from that point on, the activity is self-contained as long as it is alive.
File a feature request for CCL so I add an API to get you around the need to add that piece in your own application instance.

Data is being entered twice when cross domain web service is fired

I have created a .net web service and when i try to call a method that saves the data in the database, the request is fired twice. I use net profiler to check if two requests are made to the server but only one request is made to server. I fail to understand why data is being entered twice in the database.I am using jsonp method to call the cross domain site
I just found something interesting. I have two servers. When i host the web service on one and call the web service using cross domaining, the data is entered once whereas on the other the data is entered twice. Do we need to take care of some IIS settings too?
So, if there aren't two requests being made then there are almost certainly two calls to the Save() method (or whatever it is called), being fired from the web service end point. But there maybe dupliacte data somewhere too.
Here are a couple of things to check:
What data is actually being
transferred? Have you checked this
using a tool like Charles?
Is the data being passed to your Save() method the same as the data being passed to the web service?
How is the data being written to the database? Is there duplicate SQL somewhere?
Heyi all, i just converted my project to visual studio 2010 and then installed it on the server. Everything is running perfectly now. Thanks

Resources