perfsonar-dev - r1793 - in branches/yi-udel/perfsonar: schema/example-instances/sonar/LS/xquery src/org/perfsonar/client/testHarness
Subject: perfsonar development work
List archive
r1793 - in branches/yi-udel/perfsonar: schema/example-instances/sonar/LS/xquery src/org/perfsonar/client/testHarness
Chronological Thread
- From:
- To:
- Subject: r1793 - in branches/yi-udel/perfsonar: schema/example-instances/sonar/LS/xquery src/org/perfsonar/client/testHarness
- Date: Mon, 4 Dec 2006 13:22:49 -0500
Author: yi
Date: 2006-12-04 13:22:48 -0500 (Mon, 04 Dec 2006)
New Revision: 1793
Modified:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xquery/QueryScratch.txt
branches/yi-udel/perfsonar/src/org/perfsonar/client/testHarness/LSTestClientScenario.java
Log:
Modified:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xquery/QueryScratch.txt
===================================================================
---
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xquery/QueryScratch.txt
2006-12-04 13:34:21 UTC (rev 1792)
+++
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xquery/QueryScratch.txt
2006-12-04 18:22:48 UTC (rev 1793)
@@ -6,6 +6,7 @@
openContainer LSStore.dbxml
addIndex "" metadataIdRef edge-attribute-equality-string
+
openContainer LSCache.dbxml
addIndex "" metadataIdRef edge-attribute-equality-string
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/client/testHarness/LSTestClientScenario.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/client/testHarness/LSTestClientScenario.java
2006-12-04 13:34:21 UTC (rev 1792)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/client/testHarness/LSTestClientScenario.java
2006-12-04 18:22:48 UTC (rev 1793)
@@ -15,11 +15,17 @@
{
static Vector<String> servers = new Vector<String> ();
- static final int N = 512;
+ static final int N = 1024;
static String tmpFile =
"schema/example-instances/sonar/LS/test/tmp.xml";
public static void main(String[] args)
{
+ try
+ {
+ FileWriter results = new FileWriter(new
File("schema/example-instances/sonar/LS/test/BDBResults.txt"));
+ results.write("Size Register Query Keepalive
Deregister\n");
+ System.out.print("Size Register Query Keepalive
Deregister\n");
+
String server;
double startTime, endTime;
int i, p, r;
@@ -28,9 +34,10 @@
for (i = 1; i <= N; i ++)
{
// time is up to do a sample test
- if ((int)Math.pow(2, p) == i)
+ if (/*(int)Math.pow(2, p) == i*/ true)
{
- System.out.println("Size: " + i);
+ results.write(i + "\t");
+ System.out.print(i + "\t");
// test register
server = generateString ();
@@ -39,7 +46,8 @@
startTime = new
Long(System.currentTimeMillis()).doubleValue();
executeRequest(tmpFile);
endTime = new
Long(System.currentTimeMillis()).doubleValue();
- System.out.println("Time Taken to Register:
"+((endTime-startTime)/1000d)+" secs");
+ results.write(((endTime-startTime)/1000d) + "\t\t");
+ System.out.print(((endTime-startTime)/1000d) +
"\t\t");
// test query
r = (int)(Math.random() * (i - 1));
@@ -47,7 +55,8 @@
startTime = new
Long(System.currentTimeMillis()).doubleValue();
executeRequest(tmpFile);
endTime = new
Long(System.currentTimeMillis()).doubleValue();
- System.out.println("Time Taken to Query:
"+((endTime-startTime)/1000d)+" secs");
+ results.write(((endTime-startTime)/1000d) + "\t");
+ System.out.print(((endTime-startTime)/1000d) + "\t");
// test keepalive
r = (int)(Math.random() * (i - 1));
@@ -55,7 +64,8 @@
startTime = new
Long(System.currentTimeMillis()).doubleValue();
executeRequest(tmpFile);
endTime = new
Long(System.currentTimeMillis()).doubleValue();
- System.out.println("Time Taken to Keepalive:
"+((endTime-startTime)/1000d)+" secs");
+ results.write(((endTime-startTime)/1000d) + "\t\t");
+ System.out.print(((endTime-startTime)/1000d) +
"\t\t");
// test deregister
r = (int)(Math.random() * (i - 1));
@@ -63,7 +73,8 @@
startTime = new
Long(System.currentTimeMillis()).doubleValue();
executeRequest(tmpFile);
endTime = new
Long(System.currentTimeMillis()).doubleValue();
- System.out.println("Time Taken to Deregister:
"+((endTime-startTime)/1000d)+" secs\n");
+ results.write(((endTime-startTime)/1000d) + "\n");
+ System.out.println(((endTime-startTime)/1000d));
// re-register another data to make up the entry
deleted by deregister
server = generateString ();
@@ -72,6 +83,7 @@
executeRequest(tmpFile);
p ++;
+ results.flush();
}
// regular append
else
@@ -84,6 +96,12 @@
}
new File(tmpFile).delete();
+ results.close();
+ }
+ catch (IOException e)
+ {
+ System.err.println(e.getMessage());
+ }
}
public static void executeRequest(String xmlFile)
@@ -203,15 +221,21 @@
fw.write(" <nmwg:metadata id=\"meta\">\n");
fw.write(" <xquery:subject
id=\"sub\">\n");
+
fw.write(" declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\";\n");
- fw.write(" declare namespace
nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\";\n");
- // use LSStore.dbxml only instead
- //fw.write(" let $collection :=
(collection (\"LSStore.dbxml\") | collection (\"LSCache.dbxml\"))\n");
+ fw.write(" declare namespace
psservice=\"http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/\";\n");
+
+ // eXist version
+// fw.write(" for $m in
/nmwg:store[@type='LSStore']/nmwg:metadata\n");
+// fw.write(" where contains
($m//psservice:accessPoint, \"." + hostName + "\")\n");
+// fw.write(" return $m\n");
+
+ // BDB version
fw.write(" let $collection :=
collection (\"LSStore.dbxml\")\n");
- fw.write(" for $m in
$collection/nmwg:metadata,\n");
- fw.write(" $d in
$collection/nmwg:data\n");
- fw.write(" where
$m/@id=$d/@metadataIdRef and contains ($d//nmwgt:hostName, \"." + hostName +
"\")\n");
+ fw.write(" for $m in
$collection/nmwg:metadata\n");
+ fw.write(" where contains
($m//psservice:accessPoint, \"." + hostName + "\")\n");
fw.write(" return $m\n");
+
fw.write(" </xquery:subject>\n");
fw.write("
<nmwg:eventType>service.lookup.xquery</nmwg:eventType>\n");
fw.write(" </nmwg:metadata>\n");
- r1793 - in branches/yi-udel/perfsonar: schema/example-instances/sonar/LS/xquery src/org/perfsonar/client/testHarness, svnlog, 12/04/2006
Archive powered by MHonArc 2.6.16.