Hi Sheshika/Manoj, As for now, this implementation doesn't take any time period as an argument. This is implemented using a custom transformer and all it keeps is a LinkedHashMap with attribute as the key and frequency as the value. So whenever a new event comes, it processes and produces an output event with desired_attribute(of incoming event) and frequency as o/p attributes.
If we can combine this transformer functionality easily with an existing Timewindow then, we might be able to provide the requirement. Is there a way to do this in Siddhi query level ? BR *Asok Aravinda Perera* Software Engineer WSO2, Inc.;http://wso2.com/ <http://www.google.com/url?q=http%3A%2F%2Fwso2.com%2F&sa=D&sntz=1&usg=AFQjCNGJuLRux6KkJwXKVUCYOtEsNCmIAQ> lean.enterprise.middleware Mobile: +94722241032 On Fri, Oct 17, 2014 at 6:28 PM, Seshika Fernando <[email protected]> wrote: > Yes, thats what I meant. So we can apply this function to existing windows > right? > > On Fri, Oct 17, 2014 at 5:37 PM, Manoj Gunawardena <[email protected]> > wrote: > >> Hi Seshika, >> >> Did u mean, this getFrequencies function, should able to accept another >> argument, that mean if this apply to a time window if window lenght is 1 >> day, this function will return last 5 hrs frequency of a day. >> Is your requirement can fulfill with existing window length or time >> parameters? >> >> ex -: if you need to extract frequency of last 5 hrs , apply this fuction >> to 5hrs time window >> >> >> Thanks >> >> On Fri, Oct 17, 2014 at 5:10 PM, Seshika Fernando <[email protected]> >> wrote: >> >>> When considering the usecases for this, getting the frequency during a >>> particular time period will be very useful. (eg:- trading frequency of a >>> different stocks/products during the last 5 hours) >>> Does your custom transformer support this? Or does it always take all >>> events for the frequency calculations? >>> >>> On Fri, Oct 17, 2014 at 4:32 PM, Rajeevan Vimalanathan < >>> [email protected]> wrote: >>> >>>> We are planning to integrate Frequency algorithm as a part of training >>>> project[1] with Siddhi CEP. >>>> >>>> Basically this is the algorithm calculates the number of occurrences >>>> (frequency) of a specified attribute for a given input stream in CEP. >>>> >>>> We have selected a Siddhi Transformer to implement this functionality >>>> by using stream-lib[2] as a third party library which is licensed under >>>> Apache Software Foundation. >>>> >>>> Standard Siddhi query for using this algorithm would look like below, >>>> >>>> * from >>>> inputStream#transform.custom:getFrequencies(desiredAttribute)select >>>> desiredAttribute, >>>> frequency* >>>> *insert into frequencyStream;* >>>> >>>> Where, >>>> >>>> inputStream : Input Stream to CEP >>>> >>>> custom : namespace >>>> >>>> getFrequencies : function name >>>> >>>> desiredAttribute : Attribute name from input stream for which >>>> frequencies need to be calculated >>>> frequencyStream : Output Stream from CEP that contains frequency >>>> related information >>>> >>>> The stream-lib library supports only Top-K and cardinality algorithms >>>> directly where the Top-K algorithm takes ‘K’ value as an argument from user >>>> and gives distinct K number of elements which have highest frequency values >>>> with related frequency values. The library provides no functions for >>>> getting frequencies of all elements. So what we are planning to do is >>>> giving a maximum integer value(Integer.MAX_VALUE) as an argument to the >>>> Top-K algorithm. So obviously, we will be able to get frequencies for all >>>> distinct event attributes provided that distinct event attribute count does >>>> not exceed Integer.MAX_VALUE value. >>>> >>>> There won’t be any memory issues as giving of Integer.MAX_VALUE for >>>> Top-K algorithm because it is increasing it’s bucket size dynamically as >>>> new distinct events come. >>>> >>>> We have already implemented the above design and basic testings seem to >>>> be ok. >>>> >>>> Kindly comment on the implementation. >>>> >>>> [1] - https://redmine.wso2.com/issues/2884 >>>> >>>> [2] - https://github.com/addthis/stream-lib >>>> >>>> -- >>>> Best Regards, >>>> V.Rajeevan >>>> Software Engineer, >>>> WSO2 Inc. :http://wso2.com >>>> >>>> Mobile : +94 773090875 >>>> Email : [email protected] >>>> >>>> _______________________________________________ >>>> Architecture mailing list >>>> [email protected] >>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >>>> >>>> >>> >>> _______________________________________________ >>> Architecture mailing list >>> [email protected] >>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >>> >>> >> >> >> -- >> Manoj Gunawardena >> Tech Lead >> WSO2, Inc.: http://wso2.com >> lean.enterprise.middleware >> Mobile : +94 77 2291643 >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > >
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
