summaryrefslogtreecommitdiff
path: root/org
diff options
context:
space:
mode:
authorMatthew Johnson <mjj29@hecate.matthew.ath.cx>2008-01-11 02:41:29 +0000
committerMatthew Johnson <mjj29@hecate.matthew.ath.cx>2008-01-11 02:41:29 +0000
commit1f93119663aaa832a22304502dc0ce369bb3f50e (patch)
treebdaab3899de1d1aa284c04d5c05253803269f133 /org
parent6f2e718d2955f8f371f19b5b03973b1656be7e7b (diff)
Fix profiler
Diffstat (limited to 'org')
-rw-r--r--org/freedesktop/dbus/test/profile.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/org/freedesktop/dbus/test/profile.java b/org/freedesktop/dbus/test/profile.java
index cab5417..ef8b031 100644
--- a/org/freedesktop/dbus/test/profile.java
+++ b/org/freedesktop/dbus/test/profile.java
@@ -135,7 +135,8 @@ public class profile
} else if ("arrays".equals(args[0])) {
int count = ARRAY_INNER*ARRAY_OUTER;
System.out.print("Sending array of "+ARRAY_LENGTH+" ints "+count+" times.");
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Profiler p = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Profiler.class);
int[] v = new int[ARRAY_LENGTH];
Random r = new Random();
@@ -158,7 +159,8 @@ public class profile
} else if ("maps".equals(args[0])) {
int count = MAP_INNER*MAP_OUTER;
System.out.print("Sending map of "+MAP_LENGTH+" string=>strings "+count+" times.");
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Profiler p = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Profiler.class);
HashMap<String,String> m = new HashMap<String,String>();
for (int i = 0; i < MAP_LENGTH; i++)
@@ -181,7 +183,8 @@ public class profile
} else if ("lists".equals(args[0])) {
int count = LIST_OUTER*LIST_INNER;
System.out.print("Sending list of "+LIST_LENGTH+" strings "+count+" times.");
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Profiler p = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Profiler.class);
Vector<String> v = new Vector<String>();
for (int i = 0; i < LIST_LENGTH; i++)
@@ -204,7 +207,8 @@ public class profile
} else if ("structs".equals(args[0])) {
int count = STRUCT_OUTER*STRUCT_INNER;
System.out.print("Sending a struct "+count+" times.");
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Profiler p = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Profiler.class);
ProfileStruct ps = new ProfileStruct("hello", new UInt32(18), 500L);
Log l = new Log(count);
@@ -225,7 +229,8 @@ public class profile
} else if ("introspect".equals(args[0])) {
int count = INTROSPECTION_OUTER*INTROSPECTION_INNER;
System.out.print("Recieving introspection data "+count+" times.");
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Introspectable is = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Introspectable.class);
Log l = new Log(count);
long t = System.currentTimeMillis();
@@ -246,7 +251,8 @@ public class profile
System.out.println("Introspect data: "+s);
} else if ("bytes".equals(args[0])) {
System.out.print("Sending "+BYTES+" bytes");
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Profiler p = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Profiler.class);
byte[] bs = new byte[BYTES];
for (int i = 0; i < BYTES; i++)
@@ -255,7 +261,8 @@ public class profile
p.bytes(bs);
System.out.println(" done in "+(System.currentTimeMillis()-t)+"ms.");
} else if ("rate".equals(args[0])) {
- conn.exportObject("/Profiler", new ProfilerInstance());
+ ProfilerInstance pi = new ProfilerInstance();
+ conn.exportObject("/Profiler", pi);
Profiler p = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Profiler.class);
Peer peer = conn.getRemoteObject("org.freedesktop.DBus.java.profiler", "/Profiler", Peer.class);
long start = System.currentTimeMillis();