You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/08/03 17:00:39 UTC

cvs commit: jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces InstrumentSampleUtils.java InstrumentDescriptor.java InstrumentManagerClient.java InstrumentSampleDescriptor.java InstrumentSampleSnapshot.java InstrumentableDescriptor.java CounterInstrumentListener.java InstrumentListener.java InstrumentSampleListener.java ValueInstrumentListener.java

leif        2002/08/03 08:00:39

  Modified:    instrument build.xml default.properties
               instrument/example/managerICM/data instrument.sampledata
               instrument/src/manager/org/apache/excalibur/instrument/manager
                        AbstractInstrumentSample.java
                        AbstractValueInstrumentSample.java
                        CounterInstrumentSample.java
                        DefaultInstrumentManager.java InstrumentProxy.java
                        InstrumentSample.java InstrumentSampleFactory.java
                        InstrumentableProxy.java
                        MaximumValueInstrumentSample.java
                        MeanValueInstrumentSample.java
                        MinimumValueInstrumentSample.java
               instrument/src/manager/org/apache/excalibur/instrument/manager/altrmi
                        InstrumentManagerAltrmiServer.java
               instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces
                        InstrumentDescriptor.java
                        InstrumentManagerClient.java
                        InstrumentSampleDescriptor.java
                        InstrumentSampleSnapshot.java
                        InstrumentableDescriptor.java
  Added:       instrument/src/manager/org/apache/excalibur/instrument/manager
                        CounterInstrumentListener.java
                        InstrumentDescriptorLocal.java
                        InstrumentDescriptorLocalImpl.java
                        InstrumentListener.java
                        InstrumentManagerClientLocal.java
                        InstrumentManagerClientLocalImpl.java
                        InstrumentSampleDescriptorLocal.java
                        InstrumentSampleDescriptorLocalImpl.java
                        InstrumentSampleListener.java
                        InstrumentableDescriptorLocal.java
                        InstrumentableDescriptorLocalImpl.java
                        ValueInstrumentListener.java
               instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces
                        InstrumentSampleUtils.java
  Removed:     instrument/src/manager/org/apache/excalibur/instrument/manager
                        InstrumentDescriptorImpl.java
                        InstrumentManagerClientImpl.java
                        InstrumentSampleDescriptorImpl.java
                        InstrumentableDescriptorImpl.java
               instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces
                        CounterInstrumentListener.java
                        InstrumentListener.java
                        InstrumentSampleListener.java
                        ValueInstrumentListener.java
  Log:
  Add child instrumentables and the ablility for the InstrumentManager to save
  and restore its state.
  
  Revision  Changes    Path
  1.35      +28 -20    jakarta-avalon-excalibur/instrument/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/build.xml,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- build.xml	31 Jul 2002 14:11:09 -0000	1.34
  +++ build.xml	3 Aug 2002 15:00:37 -0000	1.35
  @@ -22,6 +22,10 @@
           <pathelement location="${excalibur-altrmi-client-impl.jar}"/>
           <pathelement location="${excalibur-altrmi-client-interfaces.jar}"/>
           <pathelement location="${excalibur-altrmi-generator.jar}"/>
  +        <pathelement location="${excalibur-collections.jar}"/>
  +        <pathelement location="${excalibur-component.jar}"/>
  +        <pathelement location="${excalibur-logger.jar}"/>
  +        <pathelement location="${excalibur-pool.jar}"/>
           <pathelement path="${java.class.path}"/>
       </path>
   
  @@ -53,6 +57,11 @@
           <available property="framework.present" classname="org.apache.avalon.framework.logger.AbstractLogEnabled">
               <classpath refid="project.class.path"/>
           </available>
  +        
  +        <echo message="excalibur-component.jar=${excalibur-component.jar}"/>
  +        <available property="ecm.present" classname="org.apache.avalon.excalibur.component.ExcaliburComponentManager">
  +            <classpath refid="project.class.path"/>
  +        </available>
       </target>
   
       <target name="dependencies" description="Check dependencies" unless="skip.dependencies">
  @@ -237,7 +246,6 @@
                 <attribute name="Implementation-Version" value="${package-version}"/>
               </manifest>
               <exclude name="**/test/**"/>
  -            <exclude name="**/interfaces/**"/>
               <zipfileset dir="${build.conf}" prefix="META-INF/">
                   <include name="LICENSE.txt"/>
               </zipfileset>
  @@ -398,7 +406,7 @@
               <zipfileset dir="${docs.dir}" prefix="${dist.name}/docs"/>
           </zip>
   
  -	<!--
  +    <!--
           <tar longfile="gnu" tarfile="${dist.base}/${dist.name}-bin.tar">
             <tarfileset dir="${dist.dir}"
                         prefix="${dist.name}"
  @@ -407,8 +415,8 @@
           </tar>
   
           <gzip zipfile="${dist.base}/${dist.name}-bin.tar.gz"
  -		src="${dist.name}-bin.tar"/>
  -	
  +        src="${dist.name}-bin.tar"/>
  +    
           <bzip2 zipfile="${dist.base}/${dist.name}-bin.tar.bz2"
                  src="${dist.name}-bin.tar"/>
   
  @@ -418,40 +426,40 @@
   
       <target name="dist-src">
           <zip zipfile="${dist.base}/${dist.name}-src.zip" compress="true">
  -	    <zipfileset dir="${dist.dir}" prefix="${dist.name}"/>
  -	    <zipfileset dir="${basedir}" prefix="${dist.name}" includes="*.xml,*.properties"/>
  -	    <zipfileset dir="${src.dir}" prefix="${dist.name}/src"/>
  +        <zipfileset dir="${dist.dir}" prefix="${dist.name}"/>
  +        <zipfileset dir="${basedir}" prefix="${dist.name}" includes="*.xml,*.properties"/>
  +        <zipfileset dir="${src.dir}" prefix="${dist.name}/src"/>
               <zipfileset dir="${docs.dir}" prefix="${dist.name}/docs"/>
           </zip>
   
  -	<!--
  +    <!--
           <tar longfile="gnu" tarfile="${dist.base}/${dist.name}-src.tar">
             <tarfileset dir="${dist.dir}"
                         prefix="${dist.name}"
                         username="avalon"
                         group="avalon"/>
             <tarfileset dir="$docs.dir}"
  -		  prefix="${dist.name}/docs"
  +          prefix="${dist.name}/docs"
                         username="avalon"
  -		      group="avalon"/>
  +            group="avalon"/>
             <tarfileset dir="${src.dir}"
  -		  prefix="${dist.name}/src"
  +          prefix="${dist.name}/src"
                         username="avalon"
  -		      group="avalon"/>
  +            group="avalon"/>
         </tar>
   
           <gzip zipfile="${dist.base}/${dist.name}-src.tar.gz"
  -		src="${dist.name}-bin.tar"/>
  -	
  +        src="${dist.name}-bin.tar"/>
  +    
           <bzip2 zipfile="${dist.base}/${dist.name}-src.tar.bz2"
  -		src="${dist.name}-bin.tar"/>
  +        src="${dist.name}-bin.tar"/>
   
  -	<delete file="${dist.base}/${dist.name}-src.tar"/>
  -	-->
  +    <delete file="${dist.base}/${dist.name}-src.tar"/>
  +    -->
       </target>
   
       <target name="prepare-dist"
  -	    depends="test-reports, checkstyle-report, site">
  +        depends="test-reports, checkstyle-report, site">
   
   
           <copy file="${build.conf}/LICENSE.txt" todir="${dist.dir}"/>
  @@ -461,8 +469,8 @@
       </target>
   
       <target name="dist"
  -	    depends="prepare-dist, dist-src, dist-jar, dist-bin, clean"
  -	    description="Generates a distribution (jar + docs + javadocs + unit tests + checkstyle reports)">
  +        depends="prepare-dist, dist-src, dist-jar, dist-bin, clean"
  +        description="Generates a distribution (jar + docs + javadocs + unit tests + checkstyle reports)">
   
           <checksum fileext=".md5">
             <fileset dir="${dist.base}" />
  
  
  
  1.13      +18 -2     jakarta-avalon-excalibur/instrument/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/default.properties,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- default.properties	30 Jul 2002 23:19:36 -0000	1.12
  +++ default.properties	3 Aug 2002 15:00:37 -0000	1.13
  @@ -10,8 +10,8 @@
   manager.name=${name}-manager
   Name=Excalibur Instrument
   dir-name=instrument
  -version=0.2
  -package-version=0.2
  +version=0.3
  +package-version=0.3
   year=2002
   
   # --------------------------------------------------
  @@ -32,6 +32,22 @@
   logkit.home=${basedir}/../../jakarta-avalon-logkit
   logkit.lib=${logkit.home}/build/lib
   logkit.jar=${logkit.lib}/logkit.jar
  +
  +# ----- Excalibur Component -----
  +excalibur-component.home=${basedir}/../component/dist
  +excalibur-component.jar=${excalibur-component.home}/excalibur-component-1.0.jar
  +
  +# ----- Excalibur Logger -----
  +excalibur-logger.home=${basedir}/../logger/dist
  +excalibur-logger.jar=${excalibur-logger.home}/excalibur-logger-1.0.jar
  +
  +# ----- Excalibur Pool -----
  +excalibur-pool.home=${basedir}/../pool/dist
  +excalibur-pool.jar=${excalibur-pool.home}/excalibur-pool-1.0.jar
  +
  +# ----- Excalibur Collections -----
  +excalibur-collections.home=${basedir}/../collections/dist
  +excalibur-collections.jar=${excalibur-collections.home}/excalibur-collections-1.0.jar
   
   # ----- Altrmi -----
   excalibur-altrmi.home=${basedir}/../altrmi/dist
  
  
  
  1.2       +40 -43    jakarta-avalon-excalibur/instrument/example/managerICM/data/instrument.sampledata
  
  Index: instrument.sampledata
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/example/managerICM/data/instrument.sampledata,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- instrument.sampledata	3 Aug 2002 14:59:39 -0000	1.1
  +++ instrument.sampledata	3 Aug 2002 15:00:37 -0000	1.2
  @@ -2,30 +2,30 @@
   <instrument-manager-state>
   <instrumentable name="example-instrumentable">
   <instrument name="example-instrumentable.counter-quick">
  -<sample time="1028386745200" type="counter" interval="100" size="600">
  -<history>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</history>
  +<sample time="1028386805500" type="counter" interval="100" size="600">
  +<history>1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</history>
   </sample>
  -<sample time="1028386740000" type="counter" interval="60000" size="60">
  -<history>53,557,581,582,582,590,578,598,597,577,582,570,576,544,547,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
  +<sample time="1028386800000" type="counter" interval="60000" size="60">
  +<history>55,586,557,581,582,582,590,578,598,597,577,582,570,576,544,547,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
   </sample>
  -<sample time="1028386745000" type="counter" interval="1000" size="600">
  -<history>3,10,10,10,10,10,10,10,10,10,10,10,10,10,10,7,10,10,9,10,10,10,10,10,9,10,10,9,10,10,10,9,7,9,10,5,8,7,6,7,8,9,10,9,10,10,10,10,10,10,10,5,10,8,9,10,10,9,10,10,10,9,10,10,9,10,9,10,10,10,9,10,10,10,10,10,9,10,10,10,9,10,10,10,9,10,10,10,5,8,10,9,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,9,10,10,9,10,9,10,10,10,10,9,10,10,10,9,10,10,9,9,10,10,6,9,10,10,10,10,10,7,9,10,10,10,9,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,9,10,10,10,10,10,9,10,10,10,10,10,10,9,10,10,10,9,10,10,10,10,10,9,10,10,10,10,10,10,10,9,10,7,9,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,6,10,9,10,9,10,10,10,10,10,9,10,9,9,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,9,10,10,9,10,10,9,10,10,10,8,10,10,10,10,10,10,10,10,9,10,10,9,10,10,10,10,10,10,10,10,10,9,10,10,10,9,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,9,10,10,10,10,10,10,9,10,10,10,9,10,10,10,8,10,10,10,10,10,10,8,10,10,9,10,10,10,10,10,10,10,10,9,10,10,10,9,9,9,10,10,10,10,9,7,8,10,10,9,7,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,9,10,10,10,10,10,9,10,10,9,10,10,10,9,10,5,10,10,9,10,9,10,10,9,10,9,10,10,10,10,9,10,9,10,10,10,9,10,9,10,10,10,10,9,10,10,9,10,10,10,10,9,10,8,9,10,10,9,10,10,10,9,10,10,10,10,10,10,9,10,10,9,10,10,10,10,10,10,9,10,10,10,10,9,10,10,9,9,10,10,9,9,10,10,9,10,10,9,10,9,10,10,8,10,9,9,10,9,10</history>
  +<sample time="1028386805000" type="counter" interval="1000" size="600">
  +<history>5,10,10,10,10,10,10,10,10,10,10,10,9,9,10,10,10,8,10,10,10,9,10,10,10,9,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,7,10,7,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,7,10,10,9,10,10,10,10,10,9,10,10,9,10,10,10,9,7,9,10,5,8,7,6,7,8,9,10,9,10,10,10,10,10,10,10,5,10,8,9,10,10,9,10,10,10,9,10,10,9,10,9,10,10,10,9,10,10,10,10,10,9,10,10,10,9,10,10,10,9,10,10,10,5,8,10,9,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,9,10,10,9,10,9,10,10,10,10,9,10,10,10,9,10,10,9,9,10,10,6,9,10,10,10,10,10,7,9,10,10,10,9,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,9,10,10,10,10,10,9,10,10,10,10,10,10,9,10,10,10,9,10,10,10,10,10,9,10,10,10,10,10,10,10,9,10,7,9,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,6,10,9,10,9,10,10,10,10,10,9,10,9,9,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,9,10,10,9,10,10,9,10,10,10,8,10,10,10,10,10,10,10,10,9,10,10,9,10,10,10,10,10,10,10,10,10,9,10,10,10,9,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,9,10,10,10,10,10,10,9,10,10,10,9,10,10,10,8,10,10,10,10,10,10,8,10,10,9,10,10,10,10,10,10,10,10,9,10,10,10,9,9,9,10,10,10,10,9,7,8,10,10,9,7,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,9,10,10,10,10,10,9,10,10,9,10,10,10,9,10,5,10,10,9,10,9,10,10,9,10,9,10,10,10,10,9,10,9,10,10,10,9,10,9,10,10,10,10,9,10,10,9,10,10</history>
   </sample>
   </instrument>
   <instrument name="example-instrumentable.counter-random">
  -<sample time="1028386740000" type="counter" interval="60000" size="60">
  -<history>6,47,62,58,65,56,51,71,67,55,67,57,56,61,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
  +<sample time="1028386800000" type="counter" interval="60000" size="60">
  +<history>7,66,47,62,58,65,56,51,71,67,55,67,57,56,61,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
   </sample>
  -<sample time="1028386744000" type="counter" interval="1000" size="600">
  -<history>2,0,2,1,1,1,4,2,1,0,0,0,0,0,1,0,1,1,0,1,0,0,2,1,2,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0,1,2,1,1,2,0,2,0,1,0,2,2,2,0,1,1,0,1,2,1,0,1,1,2,0,0,2,1,0,0,1,1,3,2,1,0,4,1,1,1,0,3,0,1,0,1,1,1,1,0,0,1,1,1,0,0,0,3,1,1,2,2,1,1,1,1,2,0,2,0,2,0,2,2,0,1,2,0,1,2,1,0,1,1,1,4,0,1,1,2,0,1,2,0,0,1,0,1,2,0,0,1,1,1,0,1,1,2,0,2,2,2,1,1,0,2,0,1,1,1,2,1,0,0,0,0,1,2,2,1,3,1,0,1,0,0,2,0,3,0,2,0,1,0,1,0,2,0,2,1,1,1,3,0,1,1,2,1,0,3,0,0,1,2,3,1,1,3,1,2,0,2,1,0,1,0,0,3,1,1,2,0,0,1,0,0,1,2,0,1,0,1,2,1,0,2,1,0,3,1,2,0,2,2,0,1,1,1,1,2,1,0,0,0,0,1,3,0,2,0,0,5,1,3,0,2,2,0,2,1,0,0,2,2,0,2,0,1,1,0,1,0,2,1,1,1,1,0,1,0,0,2,3,0,0,1,1,0,1,0,1,1,0,1,0,0,1,1,0,5,1,0,1,0,0,1,0,2,2,1,0,3,0,0,0,0,1,1,0,2,2,0,0,0,1,1,1,1,0,2,1,1,0,0,1,2,0,1,0,0,0,1,1,1,1,1,1,2,1,1,1,0,0,3,1,2,0,1,2,1,3,1,1,0,2,1,2,0,3,0,2,0,1,1,1,1,2,0,2,2,1,0,1,1,1,2,1,1,1,0,2,1,2,3,2,1,3,1,2,1,0,1,0,0,0,1,1,1,1,3,1,2,1,1,0,0,1,0,1,1,0,1,1,4,2,2,0,2,2,2,0,1,2,2,1,0,0,1,2,2,1,0,1,3,1,1,1,0,0,2,1,1,3,3,1,0,1,1,0,3,2,1,0,0,2,2,1,0,2,0,1,0,0,2,0,1,1,0,1,2,1,2,2,1,0,1,0,2,1,1,0,2,1,2,0,0,1,1,0,0,1,2,0,1,0,0,1,0,0,0,3,2,2,1,0,0,0,2,0,1,2,2,1,0,0,1,3,0,1,3,1,1,0,0,1,2,0,1,0,1,1,0,1,0,2,0,2,2,3,3,0,1,1,0,2,1,0,1,2,1,0,2,1,3,1,1,2,1,3,2,0,0,1,1,2,1,2,1,0,2,0,0,2,0,1,0,1,1,1,0</history>
  +<sample time="1028386804000" type="counter" interval="1000" size="600">
  +<history>1,2,1,1,2,1,0,1,1,2,0,2,2,1,0,1,1,1,2,2,1,2,0,1,2,0,0,1,0,1,2,1,3,1,1,1,2,1,2,3,2,1,1,2,0,0,2,1,1,1,2,0,2,1,1,1,0,0,0,0,2,0,2,1,1,1,4,2,1,0,0,0,0,0,1,0,1,1,0,1,0,0,2,1,2,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0,1,2,1,1,2,0,2,0,1,0,2,2,2,0,1,1,0,1,2,1,0,1,1,2,0,0,2,1,0,0,1,1,3,2,1,0,4,1,1,1,0,3,0,1,0,1,1,1,1,0,0,1,1,1,0,0,0,3,1,1,2,2,1,1,1,1,2,0,2,0,2,0,2,2,0,1,2,0,1,2,1,0,1,1,1,4,0,1,1,2,0,1,2,0,0,1,0,1,2,0,0,1,1,1,0,1,1,2,0,2,2,2,1,1,0,2,0,1,1,1,2,1,0,0,0,0,1,2,2,1,3,1,0,1,0,0,2,0,3,0,2,0,1,0,1,0,2,0,2,1,1,1,3,0,1,1,2,1,0,3,0,0,1,2,3,1,1,3,1,2,0,2,1,0,1,0,0,3,1,1,2,0,0,1,0,0,1,2,0,1,0,1,2,1,0,2,1,0,3,1,2,0,2,2,0,1,1,1,1,2,1,0,0,0,0,1,3,0,2,0,0,5,1,3,0,2,2,0,2,1,0,0,2,2,0,2,0,1,1,0,1,0,2,1,1,1,1,0,1,0,0,2,3,0,0,1,1,0,1,0,1,1,0,1,0,0,1,1,0,5,1,0,1,0,0,1,0,2,2,1,0,3,0,0,0,0,1,1,0,2,2,0,0,0,1,1,1,1,0,2,1,1,0,0,1,2,0,1,0,0,0,1,1,1,1,1,1,2,1,1,1,0,0,3,1,2,0,1,2,1,3,1,1,0,2,1,2,0,3,0,2,0,1,1,1,1,2,0,2,2,1,0,1,1,1,2,1,1,1,0,2,1,2,3,2,1,3,1,2,1,0,1,0,0,0,1,1,1,1,3,1,2,1,1,0,0,1,0,1,1,0,1,1,4,2,2,0,2,2,2,0,1,2,2,1,0,0,1,2,2,1,0,1,3,1,1,1,0,0,2,1,1,3,3,1,0,1,1,0,3,2,1,0,0,2,2,1,0,2,0,1,0,0,2,0,1,1,0,1,2,1,2,2,1,0,1,0,2,1,1,0,2,1,2,0,0,1,1,0,0,1,2,0,1,0,0,1,0,0,0,3,2,2,1,0,0,0,2,0,1,2,2,1,0,0,1,3,0,1,3</history>
   </sample>
   </instrument>
   <instrument name="example-instrumentable.counter-slow">
  -<sample time="1028386740000" type="counter" interval="60000" size="60">
  -<history>3,27,29,30,29,29,29,30,30,29,29,28,29,27,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
  +<sample time="1028386800000" type="counter" interval="60000" size="60">
  +<history>2,30,27,29,30,29,29,29,30,30,29,29,28,29,27,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
   </sample>
  -<sample time="1028386744000" type="counter" interval="1000" size="600">
  -<history>1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0</history>
  +<sample time="1028386803000" type="counter" interval="1000" size="600">
  +<history>1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1</history>
   </sample>
   </instrument>
   <instrument name="example-instrumentable.doaction-counter">
  @@ -37,61 +37,58 @@
   </sample>
   </instrument>
   <instrument name="example-instrumentable.random-quick">
  -<sample time="1028386745000" type="mean" value-total="192" interval="1000" value-count="3" size="600">
  -<history>64,46,71,44,29,56,47,58,54,62,44,37,42,42,60,53,70,55,43,55,34,43,59,47,52,39,52,56,59,56,57,33,74,32,48,32,38,47,33,54,56,43,39,37,63,63,55,41,46,50,48,37,45,52,61,37,55,60,42,41,57,32,44,63,68,42,42,45,39,53,53,67,43,75,35,67,58,41,59,51,46,41,43,55,57,53,24,33,31,59,42,56,43,56,59,31,47,37,35,66,59,36,60,37,53,54,48,54,43,33,56,44,49,71,60,39,34,40,37,50,48,42,55,31,61,36,52,36,50,49,62,58,60,47,43,50,60,54,60,45,64,55,52,42,56,59,57,32,57,44,41,50,53,44,50,48,46,60,33,50,45,38,62,46,47,20,60,43,53,57,55,48,51,48,59,23,54,53,45,40,51,55,66,41,41,36,45,48,65,64,43,53,34,60,52,54,54,53,44,45,34,59,51,47,35,36,50,47,38,62,34,60,66,48,39,48,57,55,51,43,45,34,35,51,67,48,37,61,52,46,45,47,42,46,41,63,44,45,43,41,51,56,33,42,46,54,51,48,58,58,48,54,43,52,48,46,41,43,56,63,50,49,47,42,46,70,58,47,65,57,55,48,48,53,51,28,44,63,41,35,31,50,46,53,34,54,46,45,59,40,53,40,47,47,61,67,42,52,52,53,54,51,56,45,48,43,62,45,47,67,60,58,30,39,45,55,49,44,49,41,35,65,45,53,48,49,41,42,46,49,37,46,71,57,47,34,51,63,56,52,45,69,48,49,57,41,42,53,38,47,59,58,62,39,55,40,41,39,35,47,46,38,38,54,48,48,45,41,42,50,48,57,59,49,54,43,45,46,34,66,40,49,28,46,61,46,60,42,43,50,36,55,51,53,36,49,52,69,55,54,37,41,40,51,58,56,42,45,55,60,54,61,54,40,47,42,45,39,45,47,43,40,51,37,63,56,45,52,39,54,64,57,45,42,35,56,58,58,51,51,41,42,64,53,50,45,65,38,44,47,60,58,53,34,34,42,59,44,73,51,42,44,40,50,53,47,46,40,44,47,51,49,47,26,61,58,57,44,55,36,46,44,32,45,55,50,40,36,42,37,68,57,34,43,67,35,46,45,30,36,31,52,32,51,38,44,38,57,51,43,61,48,55,47,37,66,48,48,42,35,51,48,62,53,41,56,43,63,59,62,55,54,46,45,46,45,42,44,39,47,61,46,59,58,53,64,47,40,55,40,51,54,39,40,49,55,45,40,42,50,48,46,64,61,49,52,65,38,45,51,57,51,37,41,43,38,57,45,60,44,45,45,26,47,49,75,41,49,46,34,47,25,63,40,60,52,61,45,45,55</history>
  +<sample time="1028386805000" type="mean" value-total="275" interval="1000" value-count="5" size="600">
  +<history>55,74,54,31,57,51,63,42,44,49,58,52,34,51,50,51,46,40,56,41,71,54,51,58,44,35,44,54,39,50,46,57,56,40,31,53,65,63,62,54,46,62,45,52,58,52,46,56,62,42,41,43,53,41,28,41,49,42,58,38,57,46,71,44,29,56,47,58,54,62,44,37,42,42,60,53,70,55,43,55,34,43,59,47,52,39,52,56,59,56,57,33,74,32,48,32,38,47,33,54,56,43,39,37,63,63,55,41,46,50,48,37,45,52,61,37,55,60,42,41,57,32,44,63,68,42,42,45,39,53,53,67,43,75,35,67,58,41,59,51,46,41,43,55,57,53,24,33,31,59,42,56,43,56,59,31,47,37,35,66,59,36,60,37,53,54,48,54,43,33,56,44,49,71,60,39,34,40,37,50,48,42,55,31,61,36,52,36,50,49,62,58,60,47,43,50,60,54,60,45,64,55,52,42,56,59,57,32,57,44,41,50,53,44,50,48,46,60,33,50,45,38,62,46,47,20,60,43,53,57,55,48,51,48,59,23,54,53,45,40,51,55,66,41,41,36,45,48,65,64,43,53,34,60,52,54,54,53,44,45,34,59,51,47,35,36,50,47,38,62,34,60,66,48,39,48,57,55,51,43,45,34,35,51,67,48,37,61,52,46,45,47,42,46,41,63,44,45,43,41,51,56,33,42,46,54,51,48,58,58,48,54,43,52,48,46,41,43,56,63,50,49,47,42,46,70,58,47,65,57,55,48,48,53,51,28,44,63,41,35,31,50,46,53,34,54,46,45,59,40,53,40,47,47,61,67,42,52,52,53,54,51,56,45,48,43,62,45,47,67,60,58,30,39,45,55,49,44,49,41,35,65,45,53,48,49,41,42,46,49,37,46,71,57,47,34,51,63,56,52,45,69,48,49,57,41,42,53,38,47,59,58,62,39,55,40,41,39,35,47,46,38,38,54,48,48,45,41,42,50,48,57,59,49,54,43,45,46,34,66,40,49,28,46,61,46,60,42,43,50,36,55,51,53,36,49,52,69,55,54,37,41,40,51,58,56,42,45,55,60,54,61,54,40,47,42,45,39,45,47,43,40,51,37,63,56,45,52,39,54,64,57,45,42,35,56,58,58,51,51,41,42,64,53,50,45,65,38,44,47,60,58,53,34,34,42,59,44,73,51,42,44,40,50,53,47,46,40,44,47,51,49,47,26,61,58,57,44,55,36,46,44,32,45,55,50,40,36,42,37,68,57,34,43,67,35,46,45,30,36,31,52,32,51,38,44,38,57,51,43,61,48,55,47,37,66,48,48,42,35,51,48,62,53,41,56,43,63,59,62,55,54,46,45,46,45,42,44,39,47</history>
   </sample>
  -<sample time="1028386745000" last-value="58" type="maximum" interval="1000" value-count="3" size="600">
  -<history>84,91,99,96,67,97,92,84,98,98,88,57,84,94,99,96,95,99,92,77,78,94,98,94,99,78,92,92,99,99,97,74,98,86,96,73,95,98,68,89,96,81,99,87,99,99,98,64,95,76,95,71,99,90,89,93,93,92,98,76,91,92,81,99,85,85,92,99,71,99,99,99,87,98,98,97,96,93,97,93,99,81,89,94,97,85,52,51,53,98,84,93,82,93,86,87,86,89,93,94,96,99,99,88,95,93,94,86,77,62,94,98,76,99,96,80,93,93,97,97,91,93,90,89,98,87,87,76,87,82,93,89,96,91,97,98,90,87,94,88,98,96,96,67,92,83,94,76,98,83,83,81,93,93,90,95,93,93,82,96,96,96,99,71,97,53,89,76,87,97,98,90,87,80,96,80,93,89,78,97,89,96,99,81,85,75,88,90,98,90,92,98,83,98,87,99,92,92,95,84,95,97,88,88,87,88,89,67,99,92,66,88,91,77,70,83,88,87,87,84,89,92,84,92,86,89,99,98,89,93,76,86,95,92,79,95,93,89,81,78,95,93,95,92,95,97,88,85,92,93,89,84,80,97,97,98,88,98,99,95,92,96,81,69,91,99,89,72,91,94,94,91,91,91,96,69,85,99,85,99,85,98,88,83,86,97,99,81,95,85,96,77,97,92,99,96,89,93,88,92,97,99,99,75,83,91,98,96,98,99,99,99,66,70,81,92,97,89,97,79,56,89,91,89,96,99,89,69,83,88,82,89,98,98,81,90,98,99,96,97,69,96,91,90,88,92,77,78,75,71,93,80,93,81,99,93,96,93,92,90,99,83,99,88,83,99,95,90,93,97,98,88,89,97,86,74,93,70,99,93,91,89,97,84,98,83,93,92,91,97,70,95,94,92,71,88,84,97,94,90,65,78,86,97,94,99,94,93,93,97,99,94,96,87,95,96,98,69,97,89,96,92,97,96,95,96,98,96,97,87,99,97,78,83,72,90,95,99,94,97,93,73,97,97,96,74,98,98,83,99,96,84,99,92,97,84,94,97,98,99,75,85,74,91,89,91,81,78,93,89,91,84,87,53,95,94,92,90,75,81,92,95,94,90,86,88,85,86,95,85,95,99,95,99,97,75,99,96,77,77,90,87,59,97,85,94,80,86,88,80,92,87,96,99,79,99,86,92,93,75,94,95,99,93,76,96,86,93,95,98,94,92,95,98,88,94,99,97,85,96,97,99,94,87,88,91,78,82,98,95,98,92,66,68,96,95,96,96,82,98,95,87,90,85,87,91,98,83,97,67,93,96,94,98,94,91,98,88,84,87,98,95,94,99,95,97,83,83,78,93,81,64,98,80,90,96,80,93,87,99</history>
  +<sample time="1028386805000" last-value="30" type="maximum" interval="1000" value-count="5" size="600">
  +<history>88,99,81,72,97,87,99,83,83,99,95,96,79,84,89,95,93,73,83,72,99,97,94,92,82,79,92,86,60,89,77,94,98,94,69,83,96,94,96,72,98,98,99,87,94,97,78,84,97,98,90,98,90,81,62,73,94,92,98,69,91,91,99,96,67,97,92,84,98,98,88,57,84,94,99,96,95,99,92,77,78,94,98,94,99,78,92,92,99,99,97,74,98,86,96,73,95,98,68,89,96,81,99,87,99,99,98,64,95,76,95,71,99,90,89,93,93,92,98,76,91,92,81,99,85,85,92,99,71,99,99,99,87,98,98,97,96,93,97,93,99,81,89,94,97,85,52,51,53,98,84,93,82,93,86,87,86,89,93,94,96,99,99,88,95,93,94,86,77,62,94,98,76,99,96,80,93,93,97,97,91,93,90,89,98,87,87,76,87,82,93,89,96,91,97,98,90,87,94,88,98,96,96,67,92,83,94,76,98,83,83,81,93,93,90,95,93,93,82,96,96,96,99,71,97,53,89,76,87,97,98,90,87,80,96,80,93,89,78,97,89,96,99,81,85,75,88,90,98,90,92,98,83,98,87,99,92,92,95,84,95,97,88,88,87,88,89,67,99,92,66,88,91,77,70,83,88,87,87,84,89,92,84,92,86,89,99,98,89,93,76,86,95,92,79,95,93,89,81,78,95,93,95,92,95,97,88,85,92,93,89,84,80,97,97,98,88,98,99,95,92,96,81,69,91,99,89,72,91,94,94,91,91,91,96,69,85,99,85,99,85,98,88,83,86,97,99,81,95,85,96,77,97,92,99,96,89,93,88,92,97,99,99,75,83,91,98,96,98,99,99,99,66,70,81,92,97,89,97,79,56,89,91,89,96,99,89,69,83,88,82,89,98,98,81,90,98,99,96,97,69,96,91,90,88,92,77,78,75,71,93,80,93,81,99,93,96,93,92,90,99,83,99,88,83,99,95,90,93,97,98,88,89,97,86,74,93,70,99,93,91,89,97,84,98,83,93,92,91,97,70,95,94,92,71,88,84,97,94,90,65,78,86,97,94,99,94,93,93,97,99,94,96,87,95,96,98,69,97,89,96,92,97,96,95,96,98,96,97,87,99,97,78,83,72,90,95,99,94,97,93,73,97,97,96,74,98,98,83,99,96,84,99,92,97,84,94,97,98,99,75,85,74,91,89,91,81,78,93,89,91,84,87,53,95,94,92,90,75,81,92,95,94,90,86,88,85,86,95,85,95,99,95,99,97,75,99,96,77,77,90,87,59,97,85,94,80,86,88,80,92,87,96,99,79,99,86,92,93,75,94,95,99,93,76,96,86,93,95,98,94,92,95,98,88,94,99,97,85,96</history>
   </sample>
  -<sample time="1028386745000" last-value="58" type="minimum" interval="1000" value-count="3" size="600">
  -<history>50,5,11,1,1,3,2,16,12,13,0,10,3,7,22,9,38,9,4,28,0,1,4,0,1,8,3,8,17,6,18,6,20,9,0,0,7,0,7,29,2,10,0,4,20,7,6,6,0,7,4,13,9,3,30,1,14,19,6,20,20,1,1,31,40,8,12,8,4,22,12,13,0,13,6,37,23,3,33,19,0,2,1,1,24,16,1,3,1,15,6,3,2,8,11,2,3,5,3,45,30,9,14,2,5,7,10,7,15,0,28,1,22,18,16,17,1,0,4,3,8,13,16,0,13,2,12,3,2,18,0,8,11,3,2,8,10,21,15,4,42,3,4,6,5,22,12,1,22,0,6,19,1,1,5,0,18,2,1,7,2,4,22,1,2,1,23,6,13,26,2,0,16,20,14,0,15,6,11,3,7,0,18,14,2,3,11,2,13,48,5,14,7,9,11,0,3,18,4,4,1,30,8,4,15,4,9,6,3,30,1,50,28,10,13,18,11,16,6,6,3,4,0,6,44,13,1,0,1,6,18,0,5,9,4,35,2,8,12,3,4,8,3,7,14,9,17,25,19,42,3,24,3,5,2,15,2,0,15,39,32,17,4,8,5,12,6,26,34,1,6,0,0,23,10,0,3,10,3,0,1,12,0,26,2,12,3,3,12,0,13,8,0,1,26,39,5,4,10,21,14,3,5,0,0,5,14,7,4,12,3,14,0,7,8,23,14,1,1,4,11,29,3,6,3,0,5,5,5,3,2,0,33,1,1,0,3,4,9,1,13,32,4,5,12,1,8,25,1,27,4,37,7,0,0,4,3,1,0,0,4,1,1,4,4,8,2,3,6,0,1,19,0,18,6,7,1,7,2,22,4,1,2,1,23,1,21,0,0,11,5,17,1,14,6,3,2,29,9,26,1,1,0,5,26,6,9,6,12,13,12,23,11,1,0,0,4,7,2,8,5,0,21,4,26,4,18,24,6,20,14,16,2,2,14,12,10,6,1,3,6,13,7,4,5,14,15,1,22,4,5,31,21,1,1,9,1,1,44,5,0,3,1,0,1,8,5,12,5,16,0,14,2,2,19,24,11,1,20,8,16,3,4,1,0,14,4,0,7,0,26,19,7,13,10,0,8,2,0,1,2,2,2,21,0,2,16,6,0,21,25,5,11,3,2,15,6,2,18,3,11,4,33,18,5,1,3,0,30,28,25,16,10,5,0,12,2,1,0,13,8,3,9,5,3,15,16,1,6,2,7,7,18,14,7,29,0,2,12,13,0,7,7,23,16,22,4,0,4,26,10,13,4,2,0,2,6,8,22,1,3,7,7,0,11,18,0,0,7,3,6,2,13,6,9,6,22,3,7,3</history>
  +<sample time="1028386805000" last-value="30" type="minimum" interval="1000" value-count="5" size="600">
  +<history>8,35,11,7,5,0,13,5,4,10,7,11,1,1,8,2,2,11,9,4,31,2,10,17,3,7,2,1,2,2,6,8,3,0,3,2,5,33,15,4,3,8,2,4,0,10,9,17,32,0,7,11,11,11,4,1,11,4,15,12,3,5,11,1,1,3,2,16,12,13,0,10,3,7,22,9,38,9,4,28,0,1,4,0,1,8,3,8,17,6,18,6,20,9,0,0,7,0,7,29,2,10,0,4,20,7,6,6,0,7,4,13,9,3,30,1,14,19,6,20,20,1,1,31,40,8,12,8,4,22,12,13,0,13,6,37,23,3,33,19,0,2,1,1,24,16,1,3,1,15,6,3,2,8,11,2,3,5,3,45,30,9,14,2,5,7,10,7,15,0,28,1,22,18,16,17,1,0,4,3,8,13,16,0,13,2,12,3,2,18,0,8,11,3,2,8,10,21,15,4,42,3,4,6,5,22,12,1,22,0,6,19,1,1,5,0,18,2,1,7,2,4,22,1,2,1,23,6,13,26,2,0,16,20,14,0,15,6,11,3,7,0,18,14,2,3,11,2,13,48,5,14,7,9,11,0,3,18,4,4,1,30,8,4,15,4,9,6,3,30,1,50,28,10,13,18,11,16,6,6,3,4,0,6,44,13,1,0,1,6,18,0,5,9,4,35,2,8,12,3,4,8,3,7,14,9,17,25,19,42,3,24,3,5,2,15,2,0,15,39,32,17,4,8,5,12,6,26,34,1,6,0,0,23,10,0,3,10,3,0,1,12,0,26,2,12,3,3,12,0,13,8,0,1,26,39,5,4,10,21,14,3,5,0,0,5,14,7,4,12,3,14,0,7,8,23,14,1,1,4,11,29,3,6,3,0,5,5,5,3,2,0,33,1,1,0,3,4,9,1,13,32,4,5,12,1,8,25,1,27,4,37,7,0,0,4,3,1,0,0,4,1,1,4,4,8,2,3,6,0,1,19,0,18,6,7,1,7,2,22,4,1,2,1,23,1,21,0,0,11,5,17,1,14,6,3,2,29,9,26,1,1,0,5,26,6,9,6,12,13,12,23,11,1,0,0,4,7,2,8,5,0,21,4,26,4,18,24,6,20,14,16,2,2,14,12,10,6,1,3,6,13,7,4,5,14,15,1,22,4,5,31,21,1,1,9,1,1,44,5,0,3,1,0,1,8,5,12,5,16,0,14,2,2,19,24,11,1,20,8,16,3,4,1,0,14,4,0,7,0,26,19,7,13,10,0,8,2,0,1,2,2,2,21,0,2,16,6,0,21,25,5,11,3,2,15,6,2,18,3,11,4,33,18,5,1,3,0,30,28,25,16,10,5,0,12,2,1,0,13</history>
   </sample>
   </instrument>
   <instrument name="example-instrumentable.random-random">
  -<sample time="1028386744000" type="mean" value-total="34" interval="1000" value-count="2" size="600">
  -<history>17,8,8,95,93,18,29,54,48,49,49,49,49,49,49,46,46,42,28,28,17,17,17,43,59,54,54,54,1,1,1,1,4,4,4,4,4,47,47,66,66,64,29,49,56,49,49,31,31,18,18,46,61,97,97,23,12,12,61,78,29,29,45,45,37,37,37,86,3,3,3,55,32,30,62,61,61,52,19,63,37,37,9,9,7,7,8,97,7,94,94,94,0,64,63,63,63,63,11,43,75,65,59,92,82,35,55,64,64,90,90,51,51,9,32,32,7,60,60,67,40,88,88,81,99,43,82,82,61,30,59,59,40,11,11,11,69,69,35,14,14,14,79,90,42,42,30,75,66,66,41,55,13,85,55,55,60,60,39,32,14,96,49,49,49,49,49,44,54,20,44,86,5,5,29,29,29,64,64,3,3,58,58,75,75,30,30,80,80,99,6,17,45,15,15,83,62,73,41,41,78,78,78,61,25,9,79,31,82,57,76,76,20,70,70,52,52,52,95,58,58,77,77,77,10,10,10,37,68,68,30,30,64,61,29,29,81,34,34,95,67,11,11,49,94,94,10,27,4,61,0,8,8,8,8,8,55,53,53,62,62,62,94,57,45,45,33,76,76,0,48,48,48,55,30,30,68,68,32,18,18,37,37,17,30,77,80,47,47,90,90,90,86,49,49,49,3,74,74,63,63,32,89,89,19,19,19,51,48,48,51,13,13,67,67,67,56,56,18,85,49,49,75,75,75,75,75,3,48,48,56,53,53,53,53,19,2,71,26,26,42,76,41,41,41,54,86,86,38,38,38,38,49,39,43,4,12,25,36,7,77,39,39,39,60,71,10,10,38,29,61,93,69,73,73,15,44,42,42,30,30,78,78,88,91,35,63,63,63,60,44,83,83,86,64,47,70,11,23,75,75,25,51,84,47,42,52,34,34,87,54,54,47,47,47,47,82,46,85,58,79,8,14,21,62,62,62,47,47,65,15,15,45,59,40,59,74,74,59,57,62,62,74,76,41,7,7,7,41,69,63,10,10,56,59,9,94,23,23,23,70,3,58,18,64,84,84,84,33,33,65,63,63,63,63,39,53,38,38,13,13,91,91,91,74,74,13,61,61,45,54,35,23,7,42,42,56,56,73,65,25,25,82,63,32,32,32,60,8,8,8,63,16,16,8,8,8,57,57,57,57,61,49,61,33,33,33,33,40,40,51,70,92,6,6,6,39,55,55,12,72,58,50,50,50,24,46,46,79,79,3,76,76,63,63,34,34,58,36,42,86,86,47,59,59,76,29,29,64,91,75,75,27,63,97,56,43,8,47,72,71,71,71,86,41,32,20,28,64,64,55,55,55,7,7,9,9,86,82,18</history>
  +<sample time="1028386804000" type="mean" value-total="91" interval="1000" value-count="1" size="600">
  +<history>91,49,58,15,73,31,3,3,57,70,56,56,45,12,8,8,92,12,30,57,64,48,28,28,44,9,9,9,92,92,45,75,67,51,46,25,66,47,70,37,30,72,24,78,51,51,51,58,84,69,34,55,55,50,91,44,17,17,17,17,17,8,8,95,93,18,29,54,48,49,49,49,49,49,49,46,46,42,28,28,17,17,17,43,59,54,54,54,1,1,1,1,4,4,4,4,4,47,47,66,66,64,29,49,56,49,49,31,31,18,18,46,61,97,97,23,12,12,61,78,29,29,45,45,37,37,37,86,3,3,3,55,32,30,62,61,61,52,19,63,37,37,9,9,7,7,8,97,7,94,94,94,0,64,63,63,63,63,11,43,75,65,59,92,82,35,55,64,64,90,90,51,51,9,32,32,7,60,60,67,40,88,88,81,99,43,82,82,61,30,59,59,40,11,11,11,69,69,35,14,14,14,79,90,42,42,30,75,66,66,41,55,13,85,55,55,60,60,39,32,14,96,49,49,49,49,49,44,54,20,44,86,5,5,29,29,29,64,64,3,3,58,58,75,75,30,30,80,80,99,6,17,45,15,15,83,62,73,41,41,78,78,78,61,25,9,79,31,82,57,76,76,20,70,70,52,52,52,95,58,58,77,77,77,10,10,10,37,68,68,30,30,64,61,29,29,81,34,34,95,67,11,11,49,94,94,10,27,4,61,0,8,8,8,8,8,55,53,53,62,62,62,94,57,45,45,33,76,76,0,48,48,48,55,30,30,68,68,32,18,18,37,37,17,30,77,80,47,47,90,90,90,86,49,49,49,3,74,74,63,63,32,89,89,19,19,19,51,48,48,51,13,13,67,67,67,56,56,18,85,49,49,75,75,75,75,75,3,48,48,56,53,53,53,53,19,2,71,26,26,42,76,41,41,41,54,86,86,38,38,38,38,49,39,43,4,12,25,36,7,77,39,39,39,60,71,10,10,38,29,61,93,69,73,73,15,44,42,42,30,30,78,78,88,91,35,63,63,63,60,44,83,83,86,64,47,70,11,23,75,75,25,51,84,47,42,52,34,34,87,54,54,47,47,47,47,82,46,85,58,79,8,14,21,62,62,62,47,47,65,15,15,45,59,40,59,74,74,59,57,62,62,74,76,41,7,7,7,41,69,63,10,10,56,59,9,94,23,23,23,70,3,58,18,64,84,84,84,33,33,65,63,63,63,63,39,53,38,38,13,13,91,91,91,74,74,13,61,61,45,54,35,23,7,42,42,56,56,73,65,25,25,82,63,32,32,32,60,8,8,8,63,16,16,8,8,8,57,57,57,57,61,49,61,33,33,33,33,40,40,51,70,92,6,6,6,39,55,55,12</history>
   </sample>
  -<sample time="1028386744000" last-value="25" type="maximum" interval="1000" value-count="2" size="600">
  -<history>25,15,15,95,93,18,69,95,48,49,49,49,49,49,49,46,46,42,28,28,12,12,22,43,92,54,54,54,1,1,1,1,4,4,4,4,4,47,47,66,66,70,29,49,65,8,90,31,31,35,35,78,84,97,97,23,12,12,64,78,29,29,45,70,9,9,66,86,3,3,3,55,56,37,62,73,96,52,19,63,16,70,9,9,7,7,8,97,7,94,94,94,0,64,51,51,51,84,11,43,83,88,59,92,82,35,67,78,78,99,99,81,81,18,32,32,8,60,60,69,40,88,88,81,99,86,82,82,61,37,59,59,77,11,11,11,69,69,38,14,14,14,79,90,42,42,30,98,42,90,62,69,13,85,72,72,60,60,39,32,20,96,49,49,49,49,49,60,61,20,85,86,5,5,8,8,50,60,79,1,6,58,58,75,75,3,57,72,89,99,6,17,60,15,15,83,75,73,70,70,78,78,78,62,43,9,79,87,82,64,67,85,20,70,70,70,70,70,95,58,72,77,77,77,10,10,10,64,68,68,30,30,97,61,44,44,81,75,75,95,97,23,23,57,94,94,10,27,4,82,0,8,8,8,8,8,69,73,73,69,69,82,94,99,10,80,34,93,93,0,51,51,51,86,53,53,68,68,32,18,18,29,45,17,30,77,80,47,47,92,92,92,97,49,49,49,3,74,74,63,63,32,89,89,19,19,19,51,58,89,51,13,13,67,67,67,47,66,27,85,31,97,75,75,75,75,75,3,29,67,64,53,53,53,53,19,2,71,15,38,42,76,41,41,41,58,86,86,38,38,38,38,49,39,43,4,12,29,36,7,77,69,69,69,60,77,10,10,50,29,98,93,69,56,90,15,65,23,59,1,60,78,78,88,91,35,73,52,75,92,44,83,83,86,64,90,70,11,23,74,77,25,68,96,95,42,78,34,41,87,54,54,47,47,47,47,82,46,85,94,79,10,14,21,62,62,62,47,47,65,15,15,45,94,73,94,62,86,92,76,62,62,76,78,41,7,7,7,44,98,63,10,10,72,59,9,94,13,13,33,70,3,97,51,64,84,84,84,28,42,89,63,92,92,92,62,53,73,73,13,13,89,89,94,74,74,13,61,61,67,54,39,32,7,42,42,33,79,73,65,14,36,82,67,32,32,32,60,8,8,8,91,16,16,8,8,8,57,57,57,62,86,55,61,53,53,53,53,40,40,75,75,92,6,6,6,59,55,55,23,72,58,50,50,50,47,46,46,79,79,3,76,76,68,68,49,49,64,51,76,86,86,47,28,90,76,29,29,74,91,54,97,27,90,97,56,56,8,88,77,71,71,71,86,79,32,29,28,84,84,43,43,68,7,7,9,9,86,82,18</history>
  +<sample time="1028386804000" last-value="91" type="maximum" interval="1000" value-count="1" size="600">
  +<history>91,68,58,15,73,31,3,3,57,74,48,64,58,12,8,8,92,12,45,61,64,84,28,28,85,9,9,9,92,92,46,75,83,51,46,25,83,47,86,55,61,72,24,84,17,17,86,58,84,69,40,43,67,50,91,44,25,25,25,25,25,15,15,95,93,18,69,95,48,49,49,49,49,49,49,46,46,42,28,28,12,12,22,43,92,54,54,54,1,1,1,1,4,4,4,4,4,47,47,66,66,70,29,49,65,8,90,31,31,35,35,78,84,97,97,23,12,12,64,78,29,29,45,70,9,9,66,86,3,3,3,55,56,37,62,73,96,52,19,63,16,70,9,9,7,7,8,97,7,94,94,94,0,64,51,51,51,84,11,43,83,88,59,92,82,35,67,78,78,99,99,81,81,18,32,32,8,60,60,69,40,88,88,81,99,86,82,82,61,37,59,59,77,11,11,11,69,69,38,14,14,14,79,90,42,42,30,98,42,90,62,69,13,85,72,72,60,60,39,32,20,96,49,49,49,49,49,60,61,20,85,86,5,5,8,8,50,60,79,1,6,58,58,75,75,3,57,72,89,99,6,17,60,15,15,83,75,73,70,70,78,78,78,62,43,9,79,87,82,64,67,85,20,70,70,70,70,70,95,58,72,77,77,77,10,10,10,64,68,68,30,30,97,61,44,44,81,75,75,95,97,23,23,57,94,94,10,27,4,82,0,8,8,8,8,8,69,73,73,69,69,82,94,99,10,80,34,93,93,0,51,51,51,86,53,53,68,68,32,18,18,29,45,17,30,77,80,47,47,92,92,92,97,49,49,49,3,74,74,63,63,32,89,89,19,19,19,51,58,89,51,13,13,67,67,67,47,66,27,85,31,97,75,75,75,75,75,3,29,67,64,53,53,53,53,19,2,71,15,38,42,76,41,41,41,58,86,86,38,38,38,38,49,39,43,4,12,29,36,7,77,69,69,69,60,77,10,10,50,29,98,93,69,56,90,15,65,23,59,1,60,78,78,88,91,35,73,52,75,92,44,83,83,86,64,90,70,11,23,74,77,25,68,96,95,42,78,34,41,87,54,54,47,47,47,47,82,46,85,94,79,10,14,21,62,62,62,47,47,65,15,15,45,94,73,94,62,86,92,76,62,62,76,78,41,7,7,7,44,98,63,10,10,72,59,9,94,13,13,33,70,3,97,51,64,84,84,84,28,42,89,63,92,92,92,62,53,73,73,13,13,89,89,94,74,74,13,61,61,67,54,39,32,7,42,42,33,79,73,65,14,36,82,67,32,32,32,60,8,8,8,91,16,16,8,8,8,57,57,57,62,86,55,61,53,53,53,53,40,40,75,75,92,6,6,6,59,55,55,23</history>
   </sample>
  -<sample time="1028386744000" last-value="25" type="minimum" interval="1000" value-count="2" size="600">
  -<history>9,15,1,95,93,18,9,14,48,49,49,49,49,49,49,46,46,42,28,28,12,12,12,43,26,54,54,54,1,1,1,1,4,4,4,4,4,47,47,66,66,59,29,49,48,8,8,31,31,35,2,15,39,97,97,23,12,12,58,78,29,29,45,21,9,9,9,86,3,3,3,55,0,24,62,73,24,52,19,63,16,16,9,9,7,7,8,97,7,94,94,94,0,64,51,51,51,51,11,43,67,43,59,92,82,35,44,78,50,99,81,81,21,0,32,32,7,60,60,66,40,88,88,81,99,19,82,82,61,24,59,59,3,11,11,11,69,69,32,14,14,14,79,90,42,42,30,52,42,42,21,42,13,85,72,39,60,60,39,32,8,96,49,49,49,49,49,29,48,20,7,86,5,5,8,8,8,60,55,1,1,58,58,75,75,3,3,72,72,99,6,17,21,15,15,83,50,73,70,17,78,78,78,61,17,9,79,0,82,50,67,67,20,70,70,70,70,27,95,58,45,77,77,77,10,10,10,10,68,68,30,30,31,61,44,15,81,75,6,95,37,23,0,41,94,94,10,27,4,41,0,8,8,8,8,8,41,73,33,69,69,46,94,15,10,10,32,93,60,0,51,51,45,24,53,8,68,68,32,18,18,29,29,17,30,77,80,47,47,92,92,89,65,49,49,49,3,74,74,63,63,32,89,89,19,19,19,51,58,23,51,13,13,67,67,67,47,47,10,85,31,20,75,75,75,75,75,3,29,29,48,53,53,53,53,19,2,71,15,15,42,76,41,41,41,50,86,86,38,38,38,38,49,39,43,4,12,21,36,7,77,69,69,18,60,66,10,10,26,29,19,93,69,56,56,15,24,23,23,1,1,78,78,88,91,35,53,52,52,28,44,83,83,86,64,5,70,11,23,74,74,25,34,65,0,42,3,34,28,87,54,54,47,47,47,47,82,46,85,12,79,6,14,21,62,62,62,47,47,65,15,15,45,24,8,24,62,62,27,39,62,62,73,75,41,7,7,7,38,40,63,10,10,45,59,9,94,13,13,13,70,3,19,1,64,84,84,84,28,28,41,63,92,92,35,16,53,73,4,13,13,89,89,89,74,74,13,61,61,24,54,32,15,7,42,42,33,33,73,65,14,14,82,59,32,32,32,60,8,8,8,36,16,16,8,8,8,57,57,57,52,37,43,61,53,53,53,14,40,40,28,65,92,6,6,6,17,55,55,7,72,58,50,50,50,1,46,46,79,79,3,76,76,68,59,49,20,52,25,16,86,86,47,28,28,76,29,29,55,91,54,54,27,41,97,56,30,8,3,68,71,71,71,86,4,32,11,28,84,45,43,43,43,7,7,9,9,86,82,18</history>
  +<sample time="1028386804000" last-value="91" type="minimum" interval="1000" value-count="1" size="600">
  +<history>91,31,58,15,73,31,3,3,57,66,48,48,32,12,8,8,92,12,15,54,64,13,28,28,4,9,9,9,92,92,44,75,53,51,46,25,49,47,54,9,0,72,24,72,17,17,17,58,84,69,28,43,43,50,91,44,25,25,25,25,9,15,1,95,93,18,9,14,48,49,49,49,49,49,49,46,46,42,28,28,12,12,12,43,26,54,54,54,1,1,1,1,4,4,4,4,4,47,47,66,66,59,29,49,48,8,8,31,31,35,2,15,39,97,97,23,12,12,58,78,29,29,45,21,9,9,9,86,3,3,3,55,0,24,62,73,24,52,19,63,16,16,9,9,7,7,8,97,7,94,94,94,0,64,51,51,51,51,11,43,67,43,59,92,82,35,44,78,50,99,81,81,21,0,32,32,7,60,60,66,40,88,88,81,99,19,82,82,61,24,59,59,3,11,11,11,69,69,32,14,14,14,79,90,42,42,30,52,42,42,21,42,13,85,72,39,60,60,39,32,8,96,49,49,49,49,49,29,48,20,7,86,5,5,8,8,8,60,55,1,1,58,58,75,75,3,3,72,72,99,6,17,21,15,15,83,50,73,70,17,78,78,78,61,17,9,79,0,82,50,67,67,20,70,70,70,70,27,95,58,45,77,77,77,10,10,10,10,68,68,30,30,31,61,44,15,81,75,6,95,37,23,0,41,94,94,10,27,4,41,0,8,8,8,8,8,41,73,33,69,69,46,94,15,10,10,32,93,60,0,51,51,45,24,53,8,68,68,32,18,18,29,29,17,30,77,80,47,47,92,92,89,65,49,49,49,3,74,74,63,63,32,89,89,19,19,19,51,58,23,51,13,13,67,67,67,47,47,10,85,31,20,75,75,75,75,75,3,29,29,48,53,53,53,53,19,2,71,15,15,42,76,41,41,41,50,86,86,38,38,38,38,49,39,43,4,12,21,36,7,77,69,69,18,60,66,10,10,26,29,19,93,69,56,56,15,24,23,23,1,1,78,78,88,91,35,53,52,52,28,44,83,83,86,64,5,70,11,23,74,74,25,34,65,0,42,3,34,28,87,54,54,47,47,47,47,82,46,85,12,79,6,14,21,62,62,62,47,47,65,15,15,45,24,8,24,62,62,27,39,62,62,73,75,41,7,7,7,38,40,63,10,10,45,59,9,94,13,13,13,70,3,19,1,64,84,84,84,28,28,41,63,92,92,35,16,53,73,4,13,13,89,89,89,74,74,13,61,61,24,54,32,15,7,42,42,33,33,73,65,14,14,82,59,32,32,32,60,8,8,8,36,16,16,8,8,8,57,57,57,52,37,43,61,53,53,53,14,40,40,28,65,92,6,6,6,17,55,55,7</history>
   </sample>
   </instrument>
   <instrument name="example-instrumentable.random-slow">
  -<sample time="1028386744000" type="mean" value-total="90" interval="1000" value-count="1" size="600">
  -<history>90,61,61,1,1,33,33,71,71,65,65,90,90,86,86,86,46,46,23,23,94,94,10,10,40,40,8,8,0,0,11,11,21,21,48,48,48,6,6,6,44,44,19,19,19,78,78,76,76,27,27,30,30,59,59,26,26,75,75,70,70,70,22,22,45,45,83,83,19,19,95,95,97,97,9,9,83,83,70,70,19,19,28,28,95,95,6,6,6,35,35,45,45,48,48,20,20,63,63,12,12,65,65,54,54,38,38,84,84,14,14,31,31,43,43,33,33,77,77,74,74,91,91,75,75,75,55,55,60,60,68,68,0,0,21,21,96,96,96,73,73,11,11,3,3,13,13,43,43,79,79,78,78,70,70,26,26,3,3,79,79,70,70,35,35,94,94,68,68,47,47,36,36,75,75,77,77,25,25,64,64,72,72,50,50,89,89,19,19,91,91,6,6,6,44,44,7,7,64,64,28,28,76,76,96,96,44,44,5,5,47,47,84,84,62,62,62,28,28,74,74,62,62,20,20,75,75,74,74,80,80,30,30,76,76,55,55,31,31,75,75,76,76,90,90,98,98,78,78,27,27,36,36,12,12,5,5,68,68,0,0,0,4,4,52,52,94,94,98,98,34,34,38,38,2,2,93,93,22,22,16,16,54,54,38,38,74,74,47,47,77,77,81,81,0,0,96,96,12,12,41,41,83,83,56,56,88,88,29,29,84,84,93,93,64,64,49,49,46,46,46,69,69,85,85,41,41,82,82,53,53,67,67,63,63,53,53,40,40,53,53,85,85,34,34,74,74,28,28,88,88,88,48,48,56,56,37,37,96,96,82,82,48,48,27,27,43,43,97,97,28,28,67,67,26,26,81,81,81,81,9,9,12,12,44,44,76,76,12,12,88,88,26,26,19,19,44,44,55,55,73,73,17,17,87,87,57,57,3,3,53,53,40,40,40,55,55,23,23,59,59,12,12,87,87,59,59,30,30,67,67,87,87,33,33,76,76,1,1,58,58,63,63,97,97,41,41,57,57,22,22,69,69,84,84,19,19,8,8,20,20,53,53,54,54,55,55,90,90,45,45,9,9,26,26,77,77,63,63,71,71,73,73,53,53,66,66,70,70,24,24,77,77,67,67,23,23,46,46,97,97,56,56,49,49,16,16,16,76,76,15,15,54,54,19,19,89,89,76,76,98,98,50,50,66,66,73,73,96,96,96,24,24,52,52,42,42,0,0,44,44,99,99,95,95,93,93,73,73,3,3,75,75,77,77,8,8,32,32,91,91,20,20,20,62,62,69,69,49,49,48,48,7,7,18,18,63,63,38,38,73,73,96,96,21,21,55,55,44,44,33,33,54,54,54,85,85,9,9,7</history>
  +<sample time="1028386803000" type="mean" value-total="26" interval="1000" value-count="1" size="600">
  +<history>26,62,62,38,38,17,17,61,61,27,27,19,19,65,65,17,17,85,85,60,60,84,84,23,23,23,72,72,64,64,16,16,46,46,56,56,33,33,3,3,9,9,89,89,80,80,80,80,72,72,24,24,62,62,59,59,5,5,90,90,61,61,1,1,33,33,71,71,65,65,90,90,86,86,86,46,46,23,23,94,94,10,10,40,40,8,8,0,0,11,11,21,21,48,48,48,6,6,6,44,44,19,19,19,78,78,76,76,27,27,30,30,59,59,26,26,75,75,70,70,70,22,22,45,45,83,83,19,19,95,95,97,97,9,9,83,83,70,70,19,19,28,28,95,95,6,6,6,35,35,45,45,48,48,20,20,63,63,12,12,65,65,54,54,38,38,84,84,14,14,31,31,43,43,33,33,77,77,74,74,91,91,75,75,75,55,55,60,60,68,68,0,0,21,21,96,96,96,73,73,11,11,3,3,13,13,43,43,79,79,78,78,70,70,26,26,3,3,79,79,70,70,35,35,94,94,68,68,47,47,36,36,75,75,77,77,25,25,64,64,72,72,50,50,89,89,19,19,91,91,6,6,6,44,44,7,7,64,64,28,28,76,76,96,96,44,44,5,5,47,47,84,84,62,62,62,28,28,74,74,62,62,20,20,75,75,74,74,80,80,30,30,76,76,55,55,31,31,75,75,76,76,90,90,98,98,78,78,27,27,36,36,12,12,5,5,68,68,0,0,0,4,4,52,52,94,94,98,98,34,34,38,38,2,2,93,93,22,22,16,16,54,54,38,38,74,74,47,47,77,77,81,81,0,0,96,96,12,12,41,41,83,83,56,56,88,88,29,29,84,84,93,93,64,64,49,49,46,46,46,69,69,85,85,41,41,82,82,53,53,67,67,63,63,53,53,40,40,53,53,85,85,34,34,74,74,28,28,88,88,88,48,48,56,56,37,37,96,96,82,82,48,48,27,27,43,43,97,97,28,28,67,67,26,26,81,81,81,81,9,9,12,12,44,44,76,76,12,12,88,88,26,26,19,19,44,44,55,55,73,73,17,17,87,87,57,57,3,3,53,53,40,40,40,55,55,23,23,59,59,12,12,87,87,59,59,30,30,67,67,87,87,33,33,76,76,1,1,58,58,63,63,97,97,41,41,57,57,22,22,69,69,84,84,19,19,8,8,20,20,53,53,54,54,55,55,90,90,45,45,9,9,26,26,77,77,63,63,71,71,73,73,53,53,66,66,70,70,24,24,77,77,67,67,23,23,46,46,97,97,56,56,49,49,16,16,16,76,76,15,15,54,54,19,19,89,89,76,76,98,98,50,50,66,66,73,73,96,96,96,24,24,52,52,42,42,0,0,44,44</history>
   </sample>
  -<sample time="1028386744000" last-value="90" type="maximum" interval="1000" value-count="1" size="600">
  -<history>90,61,61,1,1,33,33,71,71,65,65,90,90,86,86,86,46,46,23,23,94,94,10,10,40,40,8,8,0,0,11,11,21,21,48,48,48,6,6,6,44,44,19,19,19,78,78,76,76,27,27,30,30,59,59,26,26,75,75,70,70,70,22,22,45,45,83,83,19,19,95,95,97,97,9,9,83,83,70,70,19,19,28,28,95,95,6,6,6,35,35,45,45,48,48,20,20,63,63,12,12,65,65,54,54,38,38,84,84,14,14,31,31,43,43,33,33,77,77,74,74,91,91,75,75,75,55,55,60,60,68,68,0,0,21,21,96,96,96,73,73,11,11,3,3,13,13,43,43,79,79,78,78,70,70,26,26,3,3,79,79,70,70,35,35,94,94,68,68,47,47,36,36,75,75,77,77,25,25,64,64,72,72,50,50,89,89,19,19,91,91,6,6,6,44,44,7,7,64,64,28,28,76,76,96,96,44,44,5,5,47,47,84,84,62,62,62,28,28,74,74,62,62,20,20,75,75,74,74,80,80,30,30,76,76,55,55,31,31,75,75,76,76,90,90,98,98,78,78,27,27,36,36,12,12,5,5,68,68,0,0,0,4,4,52,52,94,94,98,98,34,34,38,38,2,2,93,93,22,22,16,16,54,54,38,38,74,74,47,47,77,77,81,81,0,0,96,96,12,12,41,41,83,83,56,56,88,88,29,29,84,84,93,93,64,64,49,49,46,46,46,69,69,85,85,41,41,82,82,53,53,67,67,63,63,53,53,40,40,53,53,85,85,34,34,74,74,28,28,88,88,88,48,48,56,56,37,37,96,96,82,82,48,48,27,27,43,43,97,97,28,28,67,67,26,26,81,81,81,81,9,9,12,12,44,44,76,76,12,12,88,88,26,26,19,19,44,44,55,55,73,73,17,17,87,87,57,57,3,3,53,53,40,40,40,55,55,23,23,59,59,12,12,87,87,59,59,30,30,67,67,87,87,33,33,76,76,1,1,58,58,63,63,97,97,41,41,57,57,22,22,69,69,84,84,19,19,8,8,20,20,53,53,54,54,55,55,90,90,45,45,9,9,26,26,77,77,63,63,71,71,73,73,53,53,66,66,70,70,24,24,77,77,67,67,23,23,46,46,97,97,56,56,49,49,16,16,16,76,76,15,15,54,54,19,19,89,89,76,76,98,98,50,50,66,66,73,73,96,96,96,24,24,52,52,42,42,0,0,44,44,99,99,95,95,93,93,73,73,3,3,75,75,77,77,8,8,32,32,91,91,20,20,20,62,62,69,69,49,49,48,48,7,7,18,18,63,63,38,38,73,73,96,96,21,21,55,55,44,44,33,33,54,54,54,85,85,9,9,7</history>
  +<sample time="1028386803000" last-value="26" type="maximum" interval="1000" value-count="1" size="600">
  +<history>26,62,62,38,38,17,17,61,61,27,27,19,19,65,65,17,17,85,85,60,60,84,84,23,23,23,72,72,64,64,16,16,46,46,56,56,33,33,3,3,9,9,89,89,80,80,80,80,72,72,24,24,62,62,59,59,5,5,90,90,61,61,1,1,33,33,71,71,65,65,90,90,86,86,86,46,46,23,23,94,94,10,10,40,40,8,8,0,0,11,11,21,21,48,48,48,6,6,6,44,44,19,19,19,78,78,76,76,27,27,30,30,59,59,26,26,75,75,70,70,70,22,22,45,45,83,83,19,19,95,95,97,97,9,9,83,83,70,70,19,19,28,28,95,95,6,6,6,35,35,45,45,48,48,20,20,63,63,12,12,65,65,54,54,38,38,84,84,14,14,31,31,43,43,33,33,77,77,74,74,91,91,75,75,75,55,55,60,60,68,68,0,0,21,21,96,96,96,73,73,11,11,3,3,13,13,43,43,79,79,78,78,70,70,26,26,3,3,79,79,70,70,35,35,94,94,68,68,47,47,36,36,75,75,77,77,25,25,64,64,72,72,50,50,89,89,19,19,91,91,6,6,6,44,44,7,7,64,64,28,28,76,76,96,96,44,44,5,5,47,47,84,84,62,62,62,28,28,74,74,62,62,20,20,75,75,74,74,80,80,30,30,76,76,55,55,31,31,75,75,76,76,90,90,98,98,78,78,27,27,36,36,12,12,5,5,68,68,0,0,0,4,4,52,52,94,94,98,98,34,34,38,38,2,2,93,93,22,22,16,16,54,54,38,38,74,74,47,47,77,77,81,81,0,0,96,96,12,12,41,41,83,83,56,56,88,88,29,29,84,84,93,93,64,64,49,49,46,46,46,69,69,85,85,41,41,82,82,53,53,67,67,63,63,53,53,40,40,53,53,85,85,34,34,74,74,28,28,88,88,88,48,48,56,56,37,37,96,96,82,82,48,48,27,27,43,43,97,97,28,28,67,67,26,26,81,81,81,81,9,9,12,12,44,44,76,76,12,12,88,88,26,26,19,19,44,44,55,55,73,73,17,17,87,87,57,57,3,3,53,53,40,40,40,55,55,23,23,59,59,12,12,87,87,59,59,30,30,67,67,87,87,33,33,76,76,1,1,58,58,63,63,97,97,41,41,57,57,22,22,69,69,84,84,19,19,8,8,20,20,53,53,54,54,55,55,90,90,45,45,9,9,26,26,77,77,63,63,71,71,73,73,53,53,66,66,70,70,24,24,77,77,67,67,23,23,46,46,97,97,56,56,49,49,16,16,16,76,76,15,15,54,54,19,19,89,89,76,76,98,98,50,50,66,66,73,73,96,96,96,24,24,52,52,42,42,0,0,44,44</history>
   </sample>
  -<sample time="1028386744000" last-value="90" type="minimum" interval="1000" value-count="1" size="600">
  -<history>90,61,61,1,1,33,33,71,71,65,65,90,90,86,86,86,46,46,23,23,94,94,10,10,40,40,8,8,0,0,11,11,21,21,48,48,48,6,6,6,44,44,19,19,19,78,78,76,76,27,27,30,30,59,59,26,26,75,75,70,70,70,22,22,45,45,83,83,19,19,95,95,97,97,9,9,83,83,70,70,19,19,28,28,95,95,6,6,6,35,35,45,45,48,48,20,20,63,63,12,12,65,65,54,54,38,38,84,84,14,14,31,31,43,43,33,33,77,77,74,74,91,91,75,75,75,55,55,60,60,68,68,0,0,21,21,96,96,96,73,73,11,11,3,3,13,13,43,43,79,79,78,78,70,70,26,26,3,3,79,79,70,70,35,35,94,94,68,68,47,47,36,36,75,75,77,77,25,25,64,64,72,72,50,50,89,89,19,19,91,91,6,6,6,44,44,7,7,64,64,28,28,76,76,96,96,44,44,5,5,47,47,84,84,62,62,62,28,28,74,74,62,62,20,20,75,75,74,74,80,80,30,30,76,76,55,55,31,31,75,75,76,76,90,90,98,98,78,78,27,27,36,36,12,12,5,5,68,68,0,0,0,4,4,52,52,94,94,98,98,34,34,38,38,2,2,93,93,22,22,16,16,54,54,38,38,74,74,47,47,77,77,81,81,0,0,96,96,12,12,41,41,83,83,56,56,88,88,29,29,84,84,93,93,64,64,49,49,46,46,46,69,69,85,85,41,41,82,82,53,53,67,67,63,63,53,53,40,40,53,53,85,85,34,34,74,74,28,28,88,88,88,48,48,56,56,37,37,96,96,82,82,48,48,27,27,43,43,97,97,28,28,67,67,26,26,81,81,81,81,9,9,12,12,44,44,76,76,12,12,88,88,26,26,19,19,44,44,55,55,73,73,17,17,87,87,57,57,3,3,53,53,40,40,40,55,55,23,23,59,59,12,12,87,87,59,59,30,30,67,67,87,87,33,33,76,76,1,1,58,58,63,63,97,97,41,41,57,57,22,22,69,69,84,84,19,19,8,8,20,20,53,53,54,54,55,55,90,90,45,45,9,9,26,26,77,77,63,63,71,71,73,73,53,53,66,66,70,70,24,24,77,77,67,67,23,23,46,46,97,97,56,56,49,49,16,16,16,76,76,15,15,54,54,19,19,89,89,76,76,98,98,50,50,66,66,73,73,96,96,96,24,24,52,52,42,42,0,0,44,44,99,99,95,95,93,93,73,73,3,3,75,75,77,77,8,8,32,32,91,91,20,20,20,62,62,69,69,49,49,48,48,7,7,18,18,63,63,38,38,73,73,96,96,21,21,55,55,44,44,33,33,54,54,54,85,85,9,9,7</history>
  +<sample time="1028386803000" last-value="26" type="minimum" interval="1000" value-count="1" size="600">
  +<history>26,62,62,38,38,17,17,61,61,27,27,19,19,65,65,17,17,85,85,60,60,84,84,23,23,23,72,72,64,64,16,16,46,46,56,56,33,33,3,3,9,9,89,89,80,80,80,80,72,72,24,24,62,62,59,59,5,5,90,90,61,61,1,1,33,33,71,71,65,65,90,90,86,86,86,46,46,23,23,94,94,10,10,40,40,8,8,0,0,11,11,21,21,48,48,48,6,6,6,44,44,19,19,19,78,78,76,76,27,27,30,30,59,59,26,26,75,75,70,70,70,22,22,45,45,83,83,19,19,95,95,97,97,9,9,83,83,70,70,19,19,28,28,95,95,6,6,6,35,35,45,45,48,48,20,20,63,63,12,12,65,65,54,54,38,38,84,84,14,14,31,31,43,43,33,33,77,77,74,74,91,91,75,75,75,55,55,60,60,68,68,0,0,21,21,96,96,96,73,73,11,11,3,3,13,13,43,43,79,79,78,78,70,70,26,26,3,3,79,79,70,70,35,35,94,94,68,68,47,47,36,36,75,75,77,77,25,25,64,64,72,72,50,50,89,89,19,19,91,91,6,6,6,44,44,7,7,64,64,28,28,76,76,96,96,44,44,5,5,47,47,84,84,62,62,62,28,28,74,74,62,62,20,20,75,75,74,74,80,80,30,30,76,76,55,55,31,31,75,75,76,76,90,90,98,98,78,78,27,27,36,36,12,12,5,5,68,68,0,0,0,4,4,52,52,94,94,98,98,34,34,38,38,2,2,93,93,22,22,16,16,54,54,38,38,74,74,47,47,77,77,81,81,0,0,96,96,12,12,41,41,83,83,56,56,88,88,29,29,84,84,93,93,64,64,49,49,46,46,46,69,69,85,85,41,41,82,82,53,53,67,67,63,63,53,53,40,40,53,53,85,85,34,34,74,74,28,28,88,88,88,48,48,56,56,37,37,96,96,82,82,48,48,27,27,43,43,97,97,28,28,67,67,26,26,81,81,81,81,9,9,12,12,44,44,76,76,12,12,88,88,26,26,19,19,44,44,55,55,73,73,17,17,87,87,57,57,3,3,53,53,40,40,40,55,55,23,23,59,59,12,12,87,87,59,59,30,30,67,67,87,87,33,33,76,76,1,1,58,58,63,63,97,97,41,41,57,57,22,22,69,69,84,84,19,19,8,8,20,20,53,53,54,54,55,55,90,90,45,45,9,9,26,26,77,77,63,63,71,71,73,73,53,53,66,66,70,70,24,24,77,77,67,67,23,23,46,46,97,97,56,56,49,49,16,16,16,76,76,15,15,54,54,19,19,89,89,76,76,98,98,50,50,66,66,73,73,96,96,96,24,24,52,52,42,42,0,0,44,44</history>
   </sample>
   </instrument>
   </instrumentable>
   <instrumentable name="instrument-manager">
   <instrument name="instrument-manager.active-thread-count">
  -<sample time="1028386744000" description="Max each 2 Seconds" last-value="9" type="maximum" interval="2000" value-count="2" lease-expiration="1028386750388" size="600">
  -<history>9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</history>
  -</sample>
  -<sample time="1028386745000" last-value="9" type="maximum" interval="1000" value-count="1" size="600">
  -<history>9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10</history>
  +<sample time="1028386805000" last-value="9" type="maximum" interval="1000" value-count="1" size="600">
  +<history>9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10</history>
   </sample>
   </instrument>
   <instrument name="instrument-manager.free-memory">
  -<sample time="1028386745000" last-value="1088128" type="minimum" interval="1000" value-count="1" size="600">
  -<history>1088128,1088144,1088160,1088176,1088192,1088208,1088224,1088240,1088256,1088272,1088288,1088304,1088320,1088336,1088352,1088368,1088384,1088400,1088416,1088432,1088448,1088464,1088480,1088496,1088512,1088528,1088544,1088560,1088576,1088592,1088608,1088624,1088640,1088656,1088672,1088688,1088704,1088720,1088736,1088752,1088768,1088784,1088784,1088800,1088816,1088832,1088848,1088864,1088880,1088896,1088912,1088928,1088944,1088960,1088976,1088992,1089008,1089024,1089040,1089056,1089072,353376,353392,353408,353424,353440,353456,353472,353488,353504,353520,353536,353552,353568,353584,353600,353616,353632,353648,353664,353680,353696,353712,353728,353744,353760,353776,353792,353808,353824,353840,353856,353872,353888,353904,353920,353936,353952,353968,353984,354000,354016,354032,354048,354064,354080,354096,354112,354128,354144,354160,354176,354192,354208,354224,354240,354256,354272,354288,354304,354320,655048,655064,655080,655096,655112,655128,655144,655160,655176,655192,655208,655224,655240,655256,655272,655288,655304,655320,655336,655352,655368,655384,655400,655416,655432,655448,655464,655480,655496,655512,655528,655544,655560,655576,655592,655608,655624,655640,655656,655672,655688,655704,655720,655736,655752,655768,655784,655800,655816,655832,655848,655864,655880,655896,655912,655928,655944,655960,655976,655992,245296,245296,245312,245328,245344,245360,245376,245392,245408,245424,245440,245456,245472,245488,245504,245520,245536,245552,245568,245600,245664,245680,245696,245712,245728,245744,245760,245776,245792,245808,245824,245840,245856,245872,245888,245904,245920,245936,245952,245968,245984,246000,246016,246032,246048,246064,246080,246096,246112,246128,246144,246160,246176,246192,246208,246224,246240,246256,246272,246288,246304,622936,622952,622968,622984,623000,623016,623032,623048,623064,623080,623096,623112,623128,623144,623160,623176,623192,623208,623224,623240,623256,623272,623288,623304,623320,623336,623352,623368,623384,623400,623416,623432,623448,623464,623480,623496,623512,623528,623544,623560,623576,623592,623608,623624,623640,623656,623672,623688,623704,623720,623736,623752,623768,623784,623800,623816,623832,623848,623864,623880,968448,968448,968464,968480,968496,968512,968528,968544,968560,968576,968592,968608,968624,968640,968656,968672,968688,968704,968720,968736,968752,968768,968784,968800,968816,968832,968848,968864,968880,968896,968912,968928,968944,968960,968976,968992,969008,969024,969040,969056,969072,969088,969104,969120,969136,969152,969168,969184,969200,969216,969232,969248,969264,969280,969296,969312,969328,969344,969360,969376,969784,182632,182648,182664,182680,182696,182712,182728,182744,182760,182776,182792,182808,182824,182840,182856,182872,182888,182904,182920,182936,182952,182968,182984,183000,183016,183032,183048,183064,183080,183096,183112,183128,183144,183160,183176,189480,189496,189512,189528,189544,189560,189576,189592,189608,189624,195928,195944,195960,195976,195992,196008,196024,196040,196056,196072,210760,210776,210792,210808,210824,500624,500640,500656,500672,500688,515280,515296,515312,515328,515344,515360,515376,515392,515408,515424,521728,521744,521760,521776,521792,521808,521824,521840,521856,521872,528176,528192,528208,528224,528240,528256,528272,528288,528304,528320,534624,534640,534656,534672,534688,534704,534720,534736,534752,534768,541072,541088,541104,541120,541136,541152,541168,541184,541200,541216,555904,555920,555936,555952,884432,884432,884432,884448,884464,884480,890784,890800,890816,890832,890848,890864,890880,890896,890912,941664,473072,523824,574576,625328,676080,726832,777584,828336,848816,879104,944216,466424,805848,856600,907352,958104,495656,546408,597160,647912,863400,914152,542504,743320,841320,892072,967176,538568,538584,635200,750360,801112,851864,902616,976992,495816,546568,597320,648072,802808,868232,942784,476304,572920,773736,908976,851600,851600,902352,953104,1003856,1060896,1111648,1162400,688920,739672,790424,841176,891928,942680,963160,999736,1050488,1101240,1151992,1202744,726568,777320,828072,878824,929576,986616,1037368,1088120,1138872,1189624,721928,772680,823432,874184,924936,991720,1042472,720136,967320,1099992,1174504,697152,747904,798656,884280,1108136,1158888,794016,854584,905336,956088,1006864,112520,142808,184960,215248</history>
  +<sample time="1028386805000" last-value="739400" type="minimum" interval="1000" value-count="1" size="600">
  +<history>739400,739416,739432,739448,739464,739480,739496,739512,739528,739544,739560,739576,739592,739608,739624,739640,739656,739672,739688,739704,739720,739736,739752,739768,739784,739800,739816,739832,739848,739864,739880,739896,739912,739928,739944,739960,739976,739992,740008,740024,740040,740056,740072,740088,740104,740120,740136,740152,740168,740184,740200,740216,740232,740248,740280,740336,740352,740368,740384,740400,1088128,1088144,1088160,1088176,1088192,1088208,1088224,1088240,1088256,1088272,1088288,1088304,1088320,1088336,1088352,1088368,1088384,1088400,1088416,1088432,1088448,1088464,1088480,1088496,1088512,1088528,1088544,1088560,1088576,1088592,1088608,1088624,1088640,1088656,1088672,1088688,1088704,1088720,1088736,1088752,1088768,1088784,1088784,1088800,1088816,1088832,1088848,1088864,1088880,1088896,1088912,1088928,1088944,1088960,1088976,1088992,1089008,1089024,1089040,1089056,1089072,353376,353392,353408,353424,353440,353456,353472,353488,353504,353520,353536,353552,353568,353584,353600,353616,353632,353648,353664,353680,353696,353712,353728,353744,353760,353776,353792,353808,353824,353840,353856,353872,353888,353904,353920,353936,353952,353968,353984,354000,354016,354032,354048,354064,354080,354096,354112,354128,354144,354160,354176,354192,354208,354224,354240,354256,354272,354288,354304,354320,655048,655064,655080,655096,655112,655128,655144,655160,655176,655192,655208,655224,655240,655256,655272,655288,655304,655320,655336,655352,655368,655384,655400,655416,655432,655448,655464,655480,655496,655512,655528,655544,655560,655576,655592,655608,655624,655640,655656,655672,655688,655704,655720,655736,655752,655768,655784,655800,655816,655832,655848,655864,655880,655896,655912,655928,655944,655960,655976,655992,245296,245296,245312,245328,245344,245360,245376,245392,245408,245424,245440,245456,245472,245488,245504,245520,245536,245552,245568,245600,245664,245680,245696,245712,245728,245744,245760,245776,245792,245808,245824,245840,245856,245872,245888,245904,245920,245936,245952,245968,245984,246000,246016,246032,246048,246064,246080,246096,246112,246128,246144,246160,246176,246192,246208,246224,246240,246256,246272,246288,246304,622936,622952,622968,622984,623000,623016,623032,623048,623064,623080,623096,623112,623128,623144,623160,623176,623192,623208,623224,623240,623256,623272,623288,623304,623320,623336,623352,623368,623384,623400,623416,623432,623448,623464,623480,623496,623512,623528,623544,623560,623576,623592,623608,623624,623640,623656,623672,623688,623704,623720,623736,623752,623768,623784,623800,623816,623832,623848,623864,623880,968448,968448,968464,968480,968496,968512,968528,968544,968560,968576,968592,968608,968624,968640,968656,968672,968688,968704,968720,968736,968752,968768,968784,968800,968816,968832,968848,968864,968880,968896,968912,968928,968944,968960,968976,968992,969008,969024,969040,969056,969072,969088,969104,969120,969136,969152,969168,969184,969200,969216,969232,969248,969264,969280,969296,969312,969328,969344,969360,969376,969784,182632,182648,182664,182680,182696,182712,182728,182744,182760,182776,182792,182808,182824,182840,182856,182872,182888,182904,182920,182936,182952,182968,182984,183000,183016,183032,183048,183064,183080,183096,183112,183128,183144,183160,183176,189480,189496,189512,189528,189544,189560,189576,189592,189608,189624,195928,195944,195960,195976,195992,196008,196024,196040,196056,196072,210760,210776,210792,210808,210824,500624,500640,500656,500672,500688,515280,515296,515312,515328,515344,515360,515376,515392,515408,515424,521728,521744,521760,521776,521792,521808,521824,521840,521856,521872,528176,528192,528208,528224,528240,528256,528272,528288,528304,528320,534624,534640,534656,534672,534688,534704,534720,534736,534752,534768,541072,541088,541104,541120,541136,541152,541168,541184,541200,541216,555904,555920,555936,555952,884432,884432,884432,884448,884464,884480,890784,890800,890816,890832,890848,890864,890880,890896,890912,941664,473072,523824,574576,625328,676080,726832,777584,828336,848816,879104,944216,466424,805848,856600,907352,958104,495656,546408,597160,647912,863400,914152,542504,743320,841320,892072,967176,538568,538584,635200,750360,801112,851864,902616,976992,495816,546568,597320,648072,802808,868232,942784</history>
   </sample>
   </instrument>
   <instrument name="instrument-manager.memory">
  -<sample time="1028386745000" last-value="1074560" type="maximum" interval="1000" value-count="1" size="600">
  -<history>1074560,1074544,1074528,1074512,1074496,1074480,1074464,1074448,1074432,1074416,1074400,1074384,1074368,1074352,1074336,1074320,1074304,1074288,1074272,1074256,1074240,1074224,1074208,1074192,1074176,1074160,1074144,1074128,1074112,1074096,1074080,1074064,1074048,1074032,1074016,1074000,1073984,1073968,1073952,1073936,1073920,1073904,1073904,1073888,1073872,1073856,1073840,1073824,1073808,1073792,1073776,1073760,1073744,1073728,1073712,1073696,1073680,1073664,1073648,1073632,1073616,1678240,1678224,1678208,1678192,1678176,1678160,1678144,1678128,1678112,1678096,1678080,1678064,1678048,1678032,1678016,1678000,1677984,1677968,1677952,1677936,1677920,1677904,1677888,1677872,1677856,1677840,1677824,1677808,1677792,1677776,1677760,1677744,1677728,1677712,1677696,1677680,1677664,1677648,1677632,1677616,1677600,1677584,1677568,1677552,1677536,1677520,1677504,1677488,1677472,1677456,1677440,1677424,1677408,1677392,1677376,1677360,1677344,1677328,1677312,1677296,1376568,1376552,1376536,1376520,1376504,1376488,1376472,1376456,1376440,1376424,1376408,1376392,1376376,1376360,1376344,1376328,1376312,1376296,1376280,1376264,1376248,1376232,1376216,1376200,1376184,1376168,1376152,1376136,1376120,1376104,1376088,1376072,1376056,1376040,1376024,1376008,1375992,1375976,1375960,1375944,1375928,1375912,1375896,1375880,1375864,1375848,1375832,1375816,1375800,1375784,1375768,1375752,1375736,1375720,1375704,1375688,1375672,1375656,1375640,1375624,1786320,1786320,1786304,1786288,1786272,1786256,1786240,1786224,1786208,1786192,1786176,1786160,1786144,1786128,1786112,1786096,1786080,1786064,1786048,1786016,1785952,1785936,1785920,1785904,1785888,1785872,1785856,1785840,1785824,1785808,1785792,1785776,1785760,1785744,1785728,1785712,1785696,1785680,1785664,1785648,1785632,1785616,1785600,1785584,1785568,1785552,1785536,1785520,1785504,1785488,1785472,1785456,1785440,1785424,1785408,1785392,1785376,1785360,1785344,1785328,1785312,1408680,1408664,1408648,1408632,1408616,1408600,1408584,1408568,1408552,1408536,1408520,1408504,1408488,1408472,1408456,1408440,1408424,1408408,1408392,1408376,1408360,1408344,1408328,1408312,1408296,1408280,1408264,1408248,1408232,1408216,1408200,1408184,1408168,1408152,1408136,1408120,1408104,1408088,1408072,1408056,1408040,1408024,1408008,1407992,1407976,1407960,1407944,1407928,1407912,1407896,1407880,1407864,1407848,1407832,1407816,1407800,1407784,1407768,1407752,1407736,1063168,1063168,1063152,1063136,1063120,1063104,1063088,1063072,1063056,1063040,1063024,1063008,1062992,1062976,1062960,1062944,1062928,1062912,1062896,1062880,1062864,1062848,1062832,1062816,1062800,1062784,1062768,1062752,1062736,1062720,1062704,1062688,1062672,1062656,1062640,1062624,1062608,1062592,1062576,1062560,1062544,1062528,1062512,1062496,1062480,1062464,1062448,1062432,1062416,1062400,1062384,1062368,1062352,1062336,1062320,1062304,1062288,1062272,1062256,1062240,1061832,1848984,1848968,1848952,1848936,1848920,1848904,1848888,1848872,1848856,1848840,1848824,1848808,1848792,1848776,1848760,1848744,1848728,1848712,1848696,1848680,1848664,1848648,1848632,1848616,1848600,1848584,1848568,1848552,1848536,1848520,1848504,1848488,1848472,1848456,1848440,1842136,1842120,1842104,1842088,1842072,1842056,1842040,1842024,1842008,1841992,1835688,1835672,1835656,1835640,1835624,1835608,1835592,1835576,1835560,1835544,1820856,1820840,1820824,1820808,1820792,1530992,1530976,1530960,1530944,1530928,1516336,1516320,1516304,1516288,1516272,1516256,1516240,1516224,1516208,1516192,1509888,1509872,1509856,1509840,1509824,1509808,1509792,1509776,1509760,1509744,1503440,1503424,1503408,1503392,1503376,1503360,1503344,1503328,1503312,1503296,1496992,1496976,1496960,1496944,1496928,1496912,1496896,1496880,1496864,1496848,1490544,1490528,1490512,1490496,1490480,1490464,1490448,1490432,1490416,1490400,1475712,1475696,1475680,1475664,1147184,1147184,1147184,1147168,1147152,1147136,1140832,1140816,1140800,1140784,1140768,1140752,1140736,1140720,1140704,1089952,1558544,1507792,1457040,1406288,1355536,1304784,1254032,1203280,1182800,1152512,1087400,1565192,1225768,1175016,1124264,1073512,1535960,1485208,1434456,1383704,1168216,1117464,1489112,1288296,1190296,1139544,1064440,1493048,1493032,1396416,1281256,1230504,1179752,1129000,1054624,1535800,1485048,1434296,1383544,1228808,1163384,1088832,1555312,1458696,1257880,1122640,1180016,1180016,1129264,1078512,1027760,970720,919968,869216,1342696,1291944,1241192,1190440,1139688,1088936,1068456,1031880,981128,930376,879624,828872,1305048,1254296,1203544,1152792,1102040,1045000,994248,943496,892744,841992,1309688,1258936,1208184,1157432,1106680,1039896,989144,1311480,1064296,931624,857112,1334464,1283712,1232960,1147336,923480,872728,1237600,1177032,1126280,1075528,1024752,1919096,1888808,1846656,1816368</history>
  +<sample time="1028386805000" last-value="1423288" type="maximum" interval="1000" value-count="1" size="600">
  +<history>1423288,1423272,1423256,1423240,1423224,1423208,1423192,1423176,1423160,1423144,1423128,1423112,1423096,1423080,1423064,1423048,1423032,1423016,1423000,1422984,1422968,1422952,1422936,1422920,1422904,1422888,1422872,1422856,1422840,1422824,1422808,1422792,1422776,1422760,1422744,1422728,1422712,1422696,1422680,1422664,1422648,1422632,1422616,1422600,1422584,1422568,1422552,1422536,1422520,1422504,1422488,1422472,1422456,1422440,1422408,1422352,1422336,1422320,1422304,1422288,1074560,1074544,1074528,1074512,1074496,1074480,1074464,1074448,1074432,1074416,1074400,1074384,1074368,1074352,1074336,1074320,1074304,1074288,1074272,1074256,1074240,1074224,1074208,1074192,1074176,1074160,1074144,1074128,1074112,1074096,1074080,1074064,1074048,1074032,1074016,1074000,1073984,1073968,1073952,1073936,1073920,1073904,1073904,1073888,1073872,1073856,1073840,1073824,1073808,1073792,1073776,1073760,1073744,1073728,1073712,1073696,1073680,1073664,1073648,1073632,1073616,1678240,1678224,1678208,1678192,1678176,1678160,1678144,1678128,1678112,1678096,1678080,1678064,1678048,1678032,1678016,1678000,1677984,1677968,1677952,1677936,1677920,1677904,1677888,1677872,1677856,1677840,1677824,1677808,1677792,1677776,1677760,1677744,1677728,1677712,1677696,1677680,1677664,1677648,1677632,1677616,1677600,1677584,1677568,1677552,1677536,1677520,1677504,1677488,1677472,1677456,1677440,1677424,1677408,1677392,1677376,1677360,1677344,1677328,1677312,1677296,1376568,1376552,1376536,1376520,1376504,1376488,1376472,1376456,1376440,1376424,1376408,1376392,1376376,1376360,1376344,1376328,1376312,1376296,1376280,1376264,1376248,1376232,1376216,1376200,1376184,1376168,1376152,1376136,1376120,1376104,1376088,1376072,1376056,1376040,1376024,1376008,1375992,1375976,1375960,1375944,1375928,1375912,1375896,1375880,1375864,1375848,1375832,1375816,1375800,1375784,1375768,1375752,1375736,1375720,1375704,1375688,1375672,1375656,1375640,1375624,1786320,1786320,1786304,1786288,1786272,1786256,1786240,1786224,1786208,1786192,1786176,1786160,1786144,1786128,1786112,1786096,1786080,1786064,1786048,1786016,1785952,1785936,1785920,1785904,1785888,1785872,1785856,1785840,1785824,1785808,1785792,1785776,1785760,1785744,1785728,1785712,1785696,1785680,1785664,1785648,1785632,1785616,1785600,1785584,1785568,1785552,1785536,1785520,1785504,1785488,1785472,1785456,1785440,1785424,1785408,1785392,1785376,1785360,1785344,1785328,1785312,1408680,1408664,1408648,1408632,1408616,1408600,1408584,1408568,1408552,1408536,1408520,1408504,1408488,1408472,1408456,1408440,1408424,1408408,1408392,1408376,1408360,1408344,1408328,1408312,1408296,1408280,1408264,1408248,1408232,1408216,1408200,1408184,1408168,1408152,1408136,1408120,1408104,1408088,1408072,1408056,1408040,1408024,1408008,1407992,1407976,1407960,1407944,1407928,1407912,1407896,1407880,1407864,1407848,1407832,1407816,1407800,1407784,1407768,1407752,1407736,1063168,1063168,1063152,1063136,1063120,1063104,1063088,1063072,1063056,1063040,1063024,1063008,1062992,1062976,1062960,1062944,1062928,1062912,1062896,1062880,1062864,1062848,1062832,1062816,1062800,1062784,1062768,1062752,1062736,1062720,1062704,1062688,1062672,1062656,1062640,1062624,1062608,1062592,1062576,1062560,1062544,1062528,1062512,1062496,1062480,1062464,1062448,1062432,1062416,1062400,1062384,1062368,1062352,1062336,1062320,1062304,1062288,1062272,1062256,1062240,1061832,1848984,1848968,1848952,1848936,1848920,1848904,1848888,1848872,1848856,1848840,1848824,1848808,1848792,1848776,1848760,1848744,1848728,1848712,1848696,1848680,1848664,1848648,1848632,1848616,1848600,1848584,1848568,1848552,1848536,1848520,1848504,1848488,1848472,1848456,1848440,1842136,1842120,1842104,1842088,1842072,1842056,1842040,1842024,1842008,1841992,1835688,1835672,1835656,1835640,1835624,1835608,1835592,1835576,1835560,1835544,1820856,1820840,1820824,1820808,1820792,1530992,1530976,1530960,1530944,1530928,1516336,1516320,1516304,1516288,1516272,1516256,1516240,1516224,1516208,1516192,1509888,1509872,1509856,1509840,1509824,1509808,1509792,1509776,1509760,1509744,1503440,1503424,1503408,1503392,1503376,1503360,1503344,1503328,1503312,1503296,1496992,1496976,1496960,1496944,1496928,1496912,1496896,1496880,1496864,1496848,1490544,1490528,1490512,1490496,1490480,1490464,1490448,1490432,1490416,1490400,1475712,1475696,1475680,1475664,1147184,1147184,1147184,1147168,1147152,1147136,1140832,1140816,1140800,1140784,1140768,1140752,1140736,1140720,1140704,1089952,1558544,1507792,1457040,1406288,1355536,1304784,1254032,1203280,1182800,1152512,1087400,1565192,1225768,1175016,1124264,1073512,1535960,1485208,1434456,1383704,1168216,1117464,1489112,1288296,1190296,1139544,1064440,1493048,1493032,1396416,1281256,1230504,1179752,1129000,1054624,1535800,1485048,1434296,1383544,1228808,1163384,1088832</history>
   </sample>
   </instrument>
   <instrument name="instrument-manager.total-memory">
  -<sample time="1028386745000" last-value="2162688" type="maximum" interval="1000" value-count="1" size="600">
  -<history>2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616</history>
  +<sample time="1028386805000" last-value="2162688" type="maximum" interval="1000" value-count="1" size="600">
  +<history>2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2162688,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616,2031616</history>
   </sample>
   </instrument>
   </instrumentable>
  
  
  
  1.2       +180 -139  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/AbstractInstrumentSample.java
  
  Index: AbstractInstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/AbstractInstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractInstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ AbstractInstrumentSample.java	3 Aug 2002 15:00:37 -0000	1.2
  @@ -11,9 +11,8 @@
   import java.util.Arrays;
   import java.util.StringTokenizer;
   
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleDescriptor;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleListener;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleSnapshot;
  +import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleUtils;
   
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -32,63 +31,75 @@
       extends AbstractLogEnabled
       implements InstrumentSample
   {
  +    /** The InstrumentProxy which owns the InstrumentSample. */
  +    private InstrumentProxy m_instrumentProxy;
  +    
  +    /** Configured flag. */
  +    private boolean m_configured;
  +    
       /** The name of the new InstrumentSample. */
       private String m_name;
  -
  +    
       /** The sample interval of the new InstrumentSample. */
       private long m_interval;
  -
  +    
       /** The number of samples to store as history. */
       private int m_size;
  -
  +    
       /** The description of the new InstrumentSample. */
       private String m_description;
  -
  +    
       /** The Descriptor for the InstrumentSample. */
  -    private InstrumentSampleDescriptor m_descriptor;
  -
  -    /**
  +    private InstrumentSampleDescriptorLocal m_descriptor;
  +    
  +    /** 
        * The maximum amount of time between updates before history will be
        * wiped clean.
        */
       private long m_maxAge;
  -
  +    
       /** The UNIX time of the beginning of the sample. */
       protected long m_time;
  -
  +    
       /** The time that the current lease expires. */
       private long m_leaseExpirationTime;
  -
  +    
       /** The Index into the history arrays. */
       private int m_historyIndex;
  -
  +    
       /** The Old half of the history array. */
       private int[] m_historyOld;
  -
  +    
       /** The New half of the history array. */
       private int[] m_historyNew;
  -
  +    
       /** Array of registered InstrumentSampleListeners. */
       private InstrumentSampleListener[] m_listeners;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new AbstractInstrumentSample
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
  -     * @param size The number of samples to store as history.  Assumes that size is at least 1.
  +     * @param size The number of samples to store as history.  Assumes that
  +     *             size is at least 1.
        * @param description The description of the new InstrumentSample.
        * @param lease The length of the lease in milliseconds.
        */
  -    protected AbstractInstrumentSample( String name,
  +    protected AbstractInstrumentSample( InstrumentProxy instrumentProxy,
  +                                        String name,
                                           long interval,
                                           int size,
                                           String description,
                                           long lease )
       {
  +        m_instrumentProxy = instrumentProxy;
  +        
           if ( interval < 1 )
           {
               throw new IllegalArgumentException( "interval must be at least 1." );
  @@ -97,7 +108,7 @@
           {
               throw new IllegalArgumentException( "size must be at least 1." );
           }
  -
  +        
           m_name = name;
           m_interval = interval;
           m_size = size;
  @@ -111,20 +122,30 @@
               // Permanent lease.
               m_leaseExpirationTime = 0;
           }
  -
  +        
           // Calculate the maxAge
           m_maxAge = m_size * m_interval;
  -
  +        
           init();
  -
  +        
           // Create the descriptor
  -        m_descriptor = new InstrumentSampleDescriptorImpl( this );
  +        m_descriptor = new InstrumentSampleDescriptorLocalImpl( this );
       }
  -
  +    
       /*---------------------------------------------------------------
        * InstrumentSample Methods
        *-------------------------------------------------------------*/
       /**
  +     * Returns the InstrumentProxy which owns the InstrumentSample.
  +     *
  +     * @return The InstrumentProxy which owns the InstrumentSample.
  +     */
  +    public InstrumentProxy getInstrumentProxy()
  +    {
  +        return m_instrumentProxy;
  +    }
  +    
  +    /**
        * Returns true if the Instrument was configured in the instrumentables
        *  section of the configuration.
        *
  @@ -132,10 +153,9 @@
        */
       public boolean isConfigured()
       {
  -        //return m_configured;
  -        return true;
  +        return m_configured;
       }
  -
  +    
       /**
        * Returns the name of the sample.
        *
  @@ -145,7 +165,7 @@
       {
           return m_name;
       }
  -
  +    
       /**
        * Returns the sample interval.  The period of each sample in millisends.
        *
  @@ -155,7 +175,7 @@
       {
           return m_interval;
       }
  -
  +    
       /**
        * Returns the number of samples in the sample history.
        *
  @@ -165,7 +185,7 @@
       {
           return m_size;
       }
  -
  +    
       /**
        * Returns the description of the sample.
        *
  @@ -175,17 +195,17 @@
       {
           return m_description;
       }
  -
  +    
       /**
        * Returns a Descriptor for the InstrumentSample.
        *
        * @return A Descriptor for the InstrumentSample.
        */
  -    public InstrumentSampleDescriptor getDescriptor()
  +    public InstrumentSampleDescriptorLocal getDescriptor()
       {
           return m_descriptor;
       }
  -
  +    
       /**
        * Obtain the value of the sample.  All samples are integers, so the profiled
        * objects must measure quantity (numbers of items), rate (items/period), time in
  @@ -198,7 +218,7 @@
           boolean update;
           int value;
           long time;
  -
  +        
           synchronized(this)
           {
               long now = System.currentTimeMillis();
  @@ -206,14 +226,14 @@
               value = getValueInner();
               time = m_time;
           }
  -
  +        
           if ( update )
           {
               updateListeners( value, time );
           }
           return value;
       }
  -
  +    
       /**
        * Obtain the UNIX time of the beginning of the sample.
        *
  @@ -224,7 +244,7 @@
           boolean update;
           int value;
           long time;
  -
  +        
           synchronized(this)
           {
               long now = System.currentTimeMillis();
  @@ -232,14 +252,14 @@
               value = getValueInner();
               time = m_time;
           }
  -
  +        
           if ( update )
           {
               updateListeners( value, time );
           }
           return time;
       }
  -
  +    
       /**
        * Returns the time that the current lease expires.  Permanent samples will
        *  return a value of 0.
  @@ -250,13 +270,16 @@
       {
           return m_leaseExpirationTime;
       }
  -
  +    
       /**
        * Extends the lease to be lease milliseconds from the current time.
        *
        * @param lease The length of the lease in milliseconds.
  +     *
  +     * @return The new lease expiration time.  Returns 0 if the sample is
  +     *         permanent.
        */
  -    public void extendLease( long lease )
  +    public long extendLease( long lease )
       {
           synchronized(this)
           {
  @@ -266,9 +289,11 @@
                   long newLeaseExpirationTime = System.currentTimeMillis() + lease;
                   m_leaseExpirationTime = Math.max( m_leaseExpirationTime, newLeaseExpirationTime );
               }
  +            
  +            return m_leaseExpirationTime;
           }
       }
  -
  +    
       /**
        * Obtains a static snapshot of the InstrumentSample.
        *
  @@ -280,7 +305,7 @@
           {
               long time = System.currentTimeMillis();
               update( time );
  -
  +            
               return new InstrumentSampleSnapshot(
                   m_name,
                   m_interval,
  @@ -289,7 +314,7 @@
                   getHistorySnapshot() );
           }
       }
  -
  +    
       /**
        * Registers a InstrumentSampleListener with a InstrumentSample given a name.
        *
  @@ -303,7 +328,7 @@
               getLogger().debug( "A InstrumentSampleListener was added to sample, " + m_name + " : " +
                   listener.getClass().getName() );
           }
  -
  +        
           synchronized(this)
           {
               // Store the listeners in an array.  This makes it possible to
  @@ -322,12 +347,12 @@
                   System.arraycopy( oldListeners, 0, newListeners, 0, oldListeners.length );
                   newListeners[ oldListeners.length ] = listener;
               }
  -
  +            
               // Update the m_listeners field.
               m_listeners = newListeners;
           }
       }
  -
  +    
       /**
        * Unregisters a InstrumentSampleListener from a InstrumentSample given a name.
        *
  @@ -341,7 +366,7 @@
               getLogger().debug( "A InstrumentSampleListener was removed from sample, " + m_name +
                   " : " + listener.getClass().getName() );
           }
  -
  +        
           synchronized(this)
           {
               // Store the listeners in an array.  This makes it possible to
  @@ -380,7 +405,7 @@
                           break;
                       }
                   }
  -
  +                
                   if ( pos < 0 )
                   {
                       // The listener was not in the list.
  @@ -397,17 +422,17 @@
                       if ( pos < oldListeners.length - 1 )
                       {
                           // Copy the tail of the array
  -                        System.arraycopy( oldListeners, pos + 1,
  +                        System.arraycopy( oldListeners, pos + 1, 
                               newListeners, pos, oldListeners.length - 1 - pos );
                       }
                   }
               }
  -
  +            
               // Update the m_listeners field.
               m_listeners = newListeners;
           }
       }
  -
  +    
       /**
        * Notifies any listeners of a change.
        * <p>
  @@ -428,57 +453,59 @@
               }
           }
       }
  -
  +    
       /**
        * Saves the current state into a Configuration.
        *
  -     * @param useCompactSamples Flag for whether or not InstrumentSample data
  -     *                          should be saved in compact format or not.
  -     *
  -     * @return The state as a Configuration.
  +     * @return The state as a Configuration.  Returns null if the configuration
  +     *         would not contain any information.
        */
  -    public final Configuration saveState( boolean useCompactSamples )
  +    public final Configuration saveState()
       {
  +        // If this sample is not configured and its lease time is 0, then it
  +        //  is an artifact of a previous state file, so it should not be saved.
  +        if ( ( !isConfigured() ) && ( getLeaseExpirationTime() <= 0 ) )
  +        {
  +            return null;
  +        }
  +        
           synchronized(this)
           {
  -            DefaultConfiguration state = new DefaultConfiguration( "profile-sample", "-" );
  -            state.setAttribute( "name", m_name );
  +            DefaultConfiguration state = new DefaultConfiguration( "sample", "-" );
  +            state.setAttribute( "type",
  +                InstrumentSampleUtils.getInstrumentSampleTypeName( getType() ) );
  +            state.setAttribute( "interval", Long.toString( m_interval ) );
  +            state.setAttribute( "size", Integer.toString( m_size ) );
  +            
               state.setAttribute( "time", Long.toString( m_time ) );
  -
  +            if ( getLeaseExpirationTime() > 0 )
  +            {
  +                state.setAttribute( "lease-expiration", Long.toString( getLeaseExpirationTime() ) );
  +                state.setAttribute( "description", m_description );
  +            }
  +            
               // Save the history samples so that the newest is first.
               DefaultConfiguration samples = new DefaultConfiguration( "history", "-" );
               int[] history = getHistorySnapshot();
  -            if ( useCompactSamples )
  +            
  +            // Build up a string of the sample points.
  +            StringBuffer sb = new StringBuffer();
  +            // Store the first value outside the loop to simplify the loop.
  +            sb.append( history[ history.length - 1 ] );
  +            for ( int i = history.length - 2; i >= 0; i-- )
               {
  -                StringBuffer sb = new StringBuffer();
  -
  -                // Store the first value outside the loop to simplify the loop.
  -                sb.append( history[ history.length - 1 ] );
  -                for ( int i = history.length - 2; i >= 0; i-- )
  -                {
  -                    sb.append( ',' );
  -                    sb.append( history[ i ] );
  -                }
  -
  -                samples.setValue( sb.toString() );
  -            }
  -            else
  -            {
  -                for ( int i = history.length - 1; i >= 0; i-- )
  -                {
  -                    DefaultConfiguration sample = new DefaultConfiguration( "sample", "-" );
  -                    sample.setValue( Integer.toString( history[i] ) );
  -                    samples.addChild( sample );
  -                }
  +                sb.append( ',' );
  +                sb.append( history[ i ] );
               }
  +            samples.setValue( sb.toString() );
               state.addChild( samples );
  -
  +            
               saveState( state );
  -
  +            
               return state;
           }
       }
  -
  +    
       /**
        * Loads the state into the InstrumentSample.
        *
  @@ -493,58 +520,44 @@
           {
               // Set the time
               long savedTime = m_time = state.getAttributeAsLong( "time" );
  -
  +            
  +            // Load the lease expiration time
  +            m_leaseExpirationTime = state.getAttributeAsLong( "lease-expiration", 0 );
  +            
               // Set the history index.
               m_historyIndex = 0;
  -
  +            
               // Read in the samples, don't trust that the number will be correct.
               //  First sample is the current value, following sames go back in
               //   time from newest to oldest.
               Configuration history = state.getChild( "history" );
  -
  -            Configuration samples[] = history.getChildren( "sample" );
  -            int[] sampleValues;
  -            if ( samples.length == 0 )
  +            
  +            String compactSamples = history.getValue();
  +            
  +            // Sample values are stored in newest to oldest order.
  +            StringTokenizer st = new StringTokenizer( compactSamples, "," );
  +            int[] sampleValues = new int[st.countTokens()];
  +            
  +            for ( int i = 0; i < sampleValues.length; i++ )
               {
  -                // No sample children.  The data may be stored in compact form
  -                String compactSamples = history.getValue();
  -
  -                // Sample values are stored in newest to oldest order.
  -                StringTokenizer st = new StringTokenizer( compactSamples, "," );
  -                sampleValues = new int[st.countTokens()];
  -
  -                for ( int i = 0; i < sampleValues.length; i++ )
  +                try
                   {
  -                    try
  -                    {
  -                        sampleValues[i] = Integer.parseInt( st.nextToken() );
  -                    }
  -                    catch ( NumberFormatException e )
  -                    {
  -                        throw new ConfigurationException( "The compact sample data could not be " +
  -                            "loaded, because of a number format problem, for InstrumentSample: " +
  -                            m_name );
  -                    }
  +                    sampleValues[i] = Integer.parseInt( st.nextToken() );
                   }
  -            }
  -            else
  -            {
  -                // Sample data stored as individual elements
  -                sampleValues = new int[ samples.length ];
  -
  -                // Sample values are stored in newest to oldest order.
  -                for ( int i = 0; i < samples.length; i++ )
  +                catch ( NumberFormatException e )
                   {
  -                    sampleValues[i] = samples[ i ].getValueAsInteger();
  +                    throw new ConfigurationException( "The compact sample data could not be " +
  +                        "loaded, because of a number format problem, for InstrumentSample: " +
  +                        m_name ); 
                   }
               }
  -
  +            
               // Get the current value
               int value;
               if ( sampleValues.length > 0 )
               {
                   value = sampleValues[0];
  -
  +                
                   for ( int i = 0; i < m_size - 1; i++ )
                   {
                       if ( i < sampleValues.length - 1 )
  @@ -561,7 +574,7 @@
               {
                   value = 0;
               }
  -
  +            
               loadState( value, state );
   
               if ( calculateSampleTime( System.currentTimeMillis() ) > savedTime )
  @@ -571,13 +584,29 @@
                   //  intervals.
                   postSaveNeedsReset();
               }
  +            
  +            if ( m_leaseExpirationTime > 0 )
  +            {
  +                // This is a sample that was leased in a previous JVM invocation
  +                //  and needs to be registered with the InstrumentManager
  +                getInstrumentProxy().getInstrumentableProxy().getInstrumentManager().
  +                    registerLeasedInstrumentSample( this );
  +            }
           }
       }
  -
  +    
       /*---------------------------------------------------------------
        * Methods
        *-------------------------------------------------------------*/
       /**
  +     * Sets the configured flag.
  +     */
  +    void setConfigured()
  +    {
  +        m_configured = true;
  +    }
  +    
  +    /**
        * Initializes the sample
        */
       private void init()
  @@ -586,7 +615,7 @@
           //  value of the current time. This will allign the intervals to the start of computer
           //  time.
           m_time = calculateSampleTime( System.currentTimeMillis() );
  -
  +        
           // Create the arrays which will hold the history points.
           // History is build with m_value holding the current value and all previous values
           // spanning accross 2 arrays that switch places as time progresses.  This completely
  @@ -596,14 +625,14 @@
           m_historyOld = new int[ m_size - 1 ];
           m_historyNew = new int[ m_size - 1 ];
       }
  -
  +    
       /**
        * Allow subclasses to add information into the saved state.
        *
        * @param state State configuration.
        */
       protected void saveState( DefaultConfiguration state ) {}
  -
  +    
       /**
        * Used to load the state, called from AbstractInstrumentSample.loadState();
        * <p>
  @@ -617,13 +646,13 @@
        */
       protected abstract void loadState( int value, Configuration state )
           throws ConfigurationException;
  -
  +    
       /**
        * Called after a state is loaded if the sample period is not the same
        *  as the last period saved.
        */
       protected abstract void postSaveNeedsReset();
  -
  +    
       /**
        * Calculates the time of the sample which contains the specified time.
        *
  @@ -633,7 +662,7 @@
       {
           return ( time / m_interval ) * m_interval;
       }
  -
  +    
       /**
        * Gets the current value.  Does not update.
        * <p>
  @@ -642,7 +671,7 @@
        * @return The current value.
        */
       protected abstract int getValueInner();
  -
  +    
       /**
        * The current sample has already been stored.  Reset the current sample
        *  and move on to the next.
  @@ -650,7 +679,7 @@
        * Should only be called when synchronized.
        */
       protected abstract void advanceToNextSample();
  -
  +    
       /**
        * Brings the InstrumentSample's time up to date so that a new value can be added.
        * <p>
  @@ -680,19 +709,19 @@
                   {
                       // Store the current value into the end of the history.
                       m_historyNew[ m_historyIndex ] = getValueInner();
  -
  +                    
                       // Advance to the next sample.
                       m_time += m_interval;
                       advanceToNextSample();
                       m_historyIndex++;
  -
  +                    
                       if ( m_historyIndex >= m_size - 1 )
                       {
                           // Need to swap the history arrays
                           int[] tmp = m_historyOld;
                           m_historyOld = m_historyNew;
                           m_historyNew = tmp;
  -
  +                        
                           // Reset the history index
                           m_historyIndex = 0;
                       }
  @@ -703,7 +732,7 @@
               return false;
           }
       }
  -
  +    
       /**
        * Gets a snapshot of the samples.
        * <p>
  @@ -717,9 +746,9 @@
           // This method is a little slow but normal collection of sample points is
           // extremely fast.
           int[] history = new int[m_size];
  -
  +        
           int sizem1 = m_size - 1;
  -
  +        
           if ( m_size > 1 )
           {
               // Copy samples from the old history first.
  @@ -728,7 +757,7 @@
                   // Copy the last (size - 1 - historyIndex) samples from the old history.
                   System.arraycopy( m_historyOld, m_historyIndex, history, 0, sizem1 - m_historyIndex );
               }
  -
  +            
               if ( m_historyIndex > 0 )
               {
                   // Copy the first (historyIndex) samples from the new history.
  @@ -737,7 +766,19 @@
           }
           // Get the final sample from the current sample value.
           history[ m_size - 1] = getValueInner();
  -
  +        
           return history;
  +    }
  +    
  +    /**
  +     * Returns a string representation of the sample.
  +     *
  +     * @return A string representation of the sample.
  +     */
  +    public String toString()
  +    {
  +        return "InstrumentSample[name=" + m_name + ", type=" + 
  +            InstrumentSampleUtils.getInstrumentSampleTypeName( getType() ) + ", interval=" + 
  +            m_interval + ", size=" + m_size + ", lease=" + m_leaseExpirationTime + "]";
       }
   }
  
  
  
  1.2       +17 -15    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/AbstractValueInstrumentSample.java
  
  Index: AbstractValueInstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/AbstractValueInstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractValueInstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ AbstractValueInstrumentSample.java	3 Aug 2002 15:00:37 -0000	1.2
  @@ -8,7 +8,6 @@
   package org.apache.excalibur.instrument.manager;
   
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  -import org.apache.excalibur.instrument.manager.interfaces.ValueInstrumentListener;
   
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -28,34 +27,37 @@
   {
       /** The sample value. */
       protected int m_value;
  -
  +    
       /** The number of times that the value has been changed in this sample period. */
       protected int m_valueCount;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new AbstractValueInstrumentSample
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
        * @param size The number of samples to store as history.  Assumes that size is at least 1.
        * @param description The description of the new InstrumentSample.
        * @param lease The length of the lease in milliseconds.
        */
  -    protected AbstractValueInstrumentSample( String name,
  +    protected AbstractValueInstrumentSample( InstrumentProxy instrumentProxy,
  +                                             String name,
                                                long interval,
                                                int size,
                                                String description,
                                                long lease )
       {
  -        super( name, interval, size, description, lease );
  -
  +        super( instrumentProxy, name, interval, size, description, lease );
  +        
           // Set the current value to 0 initially.
           m_value = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * InstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -71,7 +73,7 @@
       {
           return InstrumentManagerClient.INSTRUMENT_TYPE_VALUE;
       }
  -
  +    
       /**
        * Obtain the value of the sample.  All samples are integers, so the profiled
        * objects must measure quantity (numbers of items), rate (items/period), time in
  @@ -97,10 +99,10 @@
       protected void saveState( DefaultConfiguration state )
       {
           super.saveState( state );
  -
  +        
           state.setAttribute( "value-count", Integer.toString( m_valueCount ) );
       }
  -
  +    
       /**
        * Used to load the state, called from AbstractInstrumentSample.loadState();
        * <p>
  @@ -118,7 +120,7 @@
           m_value = value;
           m_valueCount = state.getAttributeAsInteger( "value-count" );
       }
  -
  +    
       /**
        * Called after a state is loaded if the sample period is not the same
        *  as the last period saved.
  @@ -128,7 +130,7 @@
           m_value = 0;
           m_valueCount = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * ValueInstrumentListener Methods
        *-------------------------------------------------------------*/
  @@ -146,8 +148,8 @@
           //System.out.println("AbstractValueInstrumentSample.setValue(" + instrumentName + ", " + value + ", " + time + ") : " + getName());
           setValueInner( value, time );
       }
  -
  -
  +    
  +    
       /*---------------------------------------------------------------
        * Methods
        *-------------------------------------------------------------*/
  
  
  
  1.2       +29 -17    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/CounterInstrumentSample.java
  
  Index: CounterInstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/CounterInstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CounterInstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ CounterInstrumentSample.java	3 Aug 2002 15:00:37 -0000	1.2
  @@ -7,7 +7,6 @@
    */
   package org.apache.excalibur.instrument.manager;
   
  -import org.apache.excalibur.instrument.manager.interfaces.CounterInstrumentListener;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
   
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -27,35 +26,48 @@
   {
       /** The count. */
       protected int m_count;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new CounterInstrumentSample
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
        * @param size The number of samples to store as history.  Assumes that size is at least 1.
        * @param description The description of the new InstrumentSample.
        * @param lease The length of the lease in milliseconds.
        */
  -    CounterInstrumentSample( String name,
  +    CounterInstrumentSample( InstrumentProxy instrumentProxy,
  +                             String name,
                                long interval,
                                int size,
                                String description,
                                long lease )
       {
  -        super( name, interval, size, description, lease );
  -
  +        super( instrumentProxy, name, interval, size, description, lease );
  +        
           // Set the current value to 0 initially.
           m_count = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * InstrumentSample Methods
        *-------------------------------------------------------------*/
       /**
  +     * Returns the type of the Instrument Sample.
  +     *
  +     * @return The type of the Instrument Sample.
  +     */
  +    public int getType()
  +    {
  +        return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER;
  +    }
  +    
  +    /**
        * Returns the Type of the Instrument which can use the sample.  This
        *  should be the same for all instances of a class.
        * <p>
  @@ -67,7 +79,7 @@
       {
           return InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER;
       }
  -
  +    
       /**
        * Obtain the value of the sample.  All samples are integers, so the profiled
        * objects must measure quantity (numbers of items), rate (items/period), time in
  @@ -79,7 +91,7 @@
       {
           return m_count;
       }
  -
  +    
       /*---------------------------------------------------------------
        * AbstractInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -94,7 +106,7 @@
           // Counts do not propagate, so always reset the count to 0.
           m_count = 0;
       }
  -
  +    
       /**
        * Used to load the state, called from AbstractInstrumentSample.loadState();
        * <p>
  @@ -111,7 +123,7 @@
       {
           m_count = value;
       }
  -
  +    
       /**
        * Called after a state is loaded if the sample period is not the same
        *  as the last period saved.
  @@ -120,7 +132,7 @@
       {
           m_count = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * CounterInstrumentListener Methods
        *-------------------------------------------------------------*/
  @@ -136,7 +148,7 @@
           //System.out.println("CounterInstrumentSample.increment(" + instrumentName + ", " + count + ", " + time + ") : " + getName() );
           increment( count, time );
       }
  -
  +    
       /*---------------------------------------------------------------
        * Methods
        *-------------------------------------------------------------*/
  @@ -150,17 +162,17 @@
       {
           int sampleValue;
           long sampleTime;
  -
  +        
           synchronized(this)
           {
               update( time );
  -
  +            
               m_count += count;
  -
  +            
               sampleValue = m_count;
               sampleTime = m_time;
           }
  -
  +        
           updateListeners( sampleValue, sampleTime );
       }
   }
  
  
  
  1.2       +280 -171  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/DefaultInstrumentManager.java
  
  Index: DefaultInstrumentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/DefaultInstrumentManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultInstrumentManager.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ DefaultInstrumentManager.java	3 Aug 2002 15:00:37 -0000	1.2
  @@ -7,11 +7,13 @@
    */
   package org.apache.excalibur.instrument.manager;
   
  +import java.io.ByteArrayOutputStream;
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.FileOutputStream;
   import java.io.InputStream;
   import java.io.OutputStream;
  +import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.Comparator;
   import java.util.HashMap;
  @@ -22,13 +24,11 @@
   import org.apache.excalibur.instrument.Instrumentable;
   import org.apache.excalibur.instrument.InstrumentManager;
   import org.apache.excalibur.instrument.ValueInstrument;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentableDescriptor;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
   import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentableException;
   
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -36,6 +36,7 @@
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.service.ServiceException;
   
   /**
    *
  @@ -52,13 +53,13 @@
       public static final String INSTRUMENT_FREE_MEMORY = "free-memory";
       public static final String INSTRUMENT_MEMORY = "memory";
       public static final String INSTRUMENT_ACTIVE_THREAD_COUNT = "active-thread-count";
  -
  +    
       /** The name used to identify this InstrumentManager. */
       private String m_name;
   
       /** The description of this InstrumentManager. */
       private String m_description;
  -
  +    
       /** Configuration for the InstrumentManager */
       private Configuration m_configuration;
   
  @@ -68,9 +69,6 @@
       /** Save state interval. */
       private long m_stateInterval;
   
  -    /** Use a compact format when saving profile sample data. */
  -    private boolean m_stateCompactSamples;
  -
       /** Last time that the state was saved. */
       private long m_lastStateSave;
   
  @@ -83,9 +81,15 @@
       /** Optimized array of the InstrumentableProxies. */
       private InstrumentableProxy[] m_instrumentableProxyArray;
   
  -    /** Optimized array of the InstrumentableDescriptors. */
  -    private InstrumentableDescriptor[] m_instrumentableDescriptorArray;
  +    /** Optimized array of the InstrumentableDescriptorLocals. */
  +    private InstrumentableDescriptorLocal[] m_instrumentableDescriptorArray;
   
  +    /** List of leased InstrumentSamples. */
  +    private ArrayList m_leasedInstrumentSamples = new ArrayList();
  +    
  +    /** Optimized array of the leased InstrumentSamples. */
  +    private InstrumentSample[] m_leasedInstrumentSampleArray;
  +    
       /**
        * Thread used to keep the instruments published by the InstrumentManager
        *  up to date.
  @@ -121,7 +125,7 @@
           m_name = name;
           // The description defaults to the name.
           m_description = name;
  -
  +        
           // Initialize the Instrumentable elements.
           m_totalMemoryInstrument = new ValueInstrument( INSTRUMENT_TOTAL_MEMORY );
           m_freeMemoryInstrument = new ValueInstrument( INSTRUMENT_FREE_MEMORY );
  @@ -156,8 +160,8 @@
                   Configuration instrumentableConf = instrumentableConfs[ i ];
                   String instrumentableName = instrumentableConf.getAttribute( "name" );
   
  -                InstrumentableProxy instrumentableProxy =
  -                    new InstrumentableProxy( instrumentableName );
  +                InstrumentableProxy instrumentableProxy = new InstrumentableProxy(
  +                    this, null, instrumentableName, instrumentableName );
                   instrumentableProxy.enableLogging( getLogger() );
                   instrumentableProxy.configure( instrumentableConf );
                   m_instrumentableProxies.put( instrumentableName, instrumentableProxy );
  @@ -170,8 +174,6 @@
               // Configure the state file.
               Configuration stateFileConf = configuration.getChild( "state-file" );
               m_stateInterval = stateFileConf.getAttributeAsLong( "interval", 60000 );
  -            m_stateCompactSamples =
  -                stateFileConf.getAttributeAsBoolean( "use-compact-samples", true );
   
               String stateFile = stateFileConf.getValue( null );
               if( stateFile != null )
  @@ -179,7 +181,6 @@
                   m_stateFile = new File( stateFile );
                   if( m_stateFile.exists() )
                   {
  -                    /*
                       try
                       {
                           loadStateFromFile( m_stateFile );
  @@ -191,7 +192,6 @@
                               "may have been corruptped.  A backup may have been made in the same " +
                               "directory when it was saved.", e );
                       }
  -                    */
                   }
               }
           }
  @@ -262,7 +262,8 @@
               if( instrumentableProxy == null )
               {
                   // This is a Instrumentable that has not been seen before.
  -                instrumentableProxy = new InstrumentableProxy( instrumentableName );
  +                instrumentableProxy = new InstrumentableProxy(
  +                    this, null, instrumentableName, instrumentableName );
                   instrumentableProxy.enableLogging( getLogger() );
                   // Do not call configure here because there is no configuration
                   //  for discovered instrumentables.
  @@ -273,17 +274,19 @@
                   m_instrumentableDescriptorArray = null;
   
                   // Recursively register all the Instruments in this and any child Instrumentables.
  -                registerInstruments( instrumentable, instrumentableProxy, instrumentableName );
  +                registerInstrumentableInner(
  +                    instrumentable, instrumentableProxy, instrumentableName );
               }
               else
               {
                   // Additional Instrumentable instance.  Possible that new Instruments could be found.
  -                registerInstruments( instrumentable, instrumentableProxy, instrumentableName );
  +                registerInstrumentableInner(
  +                    instrumentable, instrumentableProxy, instrumentableName );
               }
           }
       }
   
  -
  +    
       /*---------------------------------------------------------------
        * Methods
        *-------------------------------------------------------------*/
  @@ -296,7 +299,7 @@
       {
           return m_name;
       }
  -
  +    
       /**
        * Returns the description of this InstrumentManager.
        *
  @@ -306,10 +309,10 @@
       {
           return m_description;
       }
  -
  +    
       /**
  -     * Returns an InstrumentableDescriptor based on its name or the name of any
  -     *  of its children.
  +     * Returns an InstrumentableDescriptorLocal based on its name or the name
  +     *  of any of its children.
        *
        * @param instrumentableName Name of the Instrumentable being requested.
        *
  @@ -318,7 +321,7 @@
        * @throws NoSuchInstrumentableException If the specified Instrumentable
        *                                       does not exist.
        */
  -    public InstrumentableDescriptor getInstrumentableDescriptor( String instrumentableName )
  +    public InstrumentableDescriptorLocal getInstrumentableDescriptor( String instrumentableName )
           throws NoSuchInstrumentableException
       {
           InstrumentableProxy proxy = getInstrumentableProxy( instrumentableName );
  @@ -338,16 +341,16 @@
        * @return An array of Descriptors for the Instrumentables managed by this
        *  InstrumentManager.
        */
  -    public InstrumentableDescriptor[] getInstrumentableDescriptors()
  +    public InstrumentableDescriptorLocal[] getInstrumentableDescriptors()
       {
  -        InstrumentableDescriptor[] descriptors = m_instrumentableDescriptorArray;
  +        InstrumentableDescriptorLocal[] descriptors = m_instrumentableDescriptorArray;
           if( descriptors == null )
           {
               descriptors = updateInstrumentableDescriptorArray();
           }
           return descriptors;
       }
  -
  +    
       /**
        * Invokes garbage collection.
        */
  @@ -355,147 +358,194 @@
       {
           System.gc();
       }
  -
  -
  +    
  +    
   
       /**
  -     * Loads the profiler state from the specified file.
  +     * Loads the Instrument Manager state from the specified file.
        *
  -     * @param stateFile File to read the profiler's state from.
  +     * @param stateFile File to read the instrument manager's state from.
        *
        * @throws Exception if there are any problems loading the state.
        */
  -    /*
  -    public void loadInstrumentStateFromFile( File stateFile )
  +    public void loadStateFromFile( File stateFile )
           throws Exception
       {
           long now = System.currentTimeMillis();
  -        getLogger().debug( "Loading profiler state from: " + stateFile.getAbsolutePath() );
  +        getLogger().debug( "Loading Instrument Manager state from: " +
  +            stateFile.getAbsolutePath() );
   
           FileInputStream is = new FileInputStream( stateFile );
           try
           {
  -            loadInstrumentStateFromStream( is );
  +            loadStateFromStream( is );
           }
           finally
           {
               is.close();
           }
   
  -        getLogger().debug( "Loading profiler state took " +
  +        getLogger().debug( "Loading Instrument Manager state took " +
                              ( System.currentTimeMillis() - now ) + "ms." );
       }
  -    */
   
       /**
  -     * Loads the profiler state from the specified stream.
  +     * Loads the Instrument Manager state from the specified stream.
        *
  -     * @param is Stream to read the profiler's state from.
  +     * @param is Stream to read the instrument manager's state from.
        *
        * @throws Exception if there are any problems loading the state.
        */
  -    /*
  -    public void loadInstrumentStateFromStream( InputStream is )
  +    public void loadStateFromStream( InputStream is )
           throws Exception
       {
           // Ride on top of the Configuration classes to load the state.
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
           Configuration stateConfig = builder.build( is );
   
  -        loadInstrumentStateFromConfiguration( stateConfig );
  +        loadStateFromConfiguration( stateConfig );
       }
  -    */
   
       /**
  -     * Loads the profiler state from the specified Configuration.
  +     * Loads the Instrument Manager state from the specified Configuration.
        *
        * @param state Configuration object to load the state from.
        *
        * @throws ConfigurationException If there were any problems loading the
        *                                state.
        */
  -    /*
  -    public void loadInstrumentStateFromConfiguration( Configuration state )
  +    public void loadStateFromConfiguration( Configuration state )
           throws ConfigurationException
       {
           Configuration[] instrumentableConfs = state.getChildren( "instrumentable" );
           for( int i = 0; i < instrumentableConfs.length; i++ )
           {
               Configuration instrumentableConf = instrumentableConfs[ i ];
  -            String name = instrumentableConf.getAttribute( "name" );
  -            InstrumentableProxy proxy = getInstrumentableProxy( name );
  -            if( proxy == null )
  -            {
  -                getLogger().warn( "Instrumentable entry ignored while loading state because the " +
  -                                  "instrumentable does not exist: " + name );
  -            }
  -            else
  +            String instrumentableName = instrumentableConf.getAttribute( "name" );
  +            InstrumentableProxy instrumentableProxy = getInstrumentableProxy( instrumentableName );
  +            if( instrumentableProxy == null )
               {
  -                proxy.loadState( instrumentableConf );
  +                // The Instrumentable was in the state file, but has not yet
  +                //  been registered.  It is possible that it will be registered
  +                //  at a later time.  For now it needs to be created.
  +                instrumentableProxy = new InstrumentableProxy(
  +                    this, null, instrumentableName, instrumentableName );
  +                instrumentableProxy.enableLogging( getLogger() );
  +                m_instrumentableProxies.put( instrumentableName, instrumentableProxy );
  +
  +                // Clear the optimized arrays
  +                m_instrumentableProxyArray = null;
  +                m_instrumentableDescriptorArray = null;
               }
  +            
  +            instrumentableProxy.loadState( instrumentableConf );
           }
       }
  -    */
   
       /**
  -     * Saves the Instrument's state to the specified file.
  +     * Saves the Instrument Manager's state to the specified file.  Any
  +     *  existing file is backed up before the save takes place and replaced
  +     *  in the event of an error.
        *
  -     * @param stateFile File to write the profiler's state to.
  +     * @param stateFile File to write the Instrument Manager's state to.
        *
        * @throws Exception if there are any problems saving the state.
        */
  -    /*
  -    public void saveInstrumentStateToFile( File stateFile )
  +    public void saveStateToFile( File stateFile )
           throws Exception
       {
           long now = System.currentTimeMillis();
  -        getLogger().debug( "Saving profiler state to: " + stateFile.getAbsolutePath() );
  +        getLogger().debug( "Saving Instrument Manager state to: " + stateFile.getAbsolutePath() );
   
  -        FileOutputStream os = new FileOutputStream( stateFile );
  +        // First save the state to an in memory stream to shorten the
  +        //  period of time needed to write the data to disk.  This makes it
  +        //  less likely that the files will be left in a corrupted state if
  +        //  the JVM dies at the wrong time.
  +        ByteArrayOutputStream os = new ByteArrayOutputStream();
  +        byte[] data;
           try
           {
  -            saveInstrumentStateToStream( os );
  +            saveStateToStream( os );
  +            data = os.toByteArray();
           }
           finally
           {
               os.close();
           }
  -
  -        getLogger().debug( "Saving profiler state took " +
  +        
  +        // If the specified file exists, then rename it before we start writing.
  +        //  This makes it possible to recover from some errors.
  +        File renameFile = null;
  +        boolean success = false;
  +        if( stateFile.exists() )
  +        {
  +            renameFile = new File( stateFile.getAbsolutePath() + "." + now + ".backup" );
  +            stateFile.renameTo( renameFile );
  +        }
  +        
  +        // Write the data to the new file.
  +        FileOutputStream fos = new FileOutputStream( stateFile );
  +        try
  +        {
  +            fos.write( data );
  +            success = true;
  +        }
  +        finally
  +        {
  +            fos.close();
  +            
  +            if ( !success )
  +            {
  +                // Make sure that part of the file does not exist.
  +                stateFile.delete();
  +            }
  +            
  +            // Handle the backup file.
  +            if ( renameFile != null )
  +            {
  +                if ( success )
  +                {
  +                    // No longer need the backup.
  +                    renameFile.delete();
  +                }
  +                else
  +                {
  +                    // Need to replace the backup.
  +                    renameFile.renameTo( stateFile );
  +                }
  +            }
  +        }
  +        
  +        getLogger().debug( "Saving Instrument Manager state took " +
                              ( System.currentTimeMillis() - now ) + "ms." );
       }
  -    */
   
       /**
  -     * Saves the Instrument's state to the specified output stream.
  +     * Saves the Instrument Manager's state to the specified output stream.
        *
  -     * @param os Stream to write the profiler's state to.
  +     * @param os Stream to write the Instrument Manager's state to.
        *
        * @throws Exception if there are any problems saving the state.
        */
  -    /*
  -    public void saveInstrumentStateToStream( OutputStream os )
  +    public void saveStateToStream( OutputStream os )
           throws Exception
       {
  -        Configuration stateConfig = saveInstrumentStateToConfiguration();
  +        Configuration stateConfig = saveStateToConfiguration();
   
           // Ride on top of the Configuration classes to save the state.
           DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
           serializer.setIndent( true );
           serializer.serialize( os, stateConfig );
       }
  -    */
   
       /**
  -     * Returns the desktop state as a Configuration object.
  +     * Returns the Instrument Manager's state as a Configuration object.
        *
  -     * @return The desktop state as a Configuration object.
  +     * @return The Instrument Manager's state as a Configuration object.
        */
  -    /*
  -    public Configuration saveInstrumentStateToConfiguration()
  +    public Configuration saveStateToConfiguration()
       {
  -
  -        DefaultConfiguration state = new DefaultConfiguration( "profiler-state", "-" );
  +        DefaultConfiguration state = new DefaultConfiguration( "instrument-manager-state", "-" );
   
           InstrumentableProxy[] instrumentableProxies = m_instrumentableProxyArray;
           if( instrumentableProxies == null )
  @@ -505,18 +555,15 @@
   
           for( int i = 0; i < instrumentableProxies.length; i++ )
           {
  -            // Only save configured instrumentables as they are the only ones
  -            //  that will contain profile samples.
  -            if( instrumentableProxies[ i ].isConfigured() )
  +            Configuration childState = instrumentableProxies[ i ].saveState();
  +            if ( childState != null )
               {
  -                state.addChild( instrumentableProxies[ i ].saveState( m_stateCompactSamples ) );
  +                state.addChild( childState );
               }
           }
   
           return state;
       }
  -    */
  -
   
       /*---------------------------------------------------------------
        * Instrumentable Methods
  @@ -598,6 +645,7 @@
   
                   memoryInstruments();
                   threadInstruments();
  +                testInstrumentSampleLeases();
   
                   // Handle the state file if it is set
                   long now = System.currentTimeMillis();
  @@ -630,45 +678,14 @@
           {
               return;
           }
  -
  -        // Rename the old file in case there is a problem
  -        File renameFile = null;
  -        boolean success = false;
  -        if( m_stateFile.exists() )
  -        {
  -            renameFile = new File( m_stateFile.getAbsolutePath() + "." + now + ".backup" );
  -            m_stateFile.renameTo( renameFile );
  -        }
  -
  +        
           try
           {
  -            /*
  -            try
  -            {
  -                saveInstrumentStateToFile( m_stateFile );
  -                success = true;
  -            }
  -            catch( Exception e )
  -            {
  -                getLogger().error( "Unable to save the profiler state.", e );
  -            }
  -            */
  +            saveStateToFile( m_stateFile );
           }
  -        finally
  +        catch ( Exception e )
           {
  -            // Clean up after the renamed file.
  -            if( renameFile != null )
  -            {
  -                if( success )
  -                {
  -                    renameFile.delete();
  -                }
  -                else
  -                {
  -                    m_stateFile.delete();
  -                    renameFile.renameTo( m_stateFile );
  -                }
  -            }
  +            getLogger().warn( "Unable to save the Instrument Manager state", e );
           }
       }
   
  @@ -770,7 +787,70 @@
               m_activeThreadCountInstrument.setValue( threadGroup.activeCount() );
           }
       }
  -
  +    
  +    /**
  +     * Handles the maintenance of all Instrument Samples which have been leased
  +     *  by a client.  Any Samples whose leases which have expired are cleaned
  +     *  up.
  +     */
  +    private void testInstrumentSampleLeases()
  +    {
  +        long now = System.currentTimeMillis();
  +        
  +        InstrumentSample[] samples;
  +        synchronized( m_leasedInstrumentSamples )
  +        {
  +            samples = m_leasedInstrumentSampleArray;
  +            if ( samples == null )
  +            {
  +                m_leasedInstrumentSampleArray =
  +                    new InstrumentSample[ m_leasedInstrumentSamples.size() ];
  +                m_leasedInstrumentSamples.toArray( m_leasedInstrumentSampleArray );
  +                samples = m_leasedInstrumentSampleArray;
  +            }
  +        }
  +        
  +        for ( int i = 0; i < samples.length; i++ )
  +        {
  +            InstrumentSample sample = samples[i];
  +            long expire = sample.getLeaseExpirationTime();
  +            if ( now >= expire )
  +            {
  +                // The sample lease has expired.
  +                InstrumentProxy instrument = sample.getInstrumentProxy();
  +                instrument.removeInstrumentSample( sample );
  +                
  +                m_leasedInstrumentSamples.remove( sample );
  +                m_leasedInstrumentSampleArray = null;
  +            }
  +        }
  +    }
  +    
  +    /**
  +     * Registers an InstrumentSample which has been leased so that the
  +     *  Instrument Manager can efficiently purge it when it has expired.
  +     *
  +     * @param instrumentSample Leased InstrumentSample to register.
  +     */
  +    void registerLeasedInstrumentSample( InstrumentSample instrumentSample )
  +    {
  +        synchronized( m_leasedInstrumentSamples )
  +        {
  +            // Make sure that the sample is really leased.
  +            if ( instrumentSample.getLeaseExpirationTime() <= 0 )
  +            {
  +                throw new IllegalStateException( "Got an InstrumentSample that was not leased." );
  +            }
  +            
  +            // Make sure that it is not already in the list.
  +            if ( m_leasedInstrumentSamples.indexOf( instrumentSample ) < 0 )
  +            {
  +                m_leasedInstrumentSamples.add( instrumentSample );
  +                m_leasedInstrumentSampleArray = null;
  +            }
  +        }
  +    }
  +    
       /**
        * Updates the cached array of InstrumentableProxies taking
        *  synchronization into account.
  @@ -794,24 +874,24 @@
                           return ((InstrumentableProxy)o1).getDescription().
                               compareTo( ((InstrumentableProxy)o2).getDescription() );
                       }
  -
  +                    
                       public boolean equals( Object obj )
                       {
                           return false;
                       }
                   } );
  -
  +            
               return m_instrumentableProxyArray;
           }
       }
   
       /**
  -     * Updates the cached array of InstrumentableDescriptors taking
  +     * Updates the cached array of InstrumentableDescriptorLocals taking
        *  synchronization into account.
        *
        * @return An array of the InstrumentableDescriptors.
        */
  -    private InstrumentableDescriptor[] updateInstrumentableDescriptorArray()
  +    private InstrumentableDescriptorLocal[] updateInstrumentableDescriptorArray()
       {
           synchronized( m_semaphore )
           {
  @@ -821,7 +901,7 @@
               }
   
               m_instrumentableDescriptorArray =
  -                new InstrumentableDescriptor[ m_instrumentableProxyArray.length ];
  +                new InstrumentableDescriptorLocal[ m_instrumentableProxyArray.length ];
               for( int i = 0; i < m_instrumentableProxyArray.length; i++ )
               {
                   m_instrumentableDescriptorArray[ i ] = m_instrumentableProxyArray[ i ].getDescriptor();
  @@ -832,51 +912,59 @@
       }
   
       /**
  -     * Examines a instrumentable and Registers all of its Instruments.
  +     * Examines a instrumentable and Registers all of its child Instrumentables
  +     *  and Instruments.
        * <p>
        * Only called when m_semaphore is locked.
        */
  -    private void registerInstruments( Instrumentable instrumentable,
  -                                        InstrumentableProxy instrumentableProxy,
  -                                        String instrumentableName )
  +    private void registerInstrumentableInner( Instrumentable instrumentable,
  +                                              InstrumentableProxy instrumentableProxy,
  +                                              String instrumentableName )
           throws Exception
       {
  +        // Mark the instrumentable proxy as registered.
  +        instrumentableProxy.setRegistered();
  +
           // Loop over the Instruments published by this Instrumentable
  -        Instrument[] profilePoints = instrumentable.getInstruments();
  -        for( int i = 0; i < profilePoints.length; i++ )
  +        Instrument[] instruments = instrumentable.getInstruments();
  +        for( int i = 0; i < instruments.length; i++ )
           {
  -            Instrument profilePoint = profilePoints[ i ];
  -            String profilePointName =
  -                instrumentableName + "." + profilePoint.getInstrumentName();
  +            Instrument instrument = instruments[ i ];
  +            String instrumentName = instrument.getInstrumentName();
  +            String fullInstrumentName = instrumentableName + "." + instrumentName;
   
  -            getLogger().debug( "Registering Instrument: " + profilePointName );
  +            getLogger().debug( "Registering Instrument: " + fullInstrumentName );
   
               // See if a proxy exists for the Instrument yet.
  -            InstrumentProxy proxy = instrumentableProxy.getInstrumentProxy( profilePointName );
  +            InstrumentProxy proxy = instrumentableProxy.getInstrumentProxy( fullInstrumentName );
               if( proxy == null )
               {
  -                proxy = new InstrumentProxy( profilePointName );
  +                proxy = new InstrumentProxy(
  +                    instrumentableProxy, fullInstrumentName, instrumentName );
                   proxy.enableLogging( getLogger() );
   
                   // Set the type of the new InstrumentProxy depending on the
                   //  class of the actual Instrument.
  -                if( profilePoint instanceof CounterInstrument )
  +                if( instrument instanceof CounterInstrument )
                   {
                       proxy.setType( InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER );
                   }
  -                else if( profilePoint instanceof ValueInstrument )
  +                else if( instrument instanceof ValueInstrument )
                   {
                       proxy.setType( InstrumentManagerClient.INSTRUMENT_TYPE_VALUE );
                   }
                   else
                   {
  -                    throw new ServiceException( profilePointName, "Encountered an unknown Instrument type for " +
  -                                                  "the Instrument with key, " + profilePointName + ": " +
  -                                                  profilePoint.getClass().getName() );
  +                    throw new ServiceException( fullInstrumentName, "Encountered an unknown "
  +                        + "Instrument type for the Instrument with key, "
  +                        + fullInstrumentName + ": " + instrument.getClass().getName() );
                   }
   
  +                // Mark the instrument proxy as registered.
  +                proxy.setRegistered();
  +                
                   // Store a reference to the proxy in the Instrument.
  -                ( (AbstractInstrument)profilePoint ).setInstrumentProxy( proxy );
  +                ( (AbstractInstrument)instrument ).setInstrumentProxy( proxy );
   
                   instrumentableProxy.addInstrumentProxy( proxy );
               }
  @@ -884,14 +972,14 @@
               {
                   // Register the existing proxy with the Instrument.  Make sure that the
                   //  type didn't change on us.
  -                if( profilePoint instanceof CounterInstrument )
  +                if( instrument instanceof CounterInstrument )
                   {
                       switch( proxy.getType() )
                       {
                           case InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER:
                               // Type is the same.
                               // Store a reference to the proxy in the Instrument.
  -                            ( (AbstractInstrument)profilePoint ).setInstrumentProxy( proxy );
  +                            ( (AbstractInstrument)instrument ).setInstrumentProxy( proxy );
                               break;
   
                           case InstrumentManagerClient.INSTRUMENT_TYPE_NONE:
  @@ -899,23 +987,23 @@
                               proxy.setType( InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER );
   
                               // Store a reference to the proxy in the Instrument.
  -                            ( (AbstractInstrument)profilePoint ).setInstrumentProxy( proxy );
  +                            ( (AbstractInstrument)instrument ).setInstrumentProxy( proxy );
                               break;
   
                           default:
  -                            throw new ServiceException( profilePointName,
  -                                "Instruments of more than one type are assigned to name: " +
  -                                profilePointName );
  +                            throw new ServiceException( instrumentName,
  +                                "Instruments of more than one type are assigned to name: "
  +                                + instrumentName );
                       }
                   }
  -                else if( profilePoint instanceof ValueInstrument )
  +                else if( instrument instanceof ValueInstrument )
                   {
                       switch( proxy.getType() )
                       {
                           case InstrumentManagerClient.INSTRUMENT_TYPE_VALUE:
                               // Type is the same.
                               // Store a reference to the proxy in the Instrument.
  -                            ( (AbstractInstrument)profilePoint ).setInstrumentProxy( proxy );
  +                            ( (AbstractInstrument)instrument ).setInstrumentProxy( proxy );
                               break;
   
                           case InstrumentManagerClient.INSTRUMENT_TYPE_NONE:
  @@ -923,41 +1011,62 @@
                               proxy.setType( InstrumentManagerClient.INSTRUMENT_TYPE_VALUE );
   
                               // Store a reference to the proxy in the Instrument.
  -                            ( (AbstractInstrument)profilePoint ).setInstrumentProxy( proxy );
  +                            ( (AbstractInstrument)instrument ).setInstrumentProxy( proxy );
                               break;
   
                           default:
  -                            throw new ServiceException( profilePointName,
  -                                "Instruments of more than one type are assigned to name: " +
  -                                profilePointName );
  +                            throw new ServiceException( instrumentName,
  +                                "Instruments of more than one type are assigned to name: "
  +                                + instrumentName );
                       }
                   }
                   else
                   {
  -                    throw new ServiceException( profilePointName, "Encountered an unknown Instrument type for " +
  -                                                  "the Instrument with name, " + profilePointName + ": " +
  -                                                  profilePoint.getClass().getName() );
  +                    throw new ServiceException( instrumentName, "Encountered an unknown Instrument "
  +                        + "type for the Instrument with name, " + instrumentName + ": "
  +                        + instrument.getClass().getName() );
                   }
  +                
  +                // Mark the instrument proxy as registered.
  +                proxy.setRegistered();
               }
           }
   
  -        // Loop over the child Instrumentables and register their Instruments as well.
  -        Instrumentable[] childInstrumentables = instrumentable.getChildInstrumentables();
  -        for( int i = 0; i < childInstrumentables.length; i++ )
  +        // Loop over the child Instrumentables published by this Instrumentable
  +        Instrumentable[] children = instrumentable.getChildInstrumentables();
  +        for ( int i = 0; i < children.length; i++ )
           {
  +            Instrumentable child = children[i];
  +            
               // Make sure that the child instrumentable name is set.
  -            if( childInstrumentables[ i ].getInstrumentableName() == null )
  +            String childName = child.getInstrumentableName();
  +            if( childName == null )
               {
  -                String msg = "The getInstrumentableName of a child Instrumentable returned null.  " +
  -                    "Instance of " + instrumentable.getClass().getName();
  +                String msg = "The getInstrumentableName() method of a child Instrumentable of " +
  +                    instrumentableName + " returned null.  Child class: " +
  +                    child.getClass().getName();
                   getLogger().debug( msg );
                   throw new ServiceException( instrumentable.getClass().getName(), msg );
               }
  -
  -            String instrumentableChildName = instrumentableName + "." +
  -                childInstrumentables[ i ].getInstrumentableName();
  -
  -            registerInstruments( childInstrumentables[ i ], instrumentableProxy, instrumentableChildName );
  +            
  +            String fullChildName = instrumentableName + "." + childName;
  +            
  +            getLogger().debug( "Registering Child Instrumentable: " + fullChildName );
  +            
  +            // See if a proxy exists for the child Instrumentable yet.
  +            InstrumentableProxy proxy =
  +                instrumentableProxy.getChildInstrumentableProxy( fullChildName );
  +            if( proxy == null )
  +            {
  +                proxy = new InstrumentableProxy(
  +                    this, instrumentableProxy, fullChildName, childName );
  +                proxy.enableLogging( getLogger() );
  +                
  +                instrumentableProxy.addChildInstrumentableProxy( proxy );
  +            }
  +            
  +            // Recurse to the child
  +            registerInstrumentableInner( child, proxy, fullChildName );
           }
       }
   }
  
  
  
  1.2       +270 -165  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentProxy.java
  
  Index: InstrumentProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentProxy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentProxy.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ InstrumentProxy.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -13,12 +13,8 @@
   import java.util.HashMap;
   import java.util.Iterator;
   
  -import org.apache.excalibur.instrument.manager.interfaces.CounterInstrumentListener;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentDescriptor;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentListener;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleDescriptor;
  -import org.apache.excalibur.instrument.manager.interfaces.ValueInstrumentListener;
  +import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleUtils;
   
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -45,65 +41,77 @@
       extends AbstractLogEnabled
       implements org.apache.excalibur.instrument.InstrumentProxy, Configurable
   {
  +    /** The InstrumentableProxy which owns the InstrumentProxy. */
  +    private InstrumentableProxy m_instrumentableProxy;
  +    
       /** Configured flag. */
       private boolean m_configured;
  -
  +    
  +    /** Registered flag. */
  +    private boolean m_registered;
  +    
       /** The name used to identify a Instrument. */
       private String m_name;
  -
  +    
       /** The description of the Instrumente. */
       private String m_description;
  -
  +    
       /** The Descriptor for the Instrument. */
  -    private InstrumentDescriptor m_descriptor;
  -
  +    private InstrumentDescriptorLocal m_descriptor;
  +    
       /** Type of the Instrument */
       private int m_type;
  -
  +    
       /** Array of registered Counter/ValueInstrumentListeners. */
       private InstrumentListener[] m_listeners;
  -
  +    
       /** Map of the maintained InstrumentSamples. */
       private HashMap m_samples = new HashMap();
  -
  +    
       /** Optimized array of the InstrumentSamples. */
       private InstrumentSample[] m_sampleArray;
  -
  -    /** Optimized array of the InstrumentSampleDescriptors. */
  -    private InstrumentSampleDescriptor[] m_sampleDescriptorArray;
  -
  +    
  +    /** Optimized array of the InstrumentSampleDescriptorLocals. */
  +    private InstrumentSampleDescriptorLocal[] m_sampleDescriptorArray;
  +    
       /** Child logger to use for logging of new values. */
       private Logger m_valueLogger;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new InstrumentProxy.
        *
  -     * @param name The name used to identify a Instrument.
  -     */
  -    InstrumentProxy( String name )
  +     * @param instrumentableProxy The InstrumentableProxy which owns the
  +     *                            InstrumentProxy.
  +     * @param name The name used to identify a Instrumentable.
  +     * @param description The description of the the Instrumentable.
  +     */
  +    InstrumentProxy( InstrumentableProxy instrumentableProxy,
  +                     String name,
  +                     String description )
       {
  -        // Default description equals the name in case it is not set later.
  -        m_description = m_name = name;
  -
  +        m_instrumentableProxy = instrumentableProxy;
  +        m_name = name;
  +        m_description = description;
  +        
           // Create the descriptor
  -        m_descriptor = new InstrumentDescriptorImpl( this );
  +        m_descriptor = new InstrumentDescriptorLocalImpl( this );
       }
  -
  +    
       /*---------------------------------------------------------------
        * LogEnabled Methods
        *-------------------------------------------------------------*/
       public void enableLogging( Logger logger )
       {
           super.enableLogging( logger );
  -
  +        
           // Create a child logger for logging setValue and increment calls so
           //  that they can be filtered out.
           m_valueLogger = logger.getChildLogger( "values" );
       }
  -
  +    
       /*---------------------------------------------------------------
        * Configurable Methods
        *-------------------------------------------------------------*/
  @@ -124,48 +132,50 @@
           {
               // The description is optional
               m_description = configuration.getAttribute( "description", m_name );
  -
  +            
               if ( getLogger().isDebugEnabled() )
               {
                   getLogger().debug( "Configuring Instrument: " + m_name + " as \"" +
                       m_description + "\"" );
               }
  -
  +            
               m_configured = true;
  -
  +            
               // Configure any Samples
               Configuration[] sampleConfs = configuration.getChildren( "sample" );
               for ( int i = 0; i < sampleConfs.length; i++ )
               {
                   Configuration sampleConf = sampleConfs[i];
  -
  -                int sampleType = InstrumentSampleFactory.resolveInstrumentSampleType(
  +                
  +                int sampleType = InstrumentSampleUtils.resolveInstrumentSampleType(
                       sampleConf.getAttribute( "type" ) );
                   long sampleInterval = sampleConf.getAttributeAsLong( "interval" );
                   int sampleSize = sampleConf.getAttributeAsInteger( "size", 1 );
  -
  +                
                   // Build the sample name from its attributes.  This makes it
                   //  possible to avoid forcing the user to maintain a name as well.
  -                String sampleName =
  -                    generateSampleName( m_name, sampleType, sampleInterval, sampleSize );
  -
  +                String sampleName = InstrumentSampleUtils.generateFullInstrumentSampleName(
  +                    m_name, sampleType, sampleInterval, sampleSize );
  +                
                   String sampleDescription = sampleConf.getAttribute( "description", sampleName );
  -
  +                
                   if ( getLogger().isDebugEnabled() )
                   {
  -                    getLogger().debug( "Configuring InstrumentSample: " + sampleName +
  +                    getLogger().debug( "Configuring InstrumentSample: " + sampleName + 
                           " as \"" + sampleDescription + "\"" );
                   }
  -
  -                InstrumentSample instrumentSample = InstrumentSampleFactory.getInstrumentSample(
  +                
  +                AbstractInstrumentSample instrumentSample = 
  +                    (AbstractInstrumentSample)InstrumentSampleFactory.getInstrumentSample( this,
                       sampleType, sampleName, sampleInterval, sampleSize, sampleDescription, 0 );
                   instrumentSample.enableLogging( getLogger() );
  -
  +                instrumentSample.setConfigured();
  +                
                   addInstrumentSample( instrumentSample );
               }
           }
       }
  -
  +    
       /*---------------------------------------------------------------
        * InstrumentProxy Methods
        *-------------------------------------------------------------*/
  @@ -178,7 +188,7 @@
       public boolean isActive() {
           return m_listeners != null;
       }
  -
  +    
       /**
        * Increments the Instrument by a specified count.  This method should be
        *  optimized to be extremely light weight when there are no registered
  @@ -194,12 +204,12 @@
               throw new IllegalStateException(
                   "The proxy is not configured to handle CounterInstruments." );
           }
  -
  +        
           // Check the count
           if ( count <= 0 ) {
               throw new IllegalArgumentException( "Count must be a positive value." );
           }
  -
  +        
           // Get a local reference to the listeners, so that synchronization can be avoided.
           InstrumentListener[] listeners = m_listeners;
           if ( listeners != null )
  @@ -208,7 +218,7 @@
               {
                   m_valueLogger.debug( "increment() called for Instrument, " + m_name );
               }
  -
  +            
               long time = System.currentTimeMillis();
               for ( int i = 0; i < listeners.length; i++ )
               {
  @@ -218,7 +228,7 @@
               }
           }
       }
  -
  +    
       /**
        * Sets the current value of the Instrument.  This method is optimized
        *  to be extremely light weight when there are no registered
  @@ -234,7 +244,7 @@
               throw new IllegalStateException(
                   "The proxy is not configured to handle ValueInstruments." );
           }
  -
  +        
           // Get a local reference to the listeners, so that synchronization can be avoided.
           InstrumentListener[] listeners = m_listeners;
           if ( listeners != null )
  @@ -243,7 +253,7 @@
               {
                   m_valueLogger.debug( "setValue( " + value + " ) called for Instrument, " + m_name );
               }
  -
  +            
               long time = System.currentTimeMillis();
               for ( int i = 0; i < listeners.length; i++ )
               {
  @@ -253,11 +263,21 @@
               }
           }
       }
  -
  +    
       /*---------------------------------------------------------------
        * Methods
        *-------------------------------------------------------------*/
       /**
  +     * Returns the InstrumentableProxy which owns the InstrumentProxy.
  +     *
  +     * @return The InstrumentableProxy which owns the InstrumentProxy.
  +     */
  +    InstrumentableProxy getInstrumentableProxy()
  +    {
  +        return m_instrumentableProxy;
  +    }
  +    
  +    /**
        * Returns true if the Instrument was configured in the instrumentables
        *  section of the configuration.
        *
  @@ -269,6 +289,26 @@
       }
   
       /**
  +     * Returns true if the Instrument was registered with the Instrument
  +     *  Manager.
  +     *
  +     * @return True if registered.
  +     */
  +    boolean isRegistered()
  +    {
  +        return m_registered;
  +    }
  +    
  +    /**
  +     * Called by the InstrumentManager whenever an Instrument assigned to
  +     *  this proxy is registered.
  +     */
  +    void setRegistered()
  +    {
  +        m_registered = true;
  +    }
  +    
  +    /**
        * Gets the name for the Instrument.  The Instrument Name is used to
        *  uniquely identify the Instrument during the configuration of the
        *  Profiler and to gain access to a InstrumentDescriptor through a
  @@ -276,11 +316,11 @@
        *
        * @return The name used to identify a Instrumentable.
        */
  -    String getName()
  +    String getName() 
       {
           return m_name;
       }
  -
  +    
       /**
        * Sets the description for the Instrument.  This description will
        *  be set during the configuration of the profiler if a configuration
  @@ -292,7 +332,7 @@
       {
           m_description = description;
       }
  -
  +    
       /**
        * Gets the description of the Instrument.
        *
  @@ -302,17 +342,17 @@
       {
           return m_description;
       }
  -
  +    
       /**
        * Returns a Descriptor for the Instrument.
        *
        * @return A Descriptor for the Instrument.
        */
  -    InstrumentDescriptor getDescriptor()
  +    InstrumentDescriptorLocal getDescriptor()
       {
           return m_descriptor;
       }
  -
  +    
       /**
        * Set the type of the Instrument.  Once set, the type can not be changed.
        *
  @@ -337,7 +377,7 @@
               }
           }
       }
  -
  +    
       /**
        * Returns the type of the Instrument.
        *
  @@ -347,7 +387,7 @@
       {
           return m_type;
       }
  -
  +    
       /**
        * Adds a CounterInstrumentListener to the list of listeners which will
        *  receive updates of the value of the Instrument.
  @@ -366,16 +406,16 @@
               throw new IllegalStateException(
                   "The proxy is not configured to handle CounterInstruments." );
           }
  -
  +        
           if ( getLogger().isDebugEnabled() )
           {
               getLogger().debug( "A CounterInstrumentListener was added to Instrument, " +
                   m_name + " : " + listener.getClass().getName() );
           }
  -
  +        
           addInstrumentListener( listener );
       }
  -
  +    
       /**
        * Removes a InstrumentListener from the list of listeners which will
        *  receive profile events.
  @@ -394,16 +434,16 @@
               throw new IllegalStateException(
                   "The proxy is not configured to handle CounterInstruments." );
           }
  -
  +        
           if ( getLogger().isDebugEnabled() )
           {
  -            getLogger().debug( "A CounterInstrumentListener was removed from Instrument, " +
  +            getLogger().debug( "A CounterInstrumentListener was removed from Instrument, " + 
                   m_name + " : " + listener.getClass().getName() );
           }
  -
  +        
           removeInstrumentListener( listener );
       }
  -
  +    
       /**
        * Adds a ValueInstrumentListener to the list of listeners which will
        *  receive updates of the value of the Instrument.
  @@ -422,16 +462,16 @@
               throw new IllegalStateException(
                   "The proxy is not configured to handle ValueInstruments." );
           }
  -
  +        
           if ( getLogger().isDebugEnabled() )
           {
               getLogger().debug( "A ValueInstrumentListener was added to Instrument, " + m_name +
                   " : " + listener.getClass().getName() );
           }
  -
  +        
           addInstrumentListener( listener );
       }
  -
  +    
       /**
        * Removes a InstrumentListener from the list of listeners which will
        *  receive profile events.
  @@ -450,22 +490,22 @@
               throw new IllegalStateException(
                   "The proxy is not configured to handle ValueInstruments." );
           }
  -
  +        
           if ( getLogger().isDebugEnabled() )
           {
               getLogger().debug( "A ValueInstrumentListener was removed from Instrument, " + m_name +
                   " : " + listener.getClass().getName() );
           }
  -
  +        
           removeInstrumentListener( listener );
       }
  -
  +    
       /**
        * Add a InstrumentSample to the Instrument.
        *
        * @param InstrumentSample InstrumentSample to be added.
        */
  -    private void addInstrumentSample( InstrumentSample InstrumentSample )
  +    private void addInstrumentSample( InstrumentSample instrumentSample )
       {
           synchronized(this)
           {
  @@ -473,43 +513,43 @@
               //  the same type.
               if ( m_type == InstrumentManagerClient.INSTRUMENT_TYPE_NONE )
               {
  -                setType( InstrumentSample.getInstrumentType() );
  +                setType( instrumentSample.getInstrumentType() );
               }
  -            else if ( m_type != InstrumentSample.getInstrumentType() )
  +            else if ( m_type != instrumentSample.getInstrumentType() )
               {
                   // The type is different.
  -                throw new IllegalStateException( "The sample '" + InstrumentSample.getName() +
  -                    "' had its type set to " + getTypeName( m_type ) +
  -                    " by another sample.  This sample has a type of " +
  -                    getTypeName( InstrumentSample.getInstrumentType() ) + " and is not compatible." );
  +                throw new IllegalStateException( "The sample '" + instrumentSample.getName() + 
  +                    "' had its type set to " + getTypeName( m_type ) + 
  +                    " by another sample.  This sample has a type of " + 
  +                    getTypeName( instrumentSample.getInstrumentType() ) + " and is not compatible." );
               }
  -
  +            
               // Make sure that a sample with the same name has not already been set.
  -            String sampleName = InstrumentSample.getName();
  +            String sampleName = instrumentSample.getName();
               if ( m_samples.get( sampleName ) != null )
               {
                   throw new IllegalStateException( "More than one sample with the same name, '" +
                       sampleName + "', can not be configured." );
               }
  -
  +        
               // Sample is safe to add.
  -            m_samples.put( sampleName, InstrumentSample );
  -
  +            m_samples.put( sampleName, instrumentSample );
  +            
               // Clear the optimized arrays
               m_sampleArray = null;
               m_sampleDescriptorArray = null;
  -
  +            
               // Add the sample as a listener for this Instrument.
               switch ( m_type )
               {
               case InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER:
  -                addCounterInstrumentListener( (CounterInstrumentSample)InstrumentSample );
  +                addCounterInstrumentListener( (CounterInstrumentSample)instrumentSample );
                   break;
  -
  +                
               case InstrumentManagerClient.INSTRUMENT_TYPE_VALUE:
  -                addValueInstrumentListener( (AbstractValueInstrumentSample)InstrumentSample );
  +                addValueInstrumentListener( (AbstractValueInstrumentSample)instrumentSample );
                   break;
  -
  +                
               default:
                   throw new IllegalStateException(
                       "Don't know how to deal with the type: " + m_type );
  @@ -518,6 +558,40 @@
       }
   
       /**
  +     * Removes an InstrumentSample from the Instrument.
  +     *
  +     * @param InstrumentSample InstrumentSample to be removed.
  +     */
  +    void removeInstrumentSample( InstrumentSample instrumentSample )
  +    {
  +        synchronized(this)
  +        {
  +            // Remove the sample from the listener list for this Instrument.
  +            switch ( m_type )
  +            {
  +            case InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER:
  +                removeCounterInstrumentListener( (CounterInstrumentSample)instrumentSample );
  +                break;
  +                
  +            case InstrumentManagerClient.INSTRUMENT_TYPE_VALUE:
  +                removeValueInstrumentListener( (AbstractValueInstrumentSample)instrumentSample );
  +                break;
  +                
  +            default:
  +                throw new IllegalStateException(
  +                    "Don't know how to deal with the type: " + m_type );
  +            }
  +            
  +            // Remove the sample.
  +            m_samples.remove( instrumentSample.getName() );
  +            
  +            // Clear the optimized arrays
  +            m_sampleArray = null;
  +            m_sampleDescriptorArray = null;
  +        }
  +    }
  +    
  +    /**
        * Returns a InstrumentSample based on its name.
        *
        * @param InstrumentSampleName Name of the InstrumentSample being requested.
  @@ -531,7 +605,7 @@
               return (InstrumentSample)m_samples.get( InstrumentSampleName );
           }
       }
  -
  +    
       /**
        * Returns an array of the InstrumentSamples in the Instrument.
        *
  @@ -546,11 +620,11 @@
           }
           return samples;
       }
  -
  +    
       /**
  -     * Returns a InstrumentSampleDescriptor based on its name.  If the requested
  -     *  sample is invalid in any way, then an expired Descriptor will be
  -     *  returned.
  +     * Returns a InstrumentSampleDescriptorLocal based on its name.  If the
  +     *  requested sample is invalid in any way, then an expired Descriptor
  +     *  will be returned.
        *
        * @param sampleDescription Description to assign to the new Sample.
        * @param sampleInterval Sample interval to use in the new Sample.
  @@ -564,31 +638,33 @@
        *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
        *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN.
        *
  -     * @return A Descriptor of the requested InstrumentSample.
  +     * @return The requested InstrumentSample.
        *
        * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
        *                                      does not exist.
        */
  -    InstrumentSampleDescriptor createInstrumentSample( String sampleDescription,
  -                                                       long sampleInterval,
  -                                                       int sampleSize,
  -                                                       long sampleLease,
  -                                                       int sampleType )
  +    InstrumentSample createInstrumentSample( String sampleDescription,
  +                                             long sampleInterval,
  +                                             int sampleSize,
  +                                             long sampleLease,
  +                                             int sampleType )
       {
  -        getLogger().info("Create new sample for " + m_name + ": interval=" + sampleInterval +
  +        getLogger().debug("Create new sample for " + m_name + ": interval=" + sampleInterval +
               ", size=" + sampleSize + ", lease=" + sampleLease + ", type=" +
  -            InstrumentSampleFactory.getInstrumentSampleTypeName( sampleType ) );
  -
  +            InstrumentSampleUtils.getInstrumentSampleTypeName( sampleType ) );
  +        
           // Validate the parameters
           long now = System.currentTimeMillis();
  -
  +        
           // Generate a name for the new sample
  -        String sampleName = generateSampleName( m_name, sampleType, sampleInterval, sampleSize );
  -
  +        String sampleName = InstrumentSampleUtils.generateFullInstrumentSampleName(
  +            m_name, sampleType, sampleInterval, sampleSize );
  +        
  +        InstrumentSample instrumentSample;
           synchronized( this )
           {
               // It is possible that the requested sample already exists.
  -            InstrumentSample instrumentSample = getInstrumentSample( sampleName );
  +            instrumentSample = getInstrumentSample( sampleName );
               if ( instrumentSample != null )
               {
                   // The requested sample already exists.
  @@ -598,17 +674,21 @@
               {
                   // The new sample needs to be created.
                   instrumentSample = InstrumentSampleFactory.getInstrumentSample(
  -                    sampleType, sampleName, sampleInterval, sampleSize,
  +                    this, sampleType, sampleName, sampleInterval, sampleSize,
                       sampleDescription, sampleLease );
                   instrumentSample.enableLogging( getLogger() );
  -
  +                
                   addInstrumentSample( instrumentSample );
  +                
  +                // Register the new sample with the InstrumentManager
  +                getInstrumentableProxy().getInstrumentManager().
  +                    registerLeasedInstrumentSample( instrumentSample );
               }
  -
  -            return instrumentSample.getDescriptor();
           }
  +        
  +        return instrumentSample;
       }
  -
  +    
       /**
        * Returns an array of Descriptors for the InstrumentSamples in the
        *  Instrument.
  @@ -616,16 +696,16 @@
        * @return An array of Descriptors for the InstrumentSamples in the
        *         Instrument.
        */
  -    InstrumentSampleDescriptor[] getInstrumentSampleDescriptors()
  +    InstrumentSampleDescriptorLocal[] getInstrumentSampleDescriptors()
       {
  -        InstrumentSampleDescriptor[] descriptors = m_sampleDescriptorArray;
  +        InstrumentSampleDescriptorLocal[] descriptors = m_sampleDescriptorArray;
           if ( descriptors == null )
           {
               descriptors = updateInstrumentSampleDescriptorArray();
           }
           return descriptors;
       }
  -
  +    
       /**
        * Common code to add a listener to the list of listeners which will
        *  receive updates of the value of the Instrument.
  @@ -653,12 +733,12 @@
                   System.arraycopy( oldListeners, 0, newListeners, 0, oldListeners.length );
                   newListeners[ oldListeners.length ] = listener;
               }
  -
  +            
               // Update the m_listeners field.
               m_listeners = newListeners;
           }
       }
  -
  +    
       /**
        * Common code to remove a listener from the list of listeners which will
        *  receive updates of the value of the Instrument.
  @@ -706,7 +786,7 @@
                           break;
                       }
                   }
  -
  +                
                   if ( pos < 0 )
                   {
                       // The listener was not in the list.
  @@ -723,17 +803,17 @@
                       if ( pos < oldListeners.length - 1 )
                       {
                           // Copy the tail of the array
  -                        System.arraycopy( oldListeners, pos + 1,
  +                        System.arraycopy( oldListeners, pos + 1, 
                               newListeners, pos, oldListeners.length - 1 - pos );
                       }
                   }
               }
  -
  +            
               // Update the m_listeners field.
               m_listeners = newListeners;
           }
       }
  -
  +    
       /**
        * Updates the cached array of InstrumentSamples taking synchronization into
        *  account.
  @@ -746,7 +826,7 @@
           {
               m_sampleArray = new InstrumentSample[ m_samples.size() ];
               m_samples.values().toArray( m_sampleArray );
  -
  +            
               // Sort the array.  This is not a performance problem because this
               //  method is rarely called and doing it here saves cycles in the
               //  client.
  @@ -757,24 +837,24 @@
                           return ((InstrumentSample)o1).getDescription().
                               compareTo( ((InstrumentSample)o2).getDescription() );
                       }
  -
  +                    
                       public boolean equals( Object obj )
                       {
                           return false;
                       }
                   } );
  -
  +            
               return m_sampleArray;
           }
       }
  -
  +    
       /**
  -     * Updates the cached array of InstrumentSampleDescriptors taking
  +     * Updates the cached array of InstrumentSampleDescriptorLocals taking
        *  synchronization into account.
        *
        * @return An array of the InstrumentSampleDescriptors.
        */
  -    private InstrumentSampleDescriptor[] updateInstrumentSampleDescriptorArray()
  +    private InstrumentSampleDescriptorLocal[] updateInstrumentSampleDescriptorArray()
       {
           synchronized(this)
           {
  @@ -782,40 +862,49 @@
               {
                   updateInstrumentSampleArray();
               }
  -
  +            
               m_sampleDescriptorArray =
  -                new InstrumentSampleDescriptor[ m_sampleArray.length ];
  +                new InstrumentSampleDescriptorLocal[ m_sampleArray.length ];
               for ( int i = 0; i < m_sampleArray.length; i++ )
               {
                   m_sampleDescriptorArray[i] = m_sampleArray[i].getDescriptor();
               }
  -
  +            
               return m_sampleDescriptorArray;
           }
       }
  -
  +    
       /**
        * Saves the current state into a Configuration.
        *
  -     * @param useCompactSamples Flag for whether or not InstrumentSample data
  -     *                          should be saved in compact format or not.
  -     *
  -     * @return The state as a Configuration.
  +     * @return The state as a Configuration.  Returns null if the configuration
  +     *         would not contain any information.
        */
  -    Configuration saveState( boolean useCompactSamples )
  +    Configuration saveState()
       {
  +        boolean empty = true;
           DefaultConfiguration state = new DefaultConfiguration( "instrument", "-" );
           state.setAttribute( "name", m_name );
  -
  +        
           InstrumentSample[] samples = getInstrumentSamples();
           for ( int i = 0; i < samples.length; i++ )
           {
  -            state.addChild( samples[i].saveState( useCompactSamples ) );
  +            Configuration childState = samples[i].saveState();
  +            if ( childState != null )
  +            {
  +                state.addChild( childState );
  +                empty = false;
  +            }
  +        }
  +        
  +        // Only return a state if it contains information.
  +        if ( empty )
  +        {
  +            state = null;
           }
  -
           return state;
       }
  -
  +    
       /**
        * Loads the state into the Instrument.
        *
  @@ -828,25 +917,56 @@
       {
           synchronized( this )
           {
  -            Configuration[] InstrumentSampleConfs = state.getChildren( "sample" );
  -            for ( int i = 0; i < InstrumentSampleConfs.length; i++ )
  +            Configuration[] instrumentSampleConfs = state.getChildren( "sample" );
  +            for ( int i = 0; i < instrumentSampleConfs.length; i++ )
               {
  -                Configuration InstrumentSampleConf = InstrumentSampleConfs[i];
  -                String name = InstrumentSampleConf.getAttribute( "name" );
  -                InstrumentSample sample = getInstrumentSample( name );
  +                Configuration instrumentSampleConf = instrumentSampleConfs[i];
  +                
  +                int sampleType = InstrumentSampleUtils.resolveInstrumentSampleType(
  +                    instrumentSampleConf.getAttribute( "type" ) );
  +                long sampleInterval = instrumentSampleConf.getAttributeAsLong( "interval" );
  +                int sampleSize = instrumentSampleConf.getAttributeAsInteger( "size", 1 );
  +                
  +                // Build the sample name from its attributes.  This makes it
  +                //  possible to avoid forcing the user to maintain a name as well.
  +                String fullSampleName = InstrumentSampleUtils.generateFullInstrumentSampleName(
  +                    m_name, sampleType, sampleInterval, sampleSize );
  +                InstrumentSample sample = getInstrumentSample( fullSampleName );
                   if ( sample == null )
                   {
  -                    getLogger().warn( "InstrumentSample entry ignored while loading state because the " +
  -                        "sample does not exist: " + name );
  +                    // Sample does not exist, see if it is a leased sample.
  +                    long leaseExpirationTime =
  +                        instrumentSampleConf.getAttributeAsLong( "lease-expiration", 0 );
  +                    if ( leaseExpirationTime > 0 )
  +                    {
  +                        
  +                        String sampleName = InstrumentSampleUtils.generateInstrumentSampleName(
  +                            sampleType, sampleInterval, sampleSize );
  +                        String sampleDescription =
  +                            instrumentSampleConf.getAttribute( "description", sampleName );
  +                        
  +                        AbstractInstrumentSample instrumentSample = 
  +                            (AbstractInstrumentSample)InstrumentSampleFactory.getInstrumentSample(
  +                            this, sampleType, fullSampleName, sampleInterval, sampleSize,
  +                            sampleDescription, 0 );
  +                        instrumentSample.enableLogging( getLogger() );
  +                        instrumentSample.loadState( instrumentSampleConf );
  +                        addInstrumentSample( instrumentSample );
  +                    }
  +                    else
  +                    {
  +                        getLogger().warn( "InstrumentSample entry ignored while loading state " +
  +                            "because the sample does not exist: " + fullSampleName );
  +                    }
                   }
                   else
                   {
  -                    sample.loadState( InstrumentSampleConf );
  +                    sample.loadState( instrumentSampleConf );
                   }
               }
           }
       }
  -
  +    
       /**
        * Returns the name of a Instrument type.
        *
  @@ -867,20 +987,5 @@
           default:
               throw new IllegalArgumentException( type + " is not a known Instrument type." );
           }
  -    }
  -
  -    /**
  -     * Generates a sample name given its parameters.
  -     *
  -     * @param instrumentName Name of the instrument which owns the sample.
  -     */
  -    private String generateSampleName( String instrumentName,
  -                                       int sampleType,
  -                                       long sampleInterval,
  -                                       int sampleSize )
  -    {
  -        return instrumentName + "." +
  -            InstrumentSampleFactory.getInstrumentSampleTypeName( sampleType ) + "." +
  -            sampleInterval + "." + sampleSize;
       }
   }
  
  
  
  1.2       +43 -26    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSample.java
  
  Index: InstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ InstrumentSample.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -7,8 +7,6 @@
    */
   package org.apache.excalibur.instrument.manager;
   
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleDescriptor;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleListener;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleSnapshot;
   
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -27,52 +25,70 @@
    * @version CVS $Revision$ $Date$
    * @since 4.1
    */
  -public interface InstrumentSample
  +interface InstrumentSample
       extends LogEnabled
   {
       /**
  +     * Returns the InstrumentProxy which owns the InstrumentSample.
  +     *
  +     * @return The InstrumentProxy which owns the InstrumentSample.
  +     */
  +    InstrumentProxy getInstrumentProxy();
  +    
  +    /**
        * Returns true if the InstrumentSample was configured in the instrumentables
        *  section of the configuration.
        *
        * @return True if configured.
        */
       boolean isConfigured();
  -
  +    
       /**
        * Returns the name of the sample.
        *
        * @return The name of the sample.
        */
       String getName();
  -
  +    
       /**
        * Returns the sample interval.  The period of each sample in millisends.
        *
        * @return The sample interval.
        */
       long getInterval();
  -
  +    
       /**
        * Returns the number of samples in the sample history.
        *
        * @return The size of the sample history.
        */
       int getSize();
  -
  +    
       /**
        * Returns the description of the sample.
        *
        * @return The description of the sample.
        */
       String getDescription();
  -
  +    
  +    /**
  +     * Returns the type of the Instrument Sample.  Possible values include
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER,
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN, or
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM.
  +     *
  +     * @return The type of the Instrument Sample.
  +     */
  +    int getType();
  +    
       /**
        * Returns a Descriptor for the InstrumentSample.
        *
        * @return A Descriptor for the InstrumentSample.
        */
  -    InstrumentSampleDescriptor getDescriptor();
  -
  +    InstrumentSampleDescriptorLocal getDescriptor();
  +    
       /**
        * Obtain the value of the sample.  All samples are integers, so the profiled
        * objects must measure quantity (numbers of items), rate (items/period), time in
  @@ -81,14 +97,14 @@
        * @return The sample value.
        */
       int getValue();
  -
  +    
       /**
        * Obtain the UNIX time of the beginning of the sample.
        *
        * @return The UNIX time of the beginning of the sample.
        */
       long getTime();
  -
  +    
       /**
        * Returns the Type of the Instrument which can use the sample.  This
        *  should be the same for all instances of a class.
  @@ -99,7 +115,7 @@
        * @return The Type of the Instrument which can use the sample.
        */
       int getInstrumentType();
  -
  +    
       /**
        * Returns the time that the current lease expires.  Permanent samples will
        *  return a value of 0.
  @@ -107,21 +123,24 @@
        * @return The time that the current lease expires.
        */
       long getLeaseExpirationTime();
  -
  +    
       /**
        * Extends the lease to be lease milliseconds from the current time.
        *
        * @param lease The length of the lease in milliseconds.
  +     *
  +     * @return The new lease expiration time.  Returns 0 if the sample is
  +     *         permanent.
        */
  -    void extendLease( long lease );
  -
  +    long extendLease( long lease );
  +    
       /**
        * Obtains a static snapshot of the InstrumentSample.
        *
        * @return A static snapshot of the InstrumentSample.
        */
       InstrumentSampleSnapshot getSnapshot();
  -
  +    
       /**
        * Registers a InstrumentSampleListener with a InstrumentSample given a name.
        *
  @@ -129,7 +148,7 @@
        *                 InstrumentSample.
        */
       void addInstrumentSampleListener( InstrumentSampleListener listener );
  -
  +    
       /**
        * Unregisters a InstrumentSampleListener from a InstrumentSample given a name.
        *
  @@ -137,17 +156,15 @@
        *                 InstrumentSample.
        */
       void removeInstrumentSampleListener( InstrumentSampleListener listener );
  -
  +    
       /**
        * Saves the current state into a Configuration.
        *
  -     * @param useCompactSamples Flag for whether or not InstrumentSample data
  -     *                          should be saved in compact format or not.
  -     *
  -     * @return The state as a Configuration.
  +     * @return The state as a Configuration.  Returns null if the configuration
  +     *         would not contain any information.
        */
  -    Configuration saveState( boolean useCompactSamples );
  -
  +    Configuration saveState();
  +    
       /**
        * Loads the state into the InstrumentSample.
        *
  
  
  
  1.2       +18 -65    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSampleFactory.java
  
  Index: InstrumentSampleFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSampleFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentSampleFactory.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ InstrumentSampleFactory.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -8,6 +8,7 @@
   package org.apache.excalibur.instrument.manager;
   
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  +
   import org.apache.avalon.framework.configuration.ConfigurationException;
   
   /**
  @@ -23,6 +24,8 @@
       /**
        * A Profile Sample Type loaded in from a Configuration.
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param type Type of the InstrumentSample to create.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
  @@ -31,7 +34,8 @@
        * @param lease Requested lease time in milliseconds.  A value of 0 implies
        *              that the lease will never expire.
        */
  -    static InstrumentSample getInstrumentSample( int type,
  +    static InstrumentSample getInstrumentSample( InstrumentProxy instrumentProxy,
  +                                                 int type,
                                                    String name,
                                                    long interval,
                                                    int size,
  @@ -41,74 +45,23 @@
           switch ( type )
           {
           case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM:
  -            return new MaximumValueInstrumentSample( name, interval, size, description, lease );
  -
  +            return new MaximumValueInstrumentSample(
  +                instrumentProxy, name, interval, size, description, lease );
  +            
           case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM:
  -            return new MinimumValueInstrumentSample( name, interval, size, description, lease );
  -
  +            return new MinimumValueInstrumentSample(
  +                instrumentProxy, name, interval, size, description, lease );
  +        
           case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN:
  -            return new MeanValueInstrumentSample( name, interval, size, description, lease );
  -
  +            return new MeanValueInstrumentSample(
  +                instrumentProxy, name, interval, size, description, lease );
  +            
           case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER:
  -            return new CounterInstrumentSample( name, interval, size, description, lease );
  -
  +            return new CounterInstrumentSample(
  +                instrumentProxy, name, interval, size, description, lease );
  +            
           default:
               throw new IllegalArgumentException( "'" + type + "' is not a valid sample type." );
  -        }
  -    }
  -
  -    /**
  -     * Resolves an instrument sample type based on a name.
  -     *
  -     * @param type Type of the InstrumentSample to resolve.  Accepted values are:
  -     *              "max", "maximum", "min", "minimum", "mean",
  -     *              "ctr", and "counter".
  -     *
  -     * @throws ConfigurationException if the specified sample type is unknown.
  -     */
  -    static int resolveInstrumentSampleType( String type )
  -        throws ConfigurationException {
  -
  -        if ( type.equalsIgnoreCase( "max" ) || type.equalsIgnoreCase( "maximum" ) )
  -        {
  -            return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM;
  -        }
  -        else if ( type.equalsIgnoreCase( "min" ) || type.equalsIgnoreCase( "minimum" ) )
  -        {
  -            return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM;
  -        }
  -        else if ( type.equalsIgnoreCase( "mean" ) )
  -        {
  -            return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN;
  -        }
  -        else if ( type.equalsIgnoreCase( "ctr" ) || type.equalsIgnoreCase( "counter" ) )
  -        {
  -            return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER;
  -        }
  -        else
  -        {
  -            throw new ConfigurationException( "'" + type + "' is not a valid sample type." );
  -        }
  -    }
  -
  -    static String getInstrumentSampleTypeName( int type )
  -    {
  -        switch ( type )
  -        {
  -        case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM:
  -            return "maximum";
  -
  -        case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM:
  -            return "minimum";
  -
  -        case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN:
  -            return "mean";
  -
  -        case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER:
  -            return "counter";
  -
  -        default:
  -            return "unknown-" + type;
           }
       }
   }
  
  
  
  1.2       +353 -47   jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentableProxy.java
  
  Index: InstrumentableProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentableProxy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentableProxy.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ InstrumentableProxy.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -11,8 +11,6 @@
   import java.util.Comparator;
   import java.util.HashMap;
   
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentDescriptor;
  -import org.apache.excalibur.instrument.manager.interfaces.InstrumentableDescriptor;
   import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentException;
   
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -35,9 +33,19 @@
       extends AbstractLogEnabled
       implements Configurable
   {
  +    /** InstrumentManager which owns the proxy. */
  +    private DefaultInstrumentManager m_instrumentManager;
  +    
  +    /** The parent Instrumentable proxy or null if this is a top level
  +     *   Instrumentable. */
  +    private InstrumentableProxy m_parentInstrumentableProxy;
  +    
       /** Configured flag. */
       private boolean m_configured;
   
  +    /** Registered flag. */
  +    private boolean m_registered;
  +
       /** The name used to identify a Instrumentable. */
       private String m_name;
   
  @@ -45,7 +53,16 @@
       private String m_description;
   
       /** The Descriptor for the Instrumentable. */
  -    private InstrumentableDescriptorImpl m_descriptor;
  +    private InstrumentableDescriptorLocalImpl m_descriptor;
  +
  +    /** Map of the Child InstrumentableProxies owned by this InstrumentableProxy. */
  +    private HashMap m_childInstrumentableProxies = new HashMap();
  +
  +    /** Optimized array of the child InstrumentableProxies. */
  +    private InstrumentableProxy[] m_childInstrumentableProxyArray;
  +
  +    /** Optimized array of the child InstrumentableDescriptorLocals. */
  +    private InstrumentableDescriptorLocal[] m_childInstrumentableDescriptorArray;
   
       /** Map of the InstrumentProxies owned by this InstrumentableProxy. */
       private HashMap m_instrumentProxies = new HashMap();
  @@ -53,8 +70,8 @@
       /** Optimized array of the InstrumentProxies. */
       private InstrumentProxy[] m_instrumentProxyArray;
   
  -    /** Optimized array of the InstrumentDescriptors. */
  -    private InstrumentDescriptor[] m_instrumentDescriptorArray;
  +    /** Optimized array of the InstrumentDescriptorLocals. */
  +    private InstrumentDescriptorLocal[] m_instrumentDescriptorArray;
   
       /*---------------------------------------------------------------
        * Constructors
  @@ -62,15 +79,24 @@
       /**
        * Creates a new InstrumentableProxy.
        *
  +     * @param instrumentManager InstrumentManager which owns the proxy.
  +     * @param parentInstrumentableProxy The parent Instrumentable proxy or null
  +     *                                  if this is a top level Instrumentable.
        * @param name The name used to identify a Instrumentable.
  +     * @param description The description of the the Instrumentable.
        */
  -    InstrumentableProxy( String name )
  -    {
  -        // Default description equals the name in case it is not set later.
  -        m_description = m_name = name;
  +    InstrumentableProxy( DefaultInstrumentManager instrumentManager,
  +                         InstrumentableProxy parentInstrumentableProxy,
  +                         String name,
  +                         String description )
  +    {
  +        m_instrumentManager = instrumentManager;
  +        m_parentInstrumentableProxy = parentInstrumentableProxy;
  +        m_name = name;
  +        m_description = description;
   
           // Create the descriptor
  -        m_descriptor = new InstrumentableDescriptorImpl( this );
  +        m_descriptor = new InstrumentableDescriptorLocalImpl( this );
       }
   
       /*---------------------------------------------------------------
  @@ -101,18 +127,39 @@
               }
   
               m_configured = true;
  +            
  +            // Configure any child Instrumentables
  +            Configuration[] childConfs = configuration.getChildren( "instrumentable" );
  +            for( int i = 0; i < childConfs.length; i++ )
  +            {
  +                Configuration childConf = childConfs[ i ];
  +                String childName = childConf.getAttribute( "name" );
  +                String fullChildName = m_name + "." + childName;
  +
  +                InstrumentableProxy childProxy = new InstrumentableProxy(
  +                    m_instrumentManager, this, fullChildName, childName );
  +                childProxy.enableLogging( getLogger() );
  +                childProxy.configure( childConf );
  +                m_childInstrumentableProxies.put( fullChildName, childProxy );
   
  +                // Clear the optimized arrays
  +                m_childInstrumentableProxyArray = null;
  +                m_childInstrumentableDescriptorArray = null;
  +            }
  +            
               // Configure any Instruments
               Configuration[] instrumentConfs = configuration.getChildren( "instrument" );
               for( int i = 0; i < instrumentConfs.length; i++ )
               {
                   Configuration instrumentConf = instrumentConfs[ i ];
  -                String instrumentName = m_name + "." + instrumentConf.getAttribute( "name" );
  +                String instrumentName = instrumentConf.getAttribute( "name" );
  +                String fullInstrumentName = m_name + "." + instrumentName;
   
  -                InstrumentProxy instrumentProxy = new InstrumentProxy( instrumentName );
  +                InstrumentProxy instrumentProxy =
  +                    new InstrumentProxy( this, fullInstrumentName, instrumentName );
                   instrumentProxy.enableLogging( getLogger() );
                   instrumentProxy.configure( instrumentConf );
  -                m_instrumentProxies.put( instrumentName, instrumentProxy );
  +                m_instrumentProxies.put( fullInstrumentName, instrumentProxy );
   
                   // Clear the optimized arrays
                   m_instrumentProxyArray = null;
  @@ -125,6 +172,27 @@
        * Methods
        *-------------------------------------------------------------*/
       /**
  +     * Returns instrumentManager which owns the proxy.
  +     *
  +     * @return InstrumentManager which owns the proxy.
  +     */
  +    DefaultInstrumentManager getInstrumentManager()
  +    {
  +        return m_instrumentManager;
  +    }
  +    
  +    /**
  +     * Returns the parent InstrumentableProxy or null if this is a top level
  +     *  proxy.
  +     *
  +     * @return The parent InstrumentableProxy or null.
  +     */
  +    InstrumentableProxy getParentInstrumentableProxy()
  +    {
  +        return m_parentInstrumentableProxy;
  +    }
  +    
  +    /**
        * Returns true if the instrumentable was configured in the instrumentables
        *  section of the configuration.
        *
  @@ -136,6 +204,26 @@
       }
   
       /**
  +     * Returns true if the Instrumentable was registered with the Instrument
  +     *  Manager.
  +     *
  +     * @return True if registered.
  +     */
  +    boolean isRegistered()
  +    {
  +        return m_registered;
  +    }
  +    
  +    /**
  +     * Called by the InstrumentManager whenever an Instrumentable assigned to
  +     *  this proxy is registered.
  +     */
  +    void setRegistered()
  +    {
  +        m_registered = true;
  +    }
  +    
  +    /**
        * Gets the name for the Instrumentable.  The Instrumentable Name is used to
        *  uniquely identify the Instrumentable during the configuration of the
        *  Profiler and to gain access to a InstrumentableDescriptor through a
  @@ -175,11 +263,178 @@
        *
        * @return A Descriptor for the Instrumentable.
        */
  -    InstrumentableDescriptor getDescriptor()
  +    InstrumentableDescriptorLocal getDescriptor()
       {
           return m_descriptor;
       }
   
  +    /*---------------------------------------------------------------
  +     * Methods (child Instrumentables)
  +     *-------------------------------------------------------------*/
  +    /**
  +     * Adds a child InstrumentableProxy to the Instrumentable.  This method
  +     *  will be called during the configuration phase of the Profiler if an
  +     *  element defining the child Instrumentable exists, or if the
  +     *  Instrumentable registers itself with the InstrumentManager as it
  +     *  is running.
  +     * <p>
  +     * This method should never be called for child Instrumentables which
  +     *  have already been added.
  +     *
  +     * @param childInstrumentableProxy Child InstrumentableProxy to be added.
  +     */
  +    void addChildInstrumentableProxy( InstrumentableProxy childInstrumentableProxy )
  +    {
  +        synchronized( this )
  +        {
  +            m_childInstrumentableProxies.put(
  +                childInstrumentableProxy.getName(), childInstrumentableProxy );
  +
  +            // Clear the optimized arrays
  +            m_childInstrumentableProxyArray = null;
  +            m_childInstrumentableDescriptorArray = null;
  +        }
  +    }
  +
  +    /**
  +     * Returns a child InstrumentableProxy based on its name or the name of any
  +     *  of its children.
  +     *
  +     * @param childInstrumentableName Name of the child Instrumentable being
  +     *                                requested.
  +     *
  +     * @return The requested child InstrumentableProxy or null if does not
  +     *         exist.
  +     */
  +    InstrumentableProxy getChildInstrumentableProxy( String childInstrumentableName )
  +    {
  +        synchronized( this )
  +        {
  +            String name = childInstrumentableName;
  +            while( true )
  +            {
  +                InstrumentableProxy proxy =
  +                    (InstrumentableProxy)m_childInstrumentableProxies.get( name );
  +                if( proxy != null )
  +                {
  +                    return proxy;
  +                }
  +
  +                // Assume this is a child name and try looking with the parent name.
  +                int pos = name.lastIndexOf( '.' );
  +                if( pos > 0 )
  +                {
  +                    name = name.substring( 0, pos );
  +                }
  +                else
  +                {
  +                    return null;
  +                }
  +            }
  +        }
  +    }
  +
  +    /**
  +     * Returns an array of Proxies to the child Instrumentables in this
  +     *  Instrumentable.
  +     *
  +     * @return An array of Proxies to the child Instrumentables in this
  +     *         Instrumentable.
  +     */
  +    InstrumentableProxy[] getChildInstrumentableProxies()
  +    {
  +        InstrumentableProxy[] proxies = m_childInstrumentableProxyArray;
  +        if( proxies == null )
  +        {
  +            proxies = updateChildInstrumentableProxyArray();
  +        }
  +        
  +        return proxies;
  +    }
  +
  +    /**
  +     * Returns an array of Descriptors for the child Instrumentables in this
  +     *  Instrumentable.
  +     *
  +     * @return An array of Descriptors for the child Instrumentables in this
  +     *         Instrumentable.
  +     */
  +    InstrumentableDescriptorLocal[] getChildInstrumentableDescriptors()
  +    {
  +        InstrumentableDescriptorLocal[] descriptors = m_childInstrumentableDescriptorArray;
  +        if( descriptors == null )
  +        {
  +            descriptors = updateChildInstrumentableDescriptorArray();
  +        }
  +        
  +        return descriptors;
  +    }
  +
  +    /**
  +     * Updates the cached array of child InstrumentableProxies taking
  +     *  synchronization into account.
  +     *
  +     * @return An array of the child InstrumentableProxies.
  +     */
  +    private InstrumentableProxy[] updateChildInstrumentableProxyArray()
  +    {
  +        synchronized( this )
  +        {
  +            m_childInstrumentableProxyArray =
  +                new InstrumentableProxy[ m_childInstrumentableProxies.size() ];
  +            m_childInstrumentableProxies.values().toArray( m_childInstrumentableProxyArray );
  +
  +            // Sort the array.  This is not a performance problem because this
  +            //  method is rarely called and doing it here saves cycles in the
  +            //  client.
  +            Arrays.sort( m_childInstrumentableProxyArray, new Comparator()
  +                {
  +                    public int compare( Object o1, Object o2 )
  +                    {
  +                        return ((InstrumentableProxy)o1).getDescription().
  +                            compareTo( ((InstrumentableProxy)o2).getDescription() );
  +                    }
  +                    
  +                    public boolean equals( Object obj )
  +                    {
  +                        return false;
  +                    }
  +                } );
  +            
  +            return m_childInstrumentableProxyArray;
  +        }
  +    }
  +
  +    /**
  +     * Updates the cached array of child InstrumentableDescriptorLocals taking
  +     *  synchronization into account.
  +     *
  +     * @return An array of the child InstrumentableDescriptorLocals.
  +     */
  +    private InstrumentableDescriptorLocal[] updateChildInstrumentableDescriptorArray()
  +    {
  +        synchronized( this )
  +        {
  +            if( m_childInstrumentableProxyArray == null )
  +            {
  +                updateChildInstrumentableProxyArray();
  +            }
  +
  +            m_childInstrumentableDescriptorArray =
  +                new InstrumentableDescriptorLocal[ m_childInstrumentableProxyArray.length ];
  +            for( int i = 0; i < m_childInstrumentableProxyArray.length; i++ )
  +            {
  +                m_childInstrumentableDescriptorArray[ i ] =
  +                    m_childInstrumentableProxyArray[ i ].getDescriptor();
  +            }
  +
  +            return m_childInstrumentableDescriptorArray;
  +        }
  +    }
  +
  +    /*---------------------------------------------------------------
  +     * Methods (Instruments)
  +     *-------------------------------------------------------------*/
       /**
        * Adds a InstrumentProxy to the Instrumentable.  This method will be
        *  called during the configuration phase of the Profiler if an element
  @@ -258,9 +513,9 @@
        *
        * @return An array of Descriptors for the Instruments in the Instrumentable.
        */
  -    InstrumentDescriptor[] getInstrumentDescriptors()
  +    InstrumentDescriptorLocal[] getInstrumentDescriptors()
       {
  -        InstrumentDescriptor[] descriptors = m_instrumentDescriptorArray;
  +        InstrumentDescriptorLocal[] descriptors = m_instrumentDescriptorArray;
           if( descriptors == null )
           {
               descriptors = updateInstrumentDescriptorArray();
  @@ -291,24 +546,24 @@
                           return ((InstrumentProxy)o1).getDescription().
                               compareTo( ((InstrumentProxy)o2).getDescription() );
                       }
  -
  +                    
                       public boolean equals( Object obj )
                       {
                           return false;
                       }
                   } );
  -
  +            
               return m_instrumentProxyArray;
           }
       }
   
       /**
  -     * Updates the cached array of InstrumentDescriptors taking
  +     * Updates the cached array of InstrumentDescriptorLocals taking
        *  synchronization into account.
        *
  -     * @return An array of the InstrumentDescriptors.
  +     * @return An array of the InstrumentDescriptorLocals.
        */
  -    private InstrumentDescriptor[] updateInstrumentDescriptorArray()
  +    private InstrumentDescriptorLocal[] updateInstrumentDescriptorArray()
       {
           synchronized( this )
           {
  @@ -318,7 +573,7 @@
               }
   
               m_instrumentDescriptorArray =
  -                new InstrumentDescriptor[ m_instrumentProxyArray.length ];
  +                new InstrumentDescriptorLocal[ m_instrumentProxyArray.length ];
               for( int i = 0; i < m_instrumentProxyArray.length; i++ )
               {
                   m_instrumentDescriptorArray[ i ] = m_instrumentProxyArray[ i ].getDescriptor();
  @@ -331,31 +586,46 @@
       /**
        * Saves the current state into a Configuration.
        *
  -     * @param useCompactSamples Flag for whether or not ProfileSample data
  -     *                          should be saved in compact format or not.
  -     *
  -     * @return The state as a Configuration.
  +     * @return The state as a Configuration.  Returns null if the configuration
  +     *         would not contain any information.
        */
  -    /*
  -    Configuration saveState( boolean useCompactSamples )
  +    Configuration saveState()
       {
  +        boolean empty = true;
           DefaultConfiguration state = new DefaultConfiguration( "instrumentable", "-" );
  -        state.addAttribute( "name", m_name );
  +        state.setAttribute( "name", m_name );
  +
  +        // Save the child Instrumentables
  +        InstrumentableProxy[] childProxies = getChildInstrumentableProxies();
  +        for( int i = 0; i < childProxies.length; i++ )
  +        {
  +            Configuration childState = childProxies[ i ].saveState();
  +            if ( childState != null )
  +            {
  +                empty = false;
  +                state.addChild( childState );
  +            }
  +        }
   
  +        // Save the direct Instruments
           InstrumentProxy[] proxies = getInstrumentProxies();
           for( int i = 0; i < proxies.length; i++ )
           {
  -            // Only save configured instrumentables as they are the only ones
  -            //  that will contain profile samples.
  -            if( proxies[ i ].isConfigured() )
  +            Configuration childState = proxies[ i ].saveState();
  +            if ( childState != null )
               {
  -                state.addChild( proxies[ i ].saveState( useCompactSamples ) );
  +                empty = false;
  +                state.addChild( childState );
               }
           }
   
  +        // Only return a state if it contains information.
  +        if ( empty )
  +        {
  +            state = null;
  +        }
           return state;
       }
  -    */
   
       /**
        * Loads the state into the Instrumentable.
  @@ -365,28 +635,64 @@
        * @throws ConfigurationException If there were any problems loading the
        *                                state.
        */
  -    /*
       void loadState( Configuration state ) throws ConfigurationException
       {
           synchronized( this )
           {
  -            Configuration[] instrumentConfs = state.getChildren( "profile-point" );
  -            for( int i = 0; i < instrumentConfs.length; i++ )
  +            // Load the child Instrumentables
  +            Configuration[] childConfs = state.getChildren( "instrumentable" );
  +            for( int i = 0; i < childConfs.length; i++ )
               {
  -                Configuration instrumentConf = instrumentConfs[ i ];
  -                String name = instrumentConf.getAttribute( "name" );
  -                InstrumentProxy proxy = getInstrumentProxy( name );
  -                if( proxy == null )
  +                Configuration childConf = childConfs[ i ];
  +                String fullChildName = childConf.getAttribute( "name" );
  +                InstrumentableProxy childProxy = getChildInstrumentableProxy( fullChildName );
  +                if( childProxy == null )
                   {
  -                    getLogger().warn( "Instrument entry ignored while loading state because the " +
  -                                      "profile point does not exist: " + name );
  +                    // The child Instrumentable was in the state file, but has
  +                    //  not yet been registered.  It is possible that it will
  +                    //  be registered at a later time.  For now it needs to be
  +                    //  created.
  +                    String childName = ( fullChildName.startsWith( m_name + "." ) ?
  +                        fullChildName.substring( m_name.length() + 1 ) : "BADNAME." + fullChildName );
  +                    
  +                    childProxy = new InstrumentableProxy(
  +                        m_instrumentManager, this, fullChildName, childName );
  +                    childProxy.enableLogging( getLogger() );
  +                    m_childInstrumentableProxies.put( fullChildName, childProxy );
  +    
  +                    // Clear the optimized arrays
  +                    m_childInstrumentableProxyArray = null;
  +                    m_childInstrumentableDescriptorArray = null;
                   }
  -                else
  +                childProxy.loadState( childConf );
  +            }
  +            
  +            // Load the direct Instruments
  +            Configuration[] instrumentConfs = state.getChildren( "instrument" );
  +            for( int i = 0; i < instrumentConfs.length; i++ )
  +            {
  +                Configuration instrumentConf = instrumentConfs[ i ];
  +                String fullInstrumentName = instrumentConf.getAttribute( "name" );
  +                InstrumentProxy instrumentProxy = getInstrumentProxy( fullInstrumentName );
  +                if( instrumentProxy == null )
                   {
  -                    proxy.loadState( instrumentConf );
  +                    // The Instrument was in the state file, but has not yet been
  +                    //  registered.  It is possible that it will be registered
  +                    //  at a later time.  For now it needs to be created.
  +                    String instrumentName = ( fullInstrumentName.startsWith( m_name + "." ) ?
  +                        fullInstrumentName.substring( m_name.length() + 1 ) : "BADNAME." + fullInstrumentName );
  +                    
  +                    instrumentProxy =
  +                        new InstrumentProxy( this, fullInstrumentName, instrumentName );
  +                    instrumentProxy.enableLogging( getLogger() );
  +                    m_instrumentProxies.put( fullInstrumentName, instrumentProxy );
  +    
  +                    // Clear the optimized arrays
  +                    m_instrumentProxyArray = null;
  +                    m_instrumentDescriptorArray = null;
                   }
  +                instrumentProxy.loadState( instrumentConf );
               }
           }
       }
  -    */
   }
  
  
  
  1.2       +35 -17    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/MaximumValueInstrumentSample.java
  
  Index: MaximumValueInstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/MaximumValueInstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MaximumValueInstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ MaximumValueInstrumentSample.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -7,6 +7,8 @@
    */
   package org.apache.excalibur.instrument.manager;
   
  +import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  +
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  @@ -24,28 +26,44 @@
   {
       /** Last value set to the sample for use for sample periods where no value is set. */
       private int m_lastValue;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new MaximumValueInstrumentSample
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
        * @param size The number of samples to store as history.  Assumes that size is at least 1.
        * @param description The description of the new InstrumentSample.
        * @param lease The length of the lease in milliseconds.
        */
  -    MaximumValueInstrumentSample( String name,
  +    MaximumValueInstrumentSample( InstrumentProxy instrumentProxy,
  +                                  String name,
                                     long interval,
                                     int size,
                                     String description,
                                     long lease )
       {
  -        super( name, interval, size, description, lease );
  +        super( instrumentProxy, name, interval, size, description, lease );
       }
  -
  +    
  +    /*---------------------------------------------------------------
  +     * InstrumentSample Methods
  +     *-------------------------------------------------------------*/
  +    /**
  +     * Returns the type of the Instrument Sample.
  +     *
  +     * @return The type of the Instrument Sample.
  +     */
  +    public int getType()
  +    {
  +        return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM;
  +    }
  +    
       /*---------------------------------------------------------------
        * AbstractInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -61,7 +79,7 @@
           m_value = m_lastValue;
           m_valueCount = 0;
       }
  -
  +    
       /**
        * Allow subclasses to add information into the saved state.
        *
  @@ -70,10 +88,10 @@
       protected void saveState( DefaultConfiguration state )
       {
           super.saveState( state );
  -
  +        
           state.setAttribute( "last-value", Integer.toString( m_lastValue ) );
       }
  -
  +    
       /**
        * Used to load the state, called from AbstractInstrumentSample.loadState();
        * <p>
  @@ -89,10 +107,10 @@
           throws ConfigurationException
       {
           super.loadState( value, state );
  -
  +        
           m_lastValue = state.getAttributeAsInteger( "last-value" );
       }
  -
  +    
       /**
        * Called after a state is loaded if the sample period is not the same
        *  as the last period saved.
  @@ -100,10 +118,10 @@
       protected void postSaveNeedsReset()
       {
           super.postSaveNeedsReset();
  -
  +        
           m_lastValue = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * AbstractValueInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -119,14 +137,14 @@
           boolean update;
           int sampleValue;
           long sampleTime;
  -
  +        
           synchronized(this)
           {
               update = update( time );
  -
  +            
               // Always store the last value to use for samples where a value is not set.
               m_lastValue = value;
  -
  +            
               if ( m_valueCount > 0 )
               {
                   // Additional sample
  @@ -144,11 +162,11 @@
                   m_value = value;
                   update = true;
               }
  -
  +            
               sampleValue = m_value;
               sampleTime = m_time;
           }
  -
  +        
           if ( update )
           {
               updateListeners( sampleValue, sampleTime );
  
  
  
  1.2       +33 -15    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/MeanValueInstrumentSample.java
  
  Index: MeanValueInstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/MeanValueInstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MeanValueInstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ MeanValueInstrumentSample.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -7,6 +7,8 @@
    */
   package org.apache.excalibur.instrument.manager;
   
  +import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  +
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  @@ -24,28 +26,44 @@
   {
       /** Total of all values seen during the sample period. */
       private long m_valueTotal;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new MeanValueInstrumentSample
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
        * @param size The number of samples to store as history.  Assumes that size is at least 1.
        * @param description The description of the new InstrumentSample.
        * @param lease The length of the lease in milliseconds.
        */
  -    MeanValueInstrumentSample( String name,
  +    MeanValueInstrumentSample( InstrumentProxy instrumentProxy,
  +                               String name,
                                  long interval,
                                  int size,
                                  String description,
                                  long lease )
       {
  -        super( name, interval, size, description, lease );
  +        super( instrumentProxy, name, interval, size, description, lease );
       }
  -
  +    
  +    /*---------------------------------------------------------------
  +     * InstrumentSample Methods
  +     *-------------------------------------------------------------*/
  +    /**
  +     * Returns the type of the Instrument Sample.
  +     *
  +     * @return The type of the Instrument Sample.
  +     */
  +    public int getType()
  +    {
  +        return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN;
  +    }
  +    
       /*---------------------------------------------------------------
        * AbstractInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -62,7 +80,7 @@
           //  be affected by the old.
           m_valueCount = 0;
       }
  -
  +    
       /**
        * Allow subclasses to add information into the saved state.
        *
  @@ -71,10 +89,10 @@
       protected void saveState( DefaultConfiguration state )
       {
           super.saveState( state );
  -
  +        
           state.setAttribute( "value-total", Long.toString( m_valueTotal ) );
       }
  -
  +    
       /**
        * Used to load the state, called from AbstractInstrumentSample.loadState();
        * <p>
  @@ -90,10 +108,10 @@
           throws ConfigurationException
       {
           super.loadState( value, state );
  -
  +        
           m_valueTotal = state.getAttributeAsLong( "value-total" );
       }
  -
  +    
       /**
        * Called after a state is loaded if the sample period is not the same
        *  as the last period saved.
  @@ -101,10 +119,10 @@
       protected void postSaveNeedsReset()
       {
           super.postSaveNeedsReset();
  -
  +        
           m_valueTotal = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * AbstractValueInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -119,11 +137,11 @@
       {
           int sampleValue;
           long sampleTime;
  -
  +        
           synchronized(this)
           {
               update( time );
  -
  +            
               if ( m_valueCount > 0 )
               {
                   // Additional sample
  @@ -140,7 +158,7 @@
               sampleValue = m_value;
               sampleTime = m_time;
           }
  -
  +        
           updateListeners( sampleValue, sampleTime );
       }
   }
  
  
  
  1.2       +35 -17    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/MinimumValueInstrumentSample.java
  
  Index: MinimumValueInstrumentSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/MinimumValueInstrumentSample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MinimumValueInstrumentSample.java	29 Jul 2002 16:05:20 -0000	1.1
  +++ MinimumValueInstrumentSample.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -7,6 +7,8 @@
    */
   package org.apache.excalibur.instrument.manager;
   
  +import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  +
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  @@ -24,28 +26,44 @@
   {
       /** Last value set to the sample for use for sample periods where no value is set. */
       private int m_lastValue;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
       /**
        * Creates a new MinimumValueInstrumentSample
        *
  +     * @param instrumentProxy The InstrumentProxy which owns the
  +     *                        InstrumentSample.
        * @param name The name of the new InstrumentSample.
        * @param interval The sample interval of the new InstrumentSample.
        * @param size The number of samples to store as history.  Assumes that size is at least 1.
        * @param description The description of the new InstrumentSample.
        * @param lease The length of the lease in milliseconds.
        */
  -    MinimumValueInstrumentSample( String name,
  +    MinimumValueInstrumentSample( InstrumentProxy instrumentProxy,
  +                                  String name,
                                     long interval,
                                     int size,
                                     String description,
                                     long lease )
       {
  -        super( name, interval, size, description, lease );
  +        super( instrumentProxy, name, interval, size, description, lease );
       }
  -
  +    
  +    /*---------------------------------------------------------------
  +     * InstrumentSample Methods
  +     *-------------------------------------------------------------*/
  +    /**
  +     * Returns the type of the Instrument Sample.
  +     *
  +     * @return The type of the Instrument Sample.
  +     */
  +    public int getType()
  +    {
  +        return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM;
  +    }
  +    
       /*---------------------------------------------------------------
        * AbstractInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -61,7 +79,7 @@
           m_value = m_lastValue;
           m_valueCount = 0;
       }
  -
  +    
       /**
        * Allow subclasses to add information into the saved state.
        *
  @@ -70,10 +88,10 @@
       protected void saveState( DefaultConfiguration state )
       {
           super.saveState( state );
  -
  +        
           state.setAttribute( "last-value", Integer.toString( m_lastValue ) );
       }
  -
  +    
       /**
        * Used to load the state, called from AbstractInstrumentSample.loadState();
        * <p>
  @@ -89,10 +107,10 @@
           throws ConfigurationException
       {
           super.loadState( value, state );
  -
  +        
           m_lastValue = state.getAttributeAsInteger( "last-value" );
       }
  -
  +    
       /**
        * Called after a state is loaded if the sample period is not the same
        *  as the last period saved.
  @@ -100,10 +118,10 @@
       protected void postSaveNeedsReset()
       {
           super.postSaveNeedsReset();
  -
  +        
           m_lastValue = 0;
       }
  -
  +    
       /*---------------------------------------------------------------
        * AbstractValueInstrumentSample Methods
        *-------------------------------------------------------------*/
  @@ -119,14 +137,14 @@
           boolean update;
           int sampleValue;
           long sampleTime;
  -
  +        
           synchronized(this)
           {
               update( time );
  -
  +            
               // Always store the last value to use for samples where a value is not set.
               m_lastValue = value;
  -
  +            
               if ( m_valueCount > 0 )
               {
                   // Additional sample
  @@ -143,12 +161,12 @@
                   m_valueCount = 1;
                   m_value = value;
               }
  -
  +            
               sampleValue = m_value;
               sampleTime = m_time;
                   update = true;
           }
  -
  +        
           if ( update )
           {
               updateListeners( sampleValue, sampleTime );
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/CounterInstrumentListener.java
  
  Index: CounterInstrumentListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  /**
   * Objects which implement the CounterInstrumentListener interface can
   *  register themselves with Instrument instances to receive updates when
   *  it is incremented.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:37 $
   * @since 4.1
   */
  public interface CounterInstrumentListener
      extends InstrumentListener
  {
      /**
       * Called by a CounterInstrument whenever its value is incremented.
       *
       * @param instrumentName The name of Instrument which was incremented.
       * @param count A positive integer to increment the counter by.
       * @param time The time that the Instrument was incremented.
       */
      void increment( String instrumentName, int count, long time );
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentDescriptorLocal.java
  
  Index: InstrumentDescriptorLocal.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentDescriptor;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentSampleException;
  
  /**
   * Describes a Instrument and acts as a Proxy to protect the original
   *  Instrument.  Methods defined by the Local interface should only
   *  be accessed from within the same JVM for performance reasons.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:37 $
   * @since 4.1
   */
  public interface InstrumentDescriptorLocal
      extends InstrumentDescriptor
  {
      /**
       * Adds a CounterInstrumentListener to the list of listeners which will
       *  receive updates of the value of the Instrument.
       *
       * @param listener CounterInstrumentListener which will start receiving
       *                 profile updates.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_COUNTER.
       */
      void addCounterInstrumentListener( CounterInstrumentListener listener );
      
      /**
       * Removes a InstrumentListener from the list of listeners which will
       *  receive profile events.
       *
       * @param listener InstrumentListener which will stop receiving profile
       *                 events.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_COUNTER.
       */
      void removeCounterInstrumentListener( CounterInstrumentListener listener );
      
      /**
       * Adds a ValueInstrumentListener to the list of listeners which will
       *  receive updates of the value of the Instrument.
       *
       * @param listener ValueInstrumentListener which will start receiving
       *                 profile updates.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_VALUE.
       */
      void addValueInstrumentListener( ValueInstrumentListener listener );
          
      /**
       * Removes a InstrumentListener from the list of listeners which will
       *  receive profile events.
       *
       * @param listener InstrumentListener which will stop receiving profile
       *                 events.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_VALUE.
       */
      void removeValueInstrumentListener( ValueInstrumentListener listener );
  
      /**
       * Returns a InstrumentSampleDescriptorLocal based on its name.
       *
       * @param instrumentSampleName Name of the InstrumentSample being requested.
       *
       * @return A Descriptor of the requested InstrumentSample.
       *
       * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
       *                                      does not exist.
       */
      InstrumentSampleDescriptorLocal getInstrumentSampleDescriptorLocal(
                                                      String instrumentSampleName )
          throws NoSuchInstrumentSampleException;
      
      /**
       * Returns a InstrumentSampleDescriptorLocal based on its name.  If the requested
       *  sample is invalid in any way, then an expired Descriptor will be
       *  returned.
       *
       * @param sampleDescription Description to assign to the new Sample.
       * @param sampleInterval Sample interval to use in the new Sample.
       * @param sampleLease Requested lease time for the new Sample in
       *                    milliseconds.  The InstrumentManager may grant a
       *                    lease which is shorter or longer than the requested
       *                    period.
       * @param sampleType Type of sample to request.  Must be one of the
       *                   following:  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN.
       *
       * @return A Descriptor of the requested InstrumentSample.
       *
       * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
       *                                      does not exist.
       */
      InstrumentSampleDescriptorLocal createInstrumentSampleLocal( String sampleDescription,
                                                                   long sampleInterval,
                                                                   int sampleSize,
                                                                   long sampleLease,
                                                                   int sampleType );
      
      /**
       * Returns an array of Descriptors for the InstrumentSamples configured for this
       *  Instrument.
       *
       * @return An array of Descriptors for the InstrumentSamples configured for this
       *  Instrument.
       */
      InstrumentSampleDescriptorLocal[] getInstrumentSampleDescriptorLocals();
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentDescriptorLocalImpl.java
  
  Index: InstrumentDescriptorLocalImpl.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleDescriptor;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentSampleException;
  
  /**
   * Describes a Instrument and acts as a Proxy to protect the original
   *  Instrument.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:37 $
   * @since 4.1
   */
  public class InstrumentDescriptorLocalImpl
      implements InstrumentDescriptorLocal
  {
      /** InstrumentProxy being described. */
      private InstrumentProxy m_instrumentProxy;
      
      /*---------------------------------------------------------------
       * Constructors
       *-------------------------------------------------------------*/
      /**
       * Creates a new InstrumentDescriptor.
       *
       * @param instrumentProxy InstrumentProxy being described.
       */
      InstrumentDescriptorLocalImpl( InstrumentProxy instrumentProxy )
      {
          m_instrumentProxy = instrumentProxy;
      }
      
      /*---------------------------------------------------------------
       * InstrumentDescriptor Methods
       *-------------------------------------------------------------*/
      /**
       * Returns true if the Instrument was configured in the instrumentables
       *  section of the configuration.
       *
       * @return True if configured.
       */
      public boolean isConfigured()
      {
          return m_instrumentProxy.isConfigured();
      }
  
      /**
       * Returns true if the Instrument was registered with the Instrument
       *  Manager.
       *
       * @return True if registered.
       */
      public boolean isRegistered()
      {
          return m_instrumentProxy.isRegistered();
      }
      
      /**
       * Gets the name for the Instrument.  The Instrument Name is used to
       *  uniquely identify the Instrument during the configuration of the
       *  Profiler.  The value should be a string which does not contain spaces
       *  or periods.
       *
       * @return The name used to identify a Instrument.
       */
      public String getName() 
      {
          return m_instrumentProxy.getName();
      }
      
      /**
       * Gets the description of the Instrument.
       *
       * @return The description of the Instrument.
       */
      public String getDescription()
      {
          return m_instrumentProxy.getDescription();
      }
      
      /**
       * Returns the type of the Instrument.  Possible values include
       *  InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER,
       *  InstrumentManagerClient.INSTRUMENT_TYPE_VALUE or
       *  InstrumentManagerClient.INSTRUMENT_TYPE_NONE, if the type was never set.
       *
       * @return The type of the Instrument.
       */
      public int getType()
      {
          return m_instrumentProxy.getType();
      }
      
      /**
       * Returns a InstrumentSampleDescriptor based on its name.
       *
       * @param instrumentSampleName Name of the InstrumentSample being requested.
       *
       * @return A Descriptor of the requested InstrumentSample.
       *
       * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
       *                                      does not exist.
       */
      public InstrumentSampleDescriptor getInstrumentSampleDescriptor( String instrumentSampleName )
          throws NoSuchInstrumentSampleException
      {
          return getInstrumentSampleDescriptorLocal( instrumentSampleName );
      }
      
      /**
       * Returns a InstrumentSampleDescriptor based on its name.  If the requested
       *  sample is invalid in any way, then an expired Descriptor will be
       *  returned.
       *
       * @param sampleDescription Description to assign to the new Sample.
       * @param sampleInterval Sample interval to use in the new Sample.
       * @param sampleLease Requested lease time for the new Sample in
       *                    milliseconds.  The InstrumentManager may grant a
       *                    lease which is shorter or longer than the requested
       *                    period.
       * @param sampleType Type of sample to request.  Must be one of the
       *                   following:  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN.
       *
       * @return A Descriptor of the requested InstrumentSample.
       *
       * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
       *                                      does not exist.
       */
      public InstrumentSampleDescriptor createInstrumentSample( String sampleDescription,
                                                                long sampleInterval,
                                                                int sampleSize,
                                                                long sampleLease,
                                                                int sampleType )
      {
          return createInstrumentSampleLocal(
              sampleDescription, sampleInterval, sampleSize, sampleLease, sampleType );
      }
      
      /**
       * Returns an array of Descriptors for the InstrumentSamples configured for this
       *  Instrument.
       *
       * @return An array of Descriptors for the InstrumentSamples configured for this
       *  Instrument.
       */
      public InstrumentSampleDescriptor[] getInstrumentSampleDescriptors()
      {
          return getInstrumentSampleDescriptorLocals();
      }
      
      /*---------------------------------------------------------------
       * InstrumentDescriptorLocal Methods
       *-------------------------------------------------------------*/
      /**
       * Adds a CounterInstrumentListener to the list of listeners which will
       *  receive updates of the value of the Instrument.
       *
       * @param listener CounterInstrumentListener which will start receiving
       *                 profile updates.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_COUNTER.
       */
      public void addCounterInstrumentListener( CounterInstrumentListener listener )
      {
          m_instrumentProxy.addCounterInstrumentListener( listener );
      }
      
      /**
       * Removes a InstrumentListener from the list of listeners which will
       *  receive profile events.
       *
       * @param listener InstrumentListener which will stop receiving profile
       *                 events.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_COUNTER.
       */
      public void removeCounterInstrumentListener( CounterInstrumentListener listener )
      {
          m_instrumentProxy.removeCounterInstrumentListener( listener );
      }
      
      /**
       * Adds a ValueInstrumentListener to the list of listeners which will
       *  receive updates of the value of the Instrument.
       *
       * @param listener ValueInstrumentListener which will start receiving
       *                 profile updates.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_VALUE.
       */
      public void addValueInstrumentListener( ValueInstrumentListener listener )
      {
          m_instrumentProxy.addValueInstrumentListener( listener );
      }
          
      /**
       * Removes a InstrumentListener from the list of listeners which will
       *  receive profile events.
       *
       * @param listener InstrumentListener which will stop receiving profile
       *                 events.
       *
       * @throws IllegalStateException If the Instrument's type is not
       *         InstrumentManager.PROFILE_POINT_TYPE_VALUE.
       */
      public void removeValueInstrumentListener( ValueInstrumentListener listener )
      {
          m_instrumentProxy.removeValueInstrumentListener( listener );
      }
      
      /**
       * Returns a InstrumentSampleDescriptorLocal based on its name.
       *
       * @param instrumentSampleName Name of the InstrumentSample being requested.
       *
       * @return A Descriptor of the requested InstrumentSample.
       *
       * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
       *                                      does not exist.
       */
      public InstrumentSampleDescriptorLocal getInstrumentSampleDescriptorLocal(
                                                      String instrumentSampleName )
          throws NoSuchInstrumentSampleException
      {
          InstrumentSample instrumentSample =
              m_instrumentProxy.getInstrumentSample( instrumentSampleName );
          if ( instrumentSample == null )
          {
              throw new NoSuchInstrumentSampleException(
                  "No instrument sample can be found using name: " + instrumentSampleName );
          }
          
          return instrumentSample.getDescriptor();
      }
      
      /**
       * Returns a InstrumentSampleDescriptorLocal based on its name.  If the requested
       *  sample is invalid in any way, then an expired Descriptor will be
       *  returned.
       *
       * @param sampleDescription Description to assign to the new Sample.
       * @param sampleInterval Sample interval to use in the new Sample.
       * @param sampleLease Requested lease time for the new Sample in
       *                    milliseconds.  The InstrumentManager may grant a
       *                    lease which is shorter or longer than the requested
       *                    period.
       * @param sampleType Type of sample to request.  Must be one of the
       *                   following:  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
       *                   InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN.
       *
       * @return A Descriptor of the requested InstrumentSample.
       *
       * @throws NoSuchInstrumentSampleException If the specified InstrumentSample
       *                                      does not exist.
       */
      public InstrumentSampleDescriptorLocal createInstrumentSampleLocal( String sampleDescription,
                                                                          long sampleInterval,
                                                                          int sampleSize,
                                                                          long sampleLease,
                                                                          int sampleType )
      {
          InstrumentSample sample = m_instrumentProxy.createInstrumentSample(
              sampleDescription, sampleInterval, sampleSize, sampleLease, sampleType );
          return sample.getDescriptor();
      }
      
      /**
       * Returns an array of Descriptors for the InstrumentSamples configured for this
       *  Instrument.
       *
       * @return An array of Descriptors for the InstrumentSamples configured for this
       *  Instrument.
       */
      public InstrumentSampleDescriptorLocal[] getInstrumentSampleDescriptorLocals()
      {
          return m_instrumentProxy.getInstrumentSampleDescriptors();
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentListener.java
  
  Index: InstrumentListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  /**
   * Root interface for InstrumentListeners.  This interface should not be
   *  be implemented directly.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:37 $
   * @since 4.1
   */
  public interface InstrumentListener
  {
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentManagerClientLocal.java
  
  Index: InstrumentManagerClientLocal.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.Instrumentable;
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentableException;
  
  import org.apache.avalon.framework.configuration.Configuration;
  
  /**
   *  Methods defined by the Local interface should
   *  only be accessed from within the same JVM for performance reasons.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:37 $
   * @since 4.1
   */
  public interface InstrumentManagerClientLocal
      extends InstrumentManagerClient
  {
      /**
       * Returns a InstrumentableDescriptorLocal based on its name or the name
       *  of any of its children.
       *
       * @param instrumentableName Name of the Instrumentable being requested.
       *
       * @return A Descriptor of the requested Instrumentable.
       *
       * @throws NoSuchInstrumentableException If the specified Instrumentable does
       *                                   not exist.
       */
      InstrumentableDescriptorLocal getInstrumentableDescriptorLocal( String instrumentableName )
          throws NoSuchInstrumentableException;
  
      /**
       * Returns an array of Descriptors for the Instrumentables managed by this
       *  InstrumentManager.
       *
       * @return An array of Descriptors for the Instrumentables managed by this
       *  InstrumentManager.
       */
      InstrumentableDescriptorLocal[] getInstrumentableDescriptorLocals();
  }
  
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentManagerClientLocalImpl.java
  
  Index: InstrumentManagerClientLocalImpl.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentableDescriptor;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentableException;
  
  import org.apache.avalon.framework.configuration.Configuration;
  
  /**
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public class InstrumentManagerClientLocalImpl
      implements InstrumentManagerClientLocal
  {
      private DefaultInstrumentManager m_manager;
      
      /*---------------------------------------------------------------
       * Constructors
       *-------------------------------------------------------------*/
      public InstrumentManagerClientLocalImpl( DefaultInstrumentManager manager )
      {
          m_manager = manager;
      }
      
      /*---------------------------------------------------------------
       * InstrumentManagerClient Methods
       *-------------------------------------------------------------*/
      /**
       * Returns the name used to identify this InstrumentManager.
       *
       * @return The name used to identify this InstrumentManager.
       */
      public String getName()
      {
          return m_manager.getName();
      }
      
      /**
       * Returns the description of this InstrumentManager.
       *
       * @return The description of this InstrumentManager.
       */
      public String getDescription()
      {
          return m_manager.getDescription();
      }
      
      /**
       * Returns a InstrumentableDescriptor based on its name or the name of any
       *  of its children.
       *
       * @param instrumentableName Name of the Instrumentable being requested.
       *
       * @return A Descriptor of the requested Instrumentable.
       *
       * @throws NoSuchInstrumentableException If the specified Instrumentable does
       *                                   not exist.
       */
      public InstrumentableDescriptor getInstrumentableDescriptor( String instrumentableName )
          throws NoSuchInstrumentableException
      {
          return getInstrumentableDescriptorLocal( instrumentableName );
      }
  
      /**
       * Returns an array of Descriptors for the Instrumentables managed by this
       *  InstrumentManager.
       *
       * @return An array of Descriptors for the Instrumentables managed by this
       *  InstrumentManager.
       */
      public InstrumentableDescriptor[] getInstrumentableDescriptors()
      {
          return getInstrumentableDescriptorLocals();
      }
      
      /**
       * Invokes garbage collection.
       */
      public void invokeGarbageCollection()
      {
          m_manager.invokeGarbageCollection();
      }
      
      /*---------------------------------------------------------------
       * InstrumentManagerClientLocal Methods
       *-------------------------------------------------------------*/
      /**
       * Returns a InstrumentableDescriptorLocal based on its name or the name
       *  of any of its children.
       *
       * @param instrumentableName Name of the Instrumentable being requested.
       *
       * @return A Descriptor of the requested Instrumentable.
       *
       * @throws NoSuchInstrumentableException If the specified Instrumentable does
       *                                   not exist.
       */
      public InstrumentableDescriptorLocal getInstrumentableDescriptorLocal(
                                                      String instrumentableName )
          throws NoSuchInstrumentableException
      {
          return m_manager.getInstrumentableDescriptor( instrumentableName );
      }
  
      /**
       * Returns an array of Descriptors for the Instrumentables managed by this
       *  InstrumentManager.
       *
       * @return An array of Descriptors for the Instrumentables managed by this
       *  InstrumentManager.
       */
      public InstrumentableDescriptorLocal[] getInstrumentableDescriptorLocals()
      {
          return m_manager.getInstrumentableDescriptors();
      }
      
      /*---------------------------------------------------------------
       * Methods
       *-------------------------------------------------------------*/
  }
  
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSampleDescriptorLocal.java
  
  Index: InstrumentSampleDescriptorLocal.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleDescriptor;
  
  /**
   * Describes an InstrumentSample and acts as a Proxy to protect the original
   *  InstrumentSample object.  Methods defined by the Local interface should
   *  only be accessed from within the same JVM for performance reasons.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public interface InstrumentSampleDescriptorLocal
      extends InstrumentSampleDescriptor
  {
      /**
       * Registers a InstrumentSampleListener with a InstrumentSample given a name.
       *
       * @param listener The listener which should start receiving updates from the
       *                 InstrumentSample.
       */
      void addInstrumentSampleListener( InstrumentSampleListener listener );
      
      /**
       * Unregisters a InstrumentSampleListener from a InstrumentSample given a name.
       *
       * @param listener The listener which should stop receiving updates from the
       *                 InstrumentSample.
       */
      void removeInstrumentSampleListener( InstrumentSampleListener listener );
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSampleDescriptorLocalImpl.java
  
  Index: InstrumentSampleDescriptorLocalImpl.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleSnapshot;
  
  /**
   * Describes an InstrumentSample and acts as a Proxy to protect the original
   *  InstrumentSample object.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public class InstrumentSampleDescriptorLocalImpl
      implements InstrumentSampleDescriptorLocal
  {
      /** The InstrumentSample. */
      private InstrumentSample m_instrumentSample;
      
      /*---------------------------------------------------------------
       * Constructors
       *-------------------------------------------------------------*/
      /**
       * Creates a new InstrumentSampleDescriptor.
       *
       * @param InstrumentSample InstrumentSample being described.
       */
      InstrumentSampleDescriptorLocalImpl( InstrumentSample InstrumentSample )
      {
          m_instrumentSample = InstrumentSample;
      }
      
      /*---------------------------------------------------------------
       * Methods InstrumentSampleDescriptor
       *-------------------------------------------------------------*/
      /**
       * Returns true if the InstrumentSample was configured in the instrumentables
       *  section of the configuration.
       *
       * @return True if configured.
       */
      public boolean isConfigured()
      {
          return m_instrumentSample.isConfigured();
      }
      
      /**
       * Returns the name of the sample.
       *
       * @return The name of the sample.
       */
      public String getName()
      {
          return m_instrumentSample.getName();
      }
      
      /**
       * Returns the sample interval.  The period of each sample in millisends.
       *
       * @return The sample interval.
       */
      public long getInterval()
      {
          return m_instrumentSample.getInterval();
      }
      
      /**
       * Returns the number of samples in the sample history.
       *
       * @return The size of the sample history.
       */
      public int getSize()
      {
          return m_instrumentSample.getSize();
      }
      
      /**
       * Returns the description of the sample.
       *
       * @return The description of the sample.
       */
      public String getDescription()
      {
          return m_instrumentSample.getDescription();
      }
      
      /**
       * Returns the type of the Instrument Sample.  Possible values include
       *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER,
       *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
       *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN, or
       *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM.
       *
       * @return The type of the Instrument Sample.
       */
      public int getType()
      {
          return m_instrumentSample.getType();
      }
      
      /**
       * Obtain the value of the sample.  All samples are integers, so the profiled
       * objects must measure quantity (numbers of items), rate (items/period), time in
       * milliseconds, etc.
       *
       * @return The sample value.
       */
      public int getValue()
      {
          return m_instrumentSample.getValue();
      }
      
      /**
       * Obtain the UNIX time of the beginning of the sample.
       *
       * @return The UNIX time of the beginning of the sample.
       */
      public long getTime()
      {
          return m_instrumentSample.getTime();
      }
      
      /**
       * Returns the Type of the Instrument which can use the sample.  This
       *  should be the same for all instances of a class.
       * <p>
       * Should be one of the following: InstrumentManager.PROFILE_POINT_TYPE_COUNTER
       *  or InstrumentManager.PROFILE_POINT_TYPE_VALUE
       *
       * @return The Type of the Instrument which can use the sample.
       */
      public int getInstrumentType()
      {
          return m_instrumentSample.getInstrumentType();
      }
      
      /**
       * Returns the time that the current lease expires.  Permanent samples will
       *  return a value of 0.
       *
       * @return The time that the current lease expires.
       */
      public long getLeaseExpirationTime()
      {
          return m_instrumentSample.getLeaseExpirationTime();
      }
      
      /**
       * Extends the lease to be lease milliseconds from the current time.
       *
       * @param lease The length of the lease in milliseconds.
       *
       * @return The new lease expiration time.  Returns 0 if the sample is
       *         permanent.
       */
      public long extendLease( long lease )
      {
          return m_instrumentSample.extendLease( lease );
      }
      
      /**
       * Obtains a static snapshot of the InstrumentSample.
       *
       * @return A static snapshot of the InstrumentSample.
       */
      public InstrumentSampleSnapshot getSnapshot()
      {
          return m_instrumentSample.getSnapshot();
      }
      
      /*---------------------------------------------------------------
       * Methods InstrumentSampleDescriptorLocal
       *-------------------------------------------------------------*/
      /**
       * Registers a InstrumentSampleListener with a InstrumentSample given a name.
       *
       * @param listener The listener which should start receiving updates from the
       *                 InstrumentSample.
       */
      public void addInstrumentSampleListener( InstrumentSampleListener listener )
      {
          m_instrumentSample.addInstrumentSampleListener( listener );
      }
      
      /**
       * Unregisters a InstrumentSampleListener from a InstrumentSample given a name.
       *
       * @param listener The listener which should stop receiving updates from the
       *                 InstrumentSample.
       */
      public void removeInstrumentSampleListener( InstrumentSampleListener listener )
      {
          m_instrumentSample.removeInstrumentSampleListener( listener );
      }
  }
  
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentSampleListener.java
  
  Index: InstrumentSampleListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  /**
   * Objects which implement the InstrumentSampleListener interface can register
   *  themselves with InstrumentSample instances to receive updates on their value.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public interface InstrumentSampleListener
  {
      /**
       * Called by a InstrumentSample whenever its value is changed.
       *
       * @param InstrumentSampleName The name of the InstrumentSample whose value was changed.
       * @param value The new value.
       * @param time The time that the InstrumentSample value was changed.
       */
      void setValue( String InstrumentSampleName, int value, long time );
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentableDescriptorLocal.java
  
  Index: InstrumentableDescriptorLocal.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentableDescriptor;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentableException;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentException;
  
  /**
   * Describes a Instrumentable and acts as a Proxy to protect the original
   *  Instrumentable.  Methods defined by the Local interface should only
   *  be accessed from within the same JVM for performance reasons.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public interface InstrumentableDescriptorLocal
      extends InstrumentableDescriptor
  {
      /**
       * Returns a child InstrumentableDescriptorLocal based on its name or the
       *  name of any of its children.
       *
       * @param childInstrumentableName Name of the child Instrumentable being
       *                                requested.
       *
       * @return A descriptor of the requested child Instrumentable.
       *
       * @throws NoSuchInstrumentableException If the specified Instrumentable
       *                                       does not exist.
       */
      InstrumentableDescriptorLocal getChildInstrumentableDescriptorLocal(
          String childInstrumentableName ) throws NoSuchInstrumentableException;
  
      /**
       * Returns an array of Descriptors for the child Instrumentables registered
       *  by this Instrumentable.
       *
       * @return An array of Descriptors for the child Instrumentables registered
       *  by this Instrumentable.
       */
      InstrumentableDescriptorLocal[] getChildInstrumentableDescriptorLocals();
      
      /**
       * Returns a InstrumentDescriptorLocal based on its name.
       *
       * @param instrumentName Name of the Instrument being requested.
       *
       * @return A Descriptor of the requested Instrument.
       *
       * @throws NoSuchInstrumentException If the specified Instrument does
       *                                     not exist.
       */
      InstrumentDescriptorLocal getInstrumentDescriptorLocal( String instrumentName )
          throws NoSuchInstrumentException;
  
      /**
       * Returns an array of Descriptors for the Instruments registered by this
       *  Instrumentable.
       *
       * @return An array of Descriptors for the Instruments registered by this
       *  Instrumentable.
       */
      InstrumentDescriptorLocal[] getInstrumentDescriptorLocals();
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/InstrumentableDescriptorLocalImpl.java
  
  Index: InstrumentableDescriptorLocalImpl.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentDescriptor;
  import org.apache.excalibur.instrument.manager.interfaces.InstrumentableDescriptor;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentableException;
  import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentException;
  
  /**
   * Describes a Instrumentable and acts as a Proxy to protect the original
   *  Instrumentable.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public class InstrumentableDescriptorLocalImpl
      implements InstrumentableDescriptorLocal
  {
      /** InstrumentableProxy being described. */
      private InstrumentableProxy m_instrumentableProxy;
  
      /*---------------------------------------------------------------
       * Constructors
       *-------------------------------------------------------------*/
      /**
       * Creates a new InstrumentableDescriptorLocalImpl.
       *
       * @param instrumentableProxy InstrumentableProxy being described.
       */
      InstrumentableDescriptorLocalImpl( InstrumentableProxy instrumentableProxy )
      {
          m_instrumentableProxy = instrumentableProxy;
      }
  
      /*---------------------------------------------------------------
       * InstrumentableDescriptor Methods
       *-------------------------------------------------------------*/
      /**
       * Returns true if the Instrumentable was configured in the instrumentables
       *  section of the configuration.
       *
       * @return True if configured.
       */
      public boolean isConfigured()
      {
          return m_instrumentableProxy.isConfigured();
      }
  
      /**
       * Returns true if the Instrumentable was registered with the Instrument
       *  Manager.
       *
       * @return True if registered.
       */
      public boolean isRegistered()
      {
          return m_instrumentableProxy.isRegistered();
      }
      
      /**
       * Gets the name for the Instrumentable.  The Instrumentable Name is used to
       *  uniquely identify the Instrumentable during the configuration of the
       *  Profiler and to gain access to a InstrumentableDescriptor through a
       *  ProfilerManager.
       *
       * @return The name used to identify a Instrumentable.
       */
      public String getName()
      {
          return m_instrumentableProxy.getName();
      }
  
      /**
       * Gets the description of the Instrumentable.
       *
       * @return The description of the Instrumentable.
       */
      public String getDescription()
      {
          return m_instrumentableProxy.getDescription();
      }
  
      /**
       * Returns a child InstrumentableDescriptor based on its name or the name
       *  of any of its children.
       *
       * @param childInstrumentableName Name of the child Instrumentable being
       *                                requested.
       *
       * @return A descriptor of the requested child Instrumentable.
       *
       * @throws NoSuchInstrumentableException If the specified Instrumentable
       *                                       does not exist.
       */
      public InstrumentableDescriptor getChildInstrumentableDescriptor(
                                                  String childInstrumentableName )
          throws NoSuchInstrumentableException
      {
          return getChildInstrumentableDescriptorLocal( childInstrumentableName );
      }
  
      /**
       * Returns an array of Descriptors for the child Instrumentables registered
       *  by this Instrumentable.
       *
       * @return An array of Descriptors for the child Instrumentables registered
       *  by this Instrumentable.
       */
      public InstrumentableDescriptor[] getChildInstrumentableDescriptors()
      {
          return getChildInstrumentableDescriptorLocals();
      }
          
      /**
       * Returns a InstrumentDescriptor based on its name.
       *
       * @param instrumentName Name of the Instrument being requested.
       *
       * @return A Descriptor of the requested Instrument.
       *
       * @throws NoSuchInstrumentException If the specified Instrument does
       *                                     not exist.
       */
      public InstrumentDescriptor getInstrumentDescriptor( String instrumentName )
          throws NoSuchInstrumentException
      {
          return getInstrumentDescriptorLocal( instrumentName );
      }
  
      /**
       * Returns an array of Descriptors for the Instruments registered by this
       *  Instrumentable.
       *
       * @return An array of Descriptors for the Instruments registered by this
       *  Instrumentable.
       */
      public InstrumentDescriptor[] getInstrumentDescriptors()
      {
          return getInstrumentDescriptorLocals();
      }
      
      /*---------------------------------------------------------------
       * InstrumentableDescriptorLocal Methods
       *-------------------------------------------------------------*/
      /**
       * Returns a child InstrumentableDescriptorLocal based on its name or the
       *  name of any of its children.
       *
       * @param childInstrumentableName Name of the child Instrumentable being
       *                                requested.
       *
       * @return A descriptor of the requested child Instrumentable.
       *
       * @throws NoSuchInstrumentableException If the specified Instrumentable
       *                                       does not exist.
       */
      public InstrumentableDescriptorLocal getChildInstrumentableDescriptorLocal(
                                                      String childInstrumentableName )
          throws NoSuchInstrumentableException
      {
          InstrumentableProxy instrumentableProxy =
              m_instrumentableProxy.getChildInstrumentableProxy( childInstrumentableName );
          if( instrumentableProxy == null )
          {
              throw new NoSuchInstrumentableException(
                  "No child instrumentable can be found using name: " + childInstrumentableName );
          }
  
          return instrumentableProxy.getDescriptor();
      }
  
      /**
       * Returns an array of Descriptors for the child Instrumentables registered
       *  by this Instrumentable.
       *
       * @return An array of Descriptors for the child Instrumentables registered
       *  by this Instrumentable.
       */
      public InstrumentableDescriptorLocal[] getChildInstrumentableDescriptorLocals()
      {
          return m_instrumentableProxy.getChildInstrumentableDescriptors();
      }
      
      /**
       * Returns a InstrumentDescriptorLocal based on its name.
       *
       * @param instrumentName Name of the Instrument being requested.
       *
       * @return A Descriptor of the requested Instrument.
       *
       * @throws NoSuchInstrumentException If the specified Instrument does
       *                                     not exist.
       */
      public InstrumentDescriptorLocal getInstrumentDescriptorLocal( String instrumentName )
          throws NoSuchInstrumentException
      {
          InstrumentProxy instrumentProxy =
              m_instrumentableProxy.getInstrumentProxy( instrumentName );
          if( instrumentProxy == null )
          {
              throw new NoSuchInstrumentException(
                  "No instrument can be found using name: " + instrumentName );
          }
  
          return instrumentProxy.getDescriptor();
      }
  
      /**
       * Returns an array of Descriptors for the Instruments registered by this
       *  Instrumentable.
       *
       * @return An array of Descriptors for the Instruments registered by this
       *  Instrumentable.
       */
      public InstrumentDescriptorLocal[] getInstrumentDescriptorLocals()
      {
          return m_instrumentableProxy.getInstrumentDescriptors();
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/ValueInstrumentListener.java
  
  Index: ValueInstrumentListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager;
  
  /**
   * Objects which implement the InstrumentListener interface can register
   *  themselves with Instrument instances to receive updates on the
   *  Profile Point's value.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public interface ValueInstrumentListener
      extends InstrumentListener
  {
      /**
       * Called by a ValueInstrument whenever its value is set.
       *
       * @param instrumentName The name of Instrument whose value was set.
       * @param value Value that was set.
       * @param time The time that the Instrument was incremented.
       *
       * ValueInstrument
       */
      void setValue( String instrumentName, int value, long time );
  }
  
  
  
  1.2       +14 -14    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/altrmi/InstrumentManagerAltrmiServer.java
  
  Index: InstrumentManagerAltrmiServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/altrmi/InstrumentManagerAltrmiServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentManagerAltrmiServer.java	29 Jul 2002 16:05:21 -0000	1.1
  +++ InstrumentManagerAltrmiServer.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.instrument.manager.altrmi;
   
   import org.apache.excalibur.instrument.manager.DefaultInstrumentManager;
  -import org.apache.excalibur.instrument.manager.InstrumentManagerClientImpl;
  +import org.apache.excalibur.instrument.manager.InstrumentManagerClientLocalImpl;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentableDescriptor;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentDescriptor;
   import org.apache.excalibur.instrument.manager.interfaces.InstrumentManagerClient;
  @@ -33,10 +33,10 @@
   {
       /** The default port. */
       public static final int DEFAULT_PORT = 15555;
  -
  +    
       private int m_port;
       private AbstractServer m_server;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
  @@ -45,34 +45,34 @@
       {
           this( manager, DEFAULT_PORT );
       }
  -
  +    
       public InstrumentManagerAltrmiServer( DefaultInstrumentManager manager, int port )
           throws AltrmiServerException, PublicationException
       {
           m_port = port;
  -
  -        InstrumentManagerClientImpl client = new InstrumentManagerClientImpl( manager );
  -
  +        
  +        InstrumentManagerClientLocalImpl client = new InstrumentManagerClientLocalImpl( manager );
  +        
           System.out.println( "Creating CompleteSocketCustomStreamServer..." );
           m_server = new CompleteSocketCustomStreamServer( port );
  -
  +        
           System.out.println( "Publishing InstrumentManagerClient..." );
  -
  +        
           Class[] additionalFacadeClasses = new Class[]
           {
               InstrumentableDescriptor.class,
               InstrumentDescriptor.class,
               InstrumentSampleDescriptor.class
           };
  -
  -        m_server.publish( client, "InstrumentManagerClient",
  +        
  +        m_server.publish( client, "InstrumentManagerClient", 
               new PublicationDescription( InstrumentManagerClient.class, additionalFacadeClasses ) );
  -
  +        
           System.out.println( "Starting CompleteSocketObjectStreamServer..." );
           m_server.start();
           System.out.println( "Started on port: " + port );
       }
  -
  +    
       /*---------------------------------------------------------------
        * Disposable Methods
        *-------------------------------------------------------------*/
  
  
  
  1.2       +19 -55    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentDescriptor.java
  
  Index: InstrumentDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentDescriptor.java	29 Jul 2002 16:05:21 -0000	1.1
  +++ InstrumentDescriptor.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -26,6 +26,15 @@
       boolean isConfigured();
   
       /**
  +     * Returns true if the Instrument was registered with the Instrument
  +     *  Manager.
  +     *
  +     * @return True if registered.
  +     */
  +    boolean isRegistered();
  +
  +    
  +    /**
        * Gets the name for the Instrument.  The Instrument Name is used to
        *  uniquely identify the Instrument during the configuration of the
        *  Profiler.  The value should be a string which does not contain spaces
  @@ -34,69 +43,24 @@
        * @return The name used to identify a Instrument.
        */
       String getName();
  -
  +    
       /**
        * Gets the description of the Instrument.
        *
        * @return The description of the Instrument.
        */
       String getDescription();
  -
  +    
       /**
  -     * Returns the type of the Instrument.
  +     * Returns the type of the Instrument.  Possible values include
  +     *  InstrumentManagerClient.INSTRUMENT_TYPE_COUNTER,
  +     *  InstrumentManagerClient.INSTRUMENT_TYPE_VALUE or
  +     *  InstrumentManagerClient.INSTRUMENT_TYPE_NONE, if the type was never set.
        *
        * @return The type of the Instrument.
        */
       int getType();
  -
  -    /**
  -     * Adds a CounterInstrumentListener to the list of listeners which will
  -     *  receive updates of the value of the Instrument.
  -     *
  -     * @param listener CounterInstrumentListener which will start receiving
  -     *                 profile updates.
  -     *
  -     * @throws IllegalStateException If the Instrument's type is not
  -     *         InstrumentManager.PROFILE_POINT_TYPE_COUNTER.
  -     */
  -    void addCounterInstrumentListener( CounterInstrumentListener listener );
  -
  -    /**
  -     * Removes a InstrumentListener from the list of listeners which will
  -     *  receive profile events.
  -     *
  -     * @param listener InstrumentListener which will stop receiving profile
  -     *                 events.
  -     *
  -     * @throws IllegalStateException If the Instrument's type is not
  -     *         InstrumentManager.PROFILE_POINT_TYPE_COUNTER.
  -     */
  -    void removeCounterInstrumentListener( CounterInstrumentListener listener );
  -
  -    /**
  -     * Adds a ValueInstrumentListener to the list of listeners which will
  -     *  receive updates of the value of the Instrument.
  -     *
  -     * @param listener ValueInstrumentListener which will start receiving
  -     *                 profile updates.
  -     *
  -     * @throws IllegalStateException If the Instrument's type is not
  -     *         InstrumentManager.PROFILE_POINT_TYPE_VALUE.
  -     */
  -    void addValueInstrumentListener( ValueInstrumentListener listener );
  -
  -    /**
  -     * Removes a InstrumentListener from the list of listeners which will
  -     *  receive profile events.
  -     *
  -     * @param listener InstrumentListener which will stop receiving profile
  -     *                 events.
  -     *
  -     * @throws IllegalStateException If the Instrument's type is not
  -     *         InstrumentManager.PROFILE_POINT_TYPE_VALUE.
  -     */
  -    void removeValueInstrumentListener( ValueInstrumentListener listener );
  -
  +    
       /**
        * Returns a InstrumentSampleDescriptor based on its name.
        *
  @@ -109,7 +73,7 @@
        */
       InstrumentSampleDescriptor getInstrumentSampleDescriptor( String instrumentSampleName )
           throws NoSuchInstrumentSampleException;
  -
  +    
       /**
        * Returns a InstrumentSampleDescriptor based on its name.  If the requested
        *  sample is invalid in any way, then an expired Descriptor will be
  @@ -137,7 +101,7 @@
                                                          int sampleSize,
                                                          long sampleLease,
                                                          int sampleType );
  -
  +    
       /**
        * Returns an array of Descriptors for the InstrumentSamples configured for this
        *  Instrument.
  
  
  
  1.2       +11 -11    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentManagerClient.java
  
  Index: InstrumentManagerClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentManagerClient.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentManagerClient.java	29 Jul 2002 16:05:21 -0000	1.1
  +++ InstrumentManagerClient.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -21,39 +21,39 @@
   {
       /** Type which specifies that the type of a Instrument has not yet been determined. */
       int INSTRUMENT_TYPE_NONE = 0;
  -
  +    
       /** Type which identifies CounterInstruments. */
       int INSTRUMENT_TYPE_COUNTER = 1;
  -
  +    
       /** Type which identifies ValueInstruments. */
       int INSTRUMENT_TYPE_VALUE   = 2;
  -
  +    
       /** Type which identifies CounterInstrumentSamples. */
       int INSTRUMENT_SAMPLE_TYPE_COUNTER = 101;
  -
  +    
       /** Type which identifies MinimumInstrumentSamples. */
       int INSTRUMENT_SAMPLE_TYPE_MINIMUM = 102;
  -
  +    
       /** Type which identifies MaximumInstrumentSamples. */
       int INSTRUMENT_SAMPLE_TYPE_MAXIMUM = 103;
  -
  +    
       /** Type which identifies MeanInstrumentSamples. */
       int INSTRUMENT_SAMPLE_TYPE_MEAN = 104;
  -
  +    
       /**
        * Returns the name used to identify this InstrumentManager.
        *
        * @return The name used to identify this InstrumentManager.
        */
       String getName();
  -
  +    
       /**
        * Returns the description of this InstrumentManager.
        *
        * @return The description of this InstrumentManager.
        */
       String getDescription();
  -
  +    
       /**
        * Returns a InstrumentableDescriptor based on its name or the name of any
        *  of its children.
  @@ -76,7 +76,7 @@
        *  InstrumentManager.
        */
       InstrumentableDescriptor[] getInstrumentableDescriptors();
  -
  +    
       /**
        * Invokes garbage collection.
        */
  
  
  
  1.2       +30 -25    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentSampleDescriptor.java
  
  Index: InstrumentSampleDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentSampleDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentSampleDescriptor.java	29 Jul 2002 16:05:21 -0000	1.1
  +++ InstrumentSampleDescriptor.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -24,35 +24,46 @@
        * @return True if configured.
        */
       boolean isConfigured();
  -
  +    
       /**
        * Returns the name of the sample.
        *
        * @return The name of the sample.
        */
       String getName();
  -
  +    
       /**
        * Returns the sample interval.  The period of each sample in millisends.
        *
        * @return The sample interval.
        */
       long getInterval();
  -
  +    
       /**
        * Returns the number of samples in the sample history.
        *
        * @return The size of the sample history.
        */
       int getSize();
  -
  +    
       /**
        * Returns the description of the sample.
        *
        * @return The description of the sample.
        */
       String getDescription();
  -
  +    
  +    /**
  +     * Returns the type of the Instrument Sample.  Possible values include
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER,
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN, or
  +     *  InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM.
  +     *
  +     * @return The type of the Instrument Sample.
  +     */
  +    int getType();
  +    
       /**
        * Obtain the value of the sample.  All samples are integers, so the profiled
        * objects must measure quantity (numbers of items), rate (items/period), time in
  @@ -61,14 +72,14 @@
        * @return The sample value.
        */
       int getValue();
  -
  +    
       /**
        * Obtain the UNIX time of the beginning of the sample.
        *
        * @return The UNIX time of the beginning of the sample.
        */
       long getTime();
  -
  +    
       /**
        * Returns the Type of the Instrument which can use the sample.  This
        *  should be the same for all instances of a class.
  @@ -79,7 +90,7 @@
        * @return The Type of the Instrument which can use the sample.
        */
       int getInstrumentType();
  -
  +    
       /**
        * Returns the time that the current lease expires.  Permanent samples will
        *  return a value of 0.
  @@ -87,28 +98,22 @@
        * @return The time that the current lease expires.
        */
       long getLeaseExpirationTime();
  -
  +    
       /**
  -     * Obtains a static snapshot of the InstrumentSample.
  +     * Extends the lease to be lease milliseconds from the current time.
        *
  -     * @return A static snapshot of the InstrumentSample.
  -     */
  -    InstrumentSampleSnapshot getSnapshot();
  -
  -    /**
  -     * Registers a InstrumentSampleListener with a InstrumentSample given a name.
  +     * @param lease The length of the lease in milliseconds.
        *
  -     * @param listener The listener which should start receiving updates from the
  -     *                 InstrumentSample.
  +     * @return The new lease expiration time.  Returns 0 if the sample is
  +     *         permanent.
        */
  -    void addInstrumentSampleListener( InstrumentSampleListener listener );
  -
  +    long extendLease( long lease );
  +    
       /**
  -     * Unregisters a InstrumentSampleListener from a InstrumentSample given a name.
  +     * Obtains a static snapshot of the InstrumentSample.
        *
  -     * @param listener The listener which should stop receiving updates from the
  -     *                 InstrumentSample.
  +     * @return A static snapshot of the InstrumentSample.
        */
  -    void removeInstrumentSampleListener( InstrumentSampleListener listener );
  +    InstrumentSampleSnapshot getSnapshot();
   }
   
  
  
  
  1.2       +11 -11    jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentSampleSnapshot.java
  
  Index: InstrumentSampleSnapshot.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentSampleSnapshot.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentSampleSnapshot.java	29 Jul 2002 16:05:21 -0000	1.1
  +++ InstrumentSampleSnapshot.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -20,19 +20,19 @@
   {
       /** The name used to reference the InstrumentSample. */
       private String m_InstrumentSampleName;
  -
  +    
       /** The interval between each sample. */
       private long m_interval;
  -
  +    
       /** The number of samples in the InstrumentSample. */
       private int m_size;
  -
  +    
       /** The time that the last sample starts. */
       private long m_time;
  -
  +    
       /** The samples as an array of integers. */
       private int[] m_samples;
  -
  +    
       /*---------------------------------------------------------------
        * Constructors
        *-------------------------------------------------------------*/
  @@ -55,7 +55,7 @@
           m_time = time;
           m_samples = samples;
       }
  -
  +    
       /*---------------------------------------------------------------
        * Methods
        *-------------------------------------------------------------*/
  @@ -68,7 +68,7 @@
       {
           return m_InstrumentSampleName;
       }
  -
  +    
       /**
        * Returns the interval, in milliseconds, between each sample.
        *
  @@ -78,7 +78,7 @@
       {
           return m_interval;
       }
  -
  +    
       /**
        * Returns the number of samples in the InstrumentSample.
        *
  @@ -88,7 +88,7 @@
       {
           return m_size;
       }
  -
  +    
       /**
        * Returns the time that the last sample starts.
        *
  @@ -98,7 +98,7 @@
       {
           return m_time;
       }
  -
  +    
       /**
        * Returns the samples as an array of integers.  The sample at index 0
        *  will be the oldest.  The end of the array is the newest.
  
  
  
  1.2       +33 -1     jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentableDescriptor.java
  
  Index: InstrumentableDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentableDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InstrumentableDescriptor.java	29 Jul 2002 16:05:21 -0000	1.1
  +++ InstrumentableDescriptor.java	3 Aug 2002 15:00:38 -0000	1.2
  @@ -26,6 +26,14 @@
       boolean isConfigured();
   
       /**
  +     * Returns true if the Instrumentable was registered with the Instrument
  +     *  Manager.
  +     *
  +     * @return True if registered.
  +     */
  +    boolean isRegistered();
  +
  +    /**
        * Gets the name for the Instrumentable.  The Instrumentable Name is used to
        *  uniquely identify the Instrumentable during the configuration of the
        *  Profiler and to gain access to a InstrumentableDescriptor through a
  @@ -42,6 +50,30 @@
        */
       String getDescription();
   
  +    /**
  +     * Returns a child InstrumentableDescriptor based on its name or the name
  +     *  of any of its children.
  +     *
  +     * @param childInstrumentableName Name of the child Instrumentable being
  +     *                                requested.
  +     *
  +     * @return A descriptor of the requested child Instrumentable.
  +     *
  +     * @throws NoSuchInstrumentableException If the specified Instrumentable
  +     *                                       does not exist.
  +     */
  +    InstrumentableDescriptor getChildInstrumentableDescriptor( String childInstrumentableName )
  +        throws NoSuchInstrumentableException;
  +
  +    /**
  +     * Returns an array of Descriptors for the child Instrumentables registered
  +     *  by this Instrumentable.
  +     *
  +     * @return An array of Descriptors for the child Instrumentables registered
  +     *  by this Instrumentable.
  +     */
  +    InstrumentableDescriptor[] getChildInstrumentableDescriptors();
  +        
       /**
        * Returns a InstrumentDescriptor based on its name.
        *
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/manager/org/apache/excalibur/instrument/manager/interfaces/InstrumentSampleUtils.java
  
  Index: InstrumentSampleUtils.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.instrument.manager.interfaces;
  
  import org.apache.avalon.framework.configuration.ConfigurationException;
  
  /**
   * A series of methods which are useful when working with InstrumentSamples.
   *  These methods can be used on the server as well as the client.
   *
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/03 15:00:38 $
   * @since 4.1
   */
  public class InstrumentSampleUtils
  {
      /**
       * Resolves an instrument sample type based on a name.
       *
       * @param type Type of the InstrumentSample to resolve.  Accepted values are:
       *              "max", "maximum", "min", "minimum", "mean", 
       *              "ctr", and "counter".
       *
       * @throws ConfigurationException if the specified sample type is unknown.
       */
      public static int resolveInstrumentSampleType( String type )
          throws ConfigurationException {
          
          if ( type.equalsIgnoreCase( "max" ) || type.equalsIgnoreCase( "maximum" ) )
          {
              return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM;
          }
          else if ( type.equalsIgnoreCase( "min" ) || type.equalsIgnoreCase( "minimum" ) )
          {
              return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM;
          }
          else if ( type.equalsIgnoreCase( "mean" ) )
          {
              return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN;
          }
          else if ( type.equalsIgnoreCase( "ctr" ) || type.equalsIgnoreCase( "counter" ) )
          {
              return InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER;
          }
          else
          {
              throw new ConfigurationException( "'" + type + "' is not a valid sample type." );
          }
      }
      
      public static String getInstrumentSampleTypeName( int type )
      {
          switch ( type )
          {
          case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MAXIMUM:
              return "maximum";
              
          case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MINIMUM:
              return "minimum";
          
          case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_MEAN:
              return "mean";
              
          case InstrumentManagerClient.INSTRUMENT_SAMPLE_TYPE_COUNTER:
              return "counter";
              
          default:
              return "unknown-" + type;
          }
      }
      
      /**
       * Generates a sample name given its parameters.
       *
       * @param sampleType Type of the sample.
       * @param sampleInterval Interval of the sample.
       * @param sampleSize Size of the sample.
       *
       * @return A sample name.
       */
      public static String generateInstrumentSampleName( int sampleType,
                                                         long sampleInterval,
                                                         int sampleSize )
      {
          return getInstrumentSampleTypeName( sampleType ) + "." + 
              sampleInterval + "." + sampleSize;
      }
      
      /**
       * Generates a fully qualified sample name given its parameters.
       *
       * @param instrumentName Name of the instrument which owns the sample.
       * @param sampleType Type of the sample.
       * @param sampleInterval Interval of the sample.
       * @param sampleSize Size of the sample.
       *
       * @return A fully qualified sample name.
       */
      public static String generateFullInstrumentSampleName( String instrumentName,
                                                             int sampleType,
                                                             long sampleInterval,
                                                             int sampleSize )
      {
          return instrumentName + "." +
              generateInstrumentSampleName( sampleType, sampleInterval, sampleSize );
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>