Monitoring what doesn't occur
i monitor failures in datacenter streaminsight, means want alerts when things don't happen period of time.
thinking of streaminsight case study of tollboth, want query tells me if no cars have gone through tollbooth x minutes.
has done sample or blog post on this?
you need left anti semi-join that.
var itemlist = in sourcequerystream .altereventduration(e => timespan.maxvalue) .clipeventduration(sourcequerystream, (e, i) => (e.itemid == i.itemid && e.adapter == i.adapter)) select new { itemid = i.itemid, adapter = i.adapter, lastvalue = i.value, lasttimestamp = i.timestamp }; //create query items in past 30 seconds. var currentitemlist = in sourcequerystream .altereventduration(e => timespan.fromseconds( 30 )) .clipeventduration(sourcequerystream, (e, i) => (e.itemid == i.itemid && e.adapter == i.adapter)) select new { itemid = i.itemid, adapter = i.adapter }; //do left anti-semi-join find missing values. var singlemissingitems = il in itemlist ( cil in currentitemlist il.adapter == cil.adapter && il.itemid == cil.itemid select cil ).isempty() select new messageeventdataitem() { messagetype = messagetypes.issue, message = "[" + il.itemid + "] sensor appears offline. last value:" + il.lastvalue.tostring("#,##0.00"), adapter = il.adapter, name="sensor offline", itemid = il.itemid, source = queryname, timestamp = il.lasttimestamp };
devbiker (aka j sawyer)
my blog
if answered question, please mark answer.
if post helpful, please mark helpful.
SQL Server > Microsoft StreamInsight
Comments
Post a Comment