perfsonar-dev - perfsonar: r2422 - in trunk/perfsonar: ant/tcmp contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni src/org/perfsonar/service/measurementPoint/tracefileCaptureType
Subject: perfsonar development work
List archive
perfsonar: r2422 - in trunk/perfsonar: ant/tcmp contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni src/org/perfsonar/service/measurementPoint/tracefileCaptureType
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2422 - in trunk/perfsonar: ant/tcmp contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni src/org/perfsonar/service/measurementPoint/tracefileCaptureType
- Date: Wed, 23 May 2007 10:24:16 -0400
Author: uros
Date: 2007-05-23 10:24:15 -0400 (Wed, 23 May 2007)
New Revision: 2422
Modified:
trunk/perfsonar/ant/tcmp/tcmp-configure-targets.xml
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MAPIMonitorRequest.java
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MonitorRequest.java
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
Log:
Configuration option max.trace.packets added, which limits number of maximum
packets captured by a single flow.
Modified: trunk/perfsonar/ant/tcmp/tcmp-configure-targets.xml
===================================================================
--- trunk/perfsonar/ant/tcmp/tcmp-configure-targets.xml 2007-05-23 12:01:49
UTC (rev 2421)
+++ trunk/perfsonar/ant/tcmp/tcmp-configure-targets.xml 2007-05-23 14:24:15
UTC (rev 2422)
@@ -102,6 +102,29 @@
/>
<echo message="Accepted list of remote hosts/interfaces allowed to
be captured from: ${remote.ifs}"/>
</target>
+
+
+ <!-- Interactively get maximum trace packets -->
+
+ <target name="get-max-tracefile-size">
+ <echo message="Use 0 do disable limit."/>
+ <input message="Enter the maximum number of packets to capture
within a single flow [0]:"
+ addproperty="max.trace.packets"
+ defaultvalue="0"
+ />
+ <echo message="Accepted maximum number of packets to capture:
${max.trace.packets}"/>
+ </target>
+
+
+ <!-- Interactively get simultaneous traces boolean value -->
+
+ <target name="get-simultaneous-traces">
+ <input message="Allow simultanous (paralell) tracefile captures
[false]:"
+ addproperty="simultaneous.traces"
+ defaultvalue="false"
+ />
+ <echo message="Accepted simultaneous traces:
${simultaneous.traces}"/>
+ </target>
<!-- creating service.properties file -->
@@ -110,7 +133,9 @@
depends="get-tcmp-config-file,
get-local-ifs,
get-remote-ifs,
- get-pcap-storage-dir">
+ get-pcap-storage-dir,
+ get-max-tracefile-size,
+ get-simultaneous-traces">
<property file="ant/const.properties" />
@@ -138,6 +163,9 @@
<entry key="service.r.ls_url" value=""/>
<entry key="component.registrator.interval" value="30000"/>
<entry key="component.registrator.scheduler_component"
value="scheduler"/>
+
+ <entry key="max.trace.packets" value="${max.trace.packets}"/>
+ <entry key="simultaneous.traces"
value="${simultaneous.traces}"/>
</propertyfile>
Modified:
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MAPIMonitorRequest.java
===================================================================
---
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MAPIMonitorRequest.java
2007-05-23 12:01:49 UTC (rev 2421)
+++
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MAPIMonitorRequest.java
2007-05-23 14:24:15 UTC (rev 2422)
@@ -27,6 +27,12 @@
* MAPI flow descriptor.
*/
protected int flowDescr = -1;
+
+
+ /**
+ * Default sleep time, when waiting for the flow to finish
+ */
+ private static final long FLOW_WAIT_SLEEP_TIME = 1000; // ms
// ---------------------------------- public methods
@@ -134,13 +140,18 @@
* Wait for MAPI flow until specified Date.
*
* @param time wait until this time is reached
+ * @param isSizeLimited true if flow is file size limited, false
otherwise
*/
- public void mapiWaitFlow(Date time) {
+ public void mapiWaitFlow(Date time, boolean isSizeLimited) {
// Wait until stop is reached, then call mapiCloseFlow()
long endTime = time.getTime();
long curTime = System.currentTimeMillis();
+ // TODO:
+ // Should be waiting in interval of FLOW_WAIT_SLEEP_TIME mss
+ // and check for flow finish, using mapi_get_flow_info function,
+ // which does not yet have mapi-jni interface
while (endTime > curTime) {
try { Thread.sleep(endTime - curTime); } catch
(InterruptedException ie) {}
@@ -198,7 +209,7 @@
mmReq.mapiConnect();
System.out.println("Connected to the flow (flowDescr=" + fd +
")");
- mmReq.mapiWaitFlow(new Date(System.currentTimeMillis() + 3000L));
+ mmReq.mapiWaitFlow(new Date(System.currentTimeMillis() + 3000L),
false);
BigInteger pc = (BigInteger)mmReq.mapiReadResults(pcid);
BigInteger bc = (BigInteger)mmReq.mapiReadResults(bcid);
Modified:
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MonitorRequest.java
===================================================================
---
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MonitorRequest.java
2007-05-23 12:01:49 UTC (rev 2421)
+++
trunk/perfsonar/contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni/MonitorRequest.java
2007-05-23 14:24:15 UTC (rev 2422)
@@ -297,6 +297,7 @@
* Wait for MAPI flow until specified Date.
*
* @param time wait until this time is reached
+ * @param isSizeLimited true if flow is file size limited, false
otherwise
*/
- public void mapiWaitFlow(Date time);
+ public void mapiWaitFlow(Date time, boolean isSizeLimited);
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
2007-05-23 12:01:49 UTC (rev 2421)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
2007-05-23 14:24:15 UTC (rev 2422)
@@ -652,13 +652,24 @@
}
+ // Retrieve max.trace.packets service configuration variable else
+ // use unlimited value (0L)
+ long maxTracePackets = 0L;
+ try {
+ String maxTracePacketsStr =
configuration.getProperty("max.trace.packets");
+ maxTracePackets = Long.valueOf(maxTracePacketsStr);
+ } catch (Exception e) {}
+
// Apply TO_FILE function to the flow
- // TODO: another configuration option specifying maximum limit
of packets
- // that can be captured to one pcap file (disk space
safeguard)
- monReq.mapiApplyFunction("TO_FILE",
MonitorRequest.CAP_FORMAT_TYPE_MFF_PCAP, datumFile, 0L);
+ monReq.mapiApplyFunction(
+ "TO_FILE",
+ MonitorRequest.CAP_FORMAT_TYPE_MFF_PCAP,
+ datumFile,
+ maxTracePackets);
this.logger.info(type + ".runAction: Applied TO_FILE function ("
+ MonitorRequest.CAP_FORMAT_TYPE_MFF_PCAP
- + ", '" + datumFile + "', 0) to the flow on " + hostIf
+ + ", '" + datumFile + "', " + maxTracePackets
+ + ") to the flow on " + hostIf
+ " (tid=" + Thread.currentThread().getId() + ")");
// Connect to the flow
@@ -667,7 +678,9 @@
+ hostIf + ", waiting until " +
this.request.getEndTimeParam()
+ " (tid=" + Thread.currentThread().getId() + ")");
- monReq.mapiWaitFlow(this.request.getEndTimeParam());
+ monReq.mapiWaitFlow(
+ this.request.getEndTimeParam(),
+ maxTracePackets != 0);
// Close flow
monReq.mapiCloseFlow();
- perfsonar: r2422 - in trunk/perfsonar: ant/tcmp contrib/mapi-jni/java/src/si/arnes/jra1/perfsonar/jni/mapijni src/org/perfsonar/service/measurementPoint/tracefileCaptureType, svnlog, 05/23/2007
Archive powered by MHonArc 2.6.16.