[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/conf/admin/metrics.xml idp-conf/src/main/resou...

noreply at shibboleth.net noreply at shibboleth.net
Fri Sep 23 17:32:50 EDT 2016


Author: scantor
Date: Fri Sep 23 17:32:49 2016
New Revision: 8423

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8423&view=rev
Log:
Wire in support for timer configuration and an example.

Modified:
    trunk/idp-conf/src/main/resources/conf/admin/metrics.xml
    trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml
    trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-flow.xml
    trunk/idp-conf/src/main/resources/system/flows/logout/logout-beans.xml
    trunk/idp-conf/src/main/resources/system/flows/logout/logout-flow.xml
    trunk/idp-conf/src/main/resources/system/flows/logout/logout-propagation-beans.xml
    trunk/idp-conf/src/main/resources/system/flows/logout/logout-propagation-flow.xml
    trunk/idp-conf/src/main/resources/system/flows/saml/saml-abstract-beans.xml
    trunk/idp-conf/src/main/resources/system/flows/saml/saml-abstract-flow.xml
    trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/TimerContext.java
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/PopulateTimerContext.java

Modified: trunk/idp-conf/src/main/resources/conf/admin/metrics.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/conf/admin/metrics.xml?rev=8423&r1=8422&r2=8423&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/conf/admin/metrics.xml	(original)
+++ trunk/idp-conf/src/main/resources/conf/admin/metrics.xml	Fri Sep 23 17:32:49 2016
@@ -62,4 +62,36 @@
     
     </util:map>
     
+    <!-- System Timing Configuration -->
+    
+    <!--
+    A bean named shibboleth.metrics.TimerStrategy of type Function<ProfileRequestContext,Boolean>
+    can be defined to add timers to a large number of objects in the system. Each timer is defined
+    by a triple (timer name, start object, stop object).
+    
+    The most common example is to start a timer when a particular flow action bean starts and
+    stop it when the same or different action bean stops, to measure how long the execution takes.
+    
+    If you want to leave a timer in place but disabled to prevent overhead, you can turn off a
+    logging category named "metrics.<timername>" in your logging configuration.
+    -->
+    
+    <!--
+    <bean id="shibboleth.metrics.TimerStrategy" parent="shibboleth.ContextFunctions.Scripted"
+            factory-method="inlineScript">
+        <constructor-arg>
+            <value>
+            <![CDATA[
+                timerCtx = input.getSubcontext("net.shibboleth.idp.profile.context.TimerContext");
+                timerCtx.addTimer("idp.attribute.resolution",
+                    "net.shibboleth.idp.profile.impl.ResolveAttributes",
+                    "net.shibboleth.idp.profile.impl.FilterAttributes"
+                    );                                
+                true; // Signals success.
+            ]]>
+            </value>
+        </constructor-arg>
+    </bean>
+    -->
+    
 </beans>

Modified: trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml?rev=8423&r1=8422&r2=8423&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml	(original)
+++ trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml	Fri Sep 23 17:32:49 2016
@@ -21,6 +21,9 @@
     <bean id="InitializeProfileRequestContext"
         class="net.shibboleth.idp.profile.impl.InitializeProfileRequestContext" scope="prototype"
         p:profileId-ref="shibboleth.AdminProfileId" />
+
+    <bean id="PopulateTimerContext" class="net.shibboleth.idp.profile.impl.PopulateTimerContext"
+        p:timerStrategy="#{getObject('shibboleth.metrics.TimerStrategy')}" />
     
     <!--
     The collection selection expression works because Spring converts the first member of a collection into

Modified: trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-flow.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-flow.xml?rev=8423&r1=8422&r2=8423&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-flow.xml	(original)
+++ trunk/idp-conf/src/main/resources/system/flows/admin/admin-abstract-flow.xml	Fri Sep 23 17:32:49 2016
@@ -11,6 +11,7 @@
     </on-start>
     
     <action-state id="DoAdminPreamble">
+        <evaluate expression="PopulateTimerContext" />
         <evaluate expression="InitializeAdministrativeProfileContextTree" />
         <evaluate expression="'proceed'" />
         

Modified: trunk/idp-conf/src/main/resources/system/flows/logout/logout-beans.xml

[... 219 lines stripped ...]


More information about the commits mailing list