[tracker/signal-timer] functional-tests:ipc: Cleanup test for signal enhancement for batch_update
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/signal-timer] functional-tests:ipc: Cleanup test for signal enhancement for batch_update
- Date: Fri, 17 Dec 2010 13:33:36 +0000 (UTC)
commit 51aba158df6a959cd3735cc1fbf094587dbb5709
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Dec 17 14:33:11 2010 +0100
functional-tests:ipc: Cleanup test for signal enhancement for batch_update
.../ipc/test-class-signal-performance-batch.vala | 46 ++-----------------
1 files changed, 5 insertions(+), 41 deletions(-)
---
diff --git a/tests/functional-tests/ipc/test-class-signal-performance-batch.vala b/tests/functional-tests/ipc/test-class-signal-performance-batch.vala
index 822a3bf..a3b0306 100644
--- a/tests/functional-tests/ipc/test-class-signal-performance-batch.vala
+++ b/tests/functional-tests/ipc/test-class-signal-performance-batch.vala
@@ -21,7 +21,6 @@ using Tracker;
using Tracker.Sparql;
const int max_signals = 1000;
-// const int max_signals = 10000;
const string title_data = "title";
struct Event {
@@ -35,27 +34,15 @@ struct Event {
private interface Resources : GLib.Object {
[DBus (name = "GraphUpdated")]
public signal void graph_updated (string class_name, Event[] deletes, Event[] inserts);
-
[DBus (name = "BatchSparqlUpdate")]
public abstract async void batch_sparql_update_async (string query) throws Sparql.Error, DBus.Error;
-
[DBus (name = "SparqlUpdate")]
public abstract async void sparql_update_async (string query) throws Sparql.Error, DBus.Error;
-
-}
-
-[DBus (name = "org.freedesktop.Tracker1.Resources.Class")]
-private interface ResourcesClass : GLib.Object {
- [DBus (name = "SubjectsAdded")]
- public signal void subjects_added (string [] subjects);
- [DBus (name = "SubjectsChanged")]
- public signal void subjects_changed (string [] subjects, string [] preds);
}
public class TestApp {
static DBus.Connection dbus_connection;
static Resources resources_object;
- static ResourcesClass class_object;
MainLoop loop;
bool initialized = false;
Sparql.Connection con;
@@ -71,12 +58,6 @@ public class TestApp {
"/org/freedesktop/Tracker1/Resources",
"org.freedesktop.Tracker1.Resources");
- class_object = (ResourcesClass) dbus_connection.get_object ("org.freedesktop.Tracker1",
- "/org/freedesktop/Tracker1/Resources/Classes/nmm/MusicPiece",
- "org.freedesktop.Tracker1.Resources.Class");
-
- class_object.subjects_added.connect (on_subjects_added);
- class_object.subjects_changed.connect (on_subjects_changed);
resources_object.graph_updated.connect (on_graph_updated_received);
t = new GLib.Timer ();
@@ -89,35 +70,18 @@ public class TestApp {
initialized = true;
}
- private void on_subjects_changed (string [] subjects, string [] preds) {
- foreach (string s in subjects)
- count++;
-
- //if (count == 20002)
- print ("Old class signal count=%d time=%lf\n", count, t.elapsed ());
- }
-
- private void on_subjects_added (string [] subjects) {
- foreach (string s in subjects)
- count++;
-
- //if (count == 20002)
- print ("Old class signal count=%d time=%lf\n", count, t.elapsed ());
- }
-
private void on_graph_updated_received (string class_name, Event[] deletes, Event[] inserts) {
foreach (Event insert in inserts)
count++;
- //if (count == 20002)
- print ("New class signal count=%d time=%lf\n", count, t.elapsed ());
+ print ("New class signal count=%d time=%lf\n", count, t.elapsed ());
}
private void insert_data () {
int i;
-// for (i = 0; i <= max_signals; i++) {
-// string upqry = "DELETE { <%d> a rdfs:Resource }".printf(i);
-// resources_object.sparql_update_async (upqry);
-// }
+ for (i = 0; i <= max_signals; i++) {
+ string upqry = "DELETE { <%d> a rdfs:Resource }".printf(i);
+ resources_object.sparql_update_async (upqry);
+ }
t.start();
for (i = 0; i <= max_signals; i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]