Skip to content

Commit

Permalink
Changes Related to WSO2 CARBON PATCH 5.0.0 0286
Browse files Browse the repository at this point in the history
  • Loading branch information
rashm1n committed May 19, 2021
1 parent 034502e commit 24a0123
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -27,6 +27,8 @@ define stream ThrottledOutStream(
apiContext string,
apiCreator string,
apiCreatorTenantDomain string,
apiResourceTemplate string,
apiMethod string,
applicationId string,
applicationName string,
subscriber string,
Expand Down Expand Up @@ -75,15 +77,15 @@ insert into TemporaryUserStream;

--this query ensures that the same type of alert is not generated for same apiCreator again for a time defined in #window.time(),
@info(name = 'Query contains Suppression logic')
from TemporarySubscriberStream#window.length(1) as a left outer join SuppressedTemporarySubscriberStream#window.time(10 minute) as b
from TemporarySubscriberStream#window.length(1) as a left outer join SuppressedTemporarySubscriberStream#window.time(10 minutes) as b
on (a.apiCreator == b.apiCreator and a.apiVersion == b.apiVersion and a.applicationId == b.applicationId)
select a.apiCreator, a.apiName, a.apiVersion, a.applicationId, a.applicationName, a.apiCreatorTenantDomain, a.userTenantDomain, a.subscriber, a.numHits
having b.apiCreator is null
insert into SuppressedTemporarySubscriberStream ;

--this query ensures that the same type of alert is not generated for same user again for a time defined in #window.time()
@info(name = 'Alert Suppression')
from TemporaryUserStream#window.length(1) as a left outer join SuppressedTemporaryUserStream#window.time(10 minute) as b
from TemporaryUserStream#window.length(1) as a left outer join SuppressedTemporaryUserStream#window.time(10 minutes) as b
on (a.username == b.username and a.apiVersion == b.apiVersion and a.applicationId == b.applicationId)
select a.username, a.apiCreator, a.apiName, a.apiVersion, a.applicationId, a.applicationName, a.apiCreatorTenantDomain, a.userTenantDomain, a.subscriber, a.numHits
having b.username is null
Expand Down

0 comments on commit 24a0123

Please sign in to comment.