by Allan Mitchell
17 Mar 2011 10:07
Whilst getting some courseware ready I was playing around writing some code and I decided to very simply show when a window starts and ends based on you asking for a TumblingWindow of n time units in StreamInsight. I thought this was going to be a two second thing but what I found was something I haven’t yet found documented anywhere until now. All this code is written in C# and will slot straight into my favourite quick-win dev tool LinqPad Let’s first create a sample dataset var EnumerableCollection = new []
{
new {id = 1, StartTime = DateTime.Parse(&q...
[More]
by Allan Mitchell
9 Feb 2011 00:24
I had an hour spare this afternoon so I wanted to have another play with Reactive Extensions in .Net and StreamInsight. I also didn’t want to simply use a console window as a way of gathering events so I decided to use a windows form instead. The task I set myself was this. Whenever I click on my form I want to subscribe to the event and output its location to the console window and also the timestamp of the event. In addition to this I want to know for every mouse click I do, how many mouse clicks have happened in the last 5 seconds. The second point here is really int...
[More]
by Allan Mitchell
6 Feb 2011 23:09
In his blogpost Roman from the StreamInsight team asked if we could create a Reactive Framework version of what he had done in the post using StreamInsight. For those who don’t know, the Reactive Framework or Rx to its friends is a library for composing asynchronous and event-based programs using observable collections in the .Net framework. Yes, there is some overlap between StreamInsight and the Reactive Extensions but StreamInsight has more flexibility and power in its temporal algebra (Windowing, Alteration of event headers) Well here are two alternate ways of doing what Roman...
[More]
by Allan Mitchell
5 Dec 2010 15:15
This is a pre-article to one I am going to be writing on adjusting an event’s time and duration to satisfy business process requirements but it is one that I think is really useful when understanding the way that Hopping/Tumbling windows work within StreamInsight. A Tumbling window is just a special shortcut version of a Hopping window where the width of the window is equal to the size of the hop Here is the simplest and often used definition for a Hopping Window. You can find them all here public static CepWindowStream<CepWindow<TPayload>> HoppingWindow<TPa...
[More]
by Allan Mitchell
27 Nov 2010 18:22
I have mentioned before about doing development for StreamInsight in Linqpad. I have it installed on two separate PCs and I have enabled autocompletion on only one of them. Whilst both versions are an excellent tool, the one with autocompletion enabled is so much easier to use. After enabling autocompletion you can see I now get parameter listing
by Allan Mitchell
25 Nov 2010 00:00
Slightly before the announcement of StreamInsight being available for Linqpad I downloaded it from here. I had seen Roman Schindlauer demonstrate it at Teched and it looked a really good tool to do some StreamInsight dev. You will need .Net 4.0 and StreamInsight installed. Here’s what you need to do after downloading and installing Linqpad. Add a new connection The next thing we need to do is install and enable the StreamInsight driver. Choose to view more drivers. Choose StreamInsight Select the driver after install ...
[More]
by Allan Mitchell
23 Aug 2010 23:35
In this postI show how you can use StreamInsight to take events coming from SQL Server Profiler in real-time and do some analytics whilst the data is in flight. Here is the solution for that post. The download contains Project that reads events from a previously recorded trace file Project that starts a trace and captures events in real-time from a custom trace definition file (Included) It is a very simple solution and could be extended. Whilst this example traces against SQL Server it would be trivial to change this so it profiles events in Analysis Services. ...
[More]
by Darren Green
11 Jun 2010 18:08
This is just a quick one prompted by a question on the SSIS Forum, how to programmatically add a precedence constraint (aka workflow) between two tasks. To keep the code simple I’ve actually used two Sequence containers which are often used as anchor points for a constraint. Very often this is when you have task that you wish to conditionally execute based on an expression. If it the first or only task in the package you need somewhere to anchor the constraint too, so you can then set the expression on it and control the flow of execution. Anyway, back to my code sample, here’s a quick scre...
[More]
by Darren Green
17 Jul 2009 16:07
In my previous post Searching for tasks with code you can see how to explore the control flow side of packages, drilling down through containers, task, and event handlers, but it didn’t cover the data flow. I recently saw a post on the MSDN forum asking how to edit an existing package programmatically, and the sticking point was how to find the the data flow and the components inside. This post builds on some of the previous code and shows how you can explore all objects inside a package. I took the sample Task Search application I’d written previously, and came up with a totally pointless l...
[More]
by Darren Green
19 May 2009 08:30
The Execute SQL Task is for obvious reasons very well used, so I thought if you are building packages in code the chances are you will be using it. Using the task basic features of the task are quite straightforward, add the task and set some properties, just like any other. When you start interacting with variables though it can be a little harder to grasp so these samples should see you through. Some of these more advanced features are explained in much more detail in our ever popular post The Execute SQL Task, here I’ll just be showing you how to implement them in code. The abbreviated cod...
[More]
by Darren Green
12 May 2009 09:40
Searching packages or just enumerating through all tasks is not quite as straightforward as it may first appear, mainly because of the way you can nest tasks within other containers. You can see this illustrated in the sample package below where I have used several sequence containers and loops. To complicate this further all containers types, including packages and tasks, can have event handlers which can then support the full range of nested containers again. Towards the lower right, the task called SQL In FEL also has an event handler not shown, within which is another Execute SQL Task,...
[More]
by Darren Green
7 May 2009 14:15
Every now and then I've come across scenarios where I need to update a lot of packages all in the same way. The usual scenario revolves around a group of packages all having been built off the same package template, and something needs to updated to keep up with new requirements, a new logging standard for example.You'd probably start by updating your template package, but then you need to address all your existing packages. Often this can run into the hundreds of packages and clearly that's not a job anyone wants to do by hand. I normally solve the problem by writing a simple console applicat...
[More]