package brooklyn.entity.webapp;

import brooklyn.enricher.RollingTimeWindowMeanEnricher;
import brooklyn.enricher.TimeWeightedDeltaEnricher;
import brooklyn.entity.basic.EntityLocal;

public class WebAppServiceMethods implements WebAppServiceConstants {
    
    public static void connectWebAppServerPolicies(EntityLocal entity) {
        entity.addEnricher(TimeWeightedDeltaEnricher.<Integer>getPerSecondDeltaEnricher(entity,
                WebAppServiceConstants.REQUEST_COUNT, WebAppServiceConstants.REQUESTS_PER_SECOND));
        
        entity.addEnricher(new RollingTimeWindowMeanEnricher<Double>(entity,
            WebAppServiceConstants.REQUESTS_PER_SECOND, WebAppServiceConstants.AVG_REQUESTS_PER_SECOND,
            WebAppServiceConstants.AVG_REQUESTS_PER_SECOND_PERIOD));
    }
}

@@ -517,16 +517,21 @@
 R_SECOND
+_LAST
 ));%0A    
@@ -666,16 +666,21 @@
 R_SECOND
+_LAST
 , WebApp
@@ -688,36 +688,32 @@
 erviceConstants.
-AVG_
 REQUESTS_PER_SEC
@@ -715,16 +715,26 @@
 R_SECOND
+_IN_WINDOW
 ,%0A      
@@ -766,12 +766,8 @@
 nts.
-AVG_
 REQU
@@ -782,16 +782,23 @@
 _SECOND_
+WINDOW_
 PERIOD))

update use of deprecated web sensors