summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeif Lotfy <seif@lotfy.com>2011-12-28 20:44:31 +0100
committerSeif Lotfy <seif@lotfy.com>2011-12-28 20:44:31 +0100
commitdaf27a82a98ce2b4878d775f7f0f3dfc482397e3 (patch)
tree62ebaa7d889d199a9912bc881c6f8feb8d8ae30d
parent07b531ee42c5a3dcabe38da94602a7d06cd69633 (diff)
downloadzeitgeist-daf27a82a98ce2b4878d775f7f0f3dfc482397e3.tar.gz
added unload method
fixed typos renamed extra_data to data
-rw-r--r--extensions/benchmark.vala33
-rw-r--r--tools/development/README13
-rw-r--r--tools/development/benchmark.py3
-rwxr-xr-xtools/development/query_timings.py2
4 files changed, 34 insertions, 17 deletions
diff --git a/extensions/benchmark.vala b/extensions/benchmark.vala
index ce788400..eb4cf6a0 100644
--- a/extensions/benchmark.vala
+++ b/extensions/benchmark.vala
@@ -59,7 +59,7 @@ namespace Zeitgeist
uint result_type)
throws Error
{
- var extra_data = new HashTable<string, Variant> (str_hash, str_equal);
+ var data = new HashTable<string, Variant> (str_hash, str_equal);
var find_event_ids_timer = new Timer ();
var ids = engine.find_event_ids (
@@ -78,17 +78,36 @@ namespace Zeitgeist
var find_events_elapsed = get_events_elapsed + find_event_ids_elapsed + marsh_events_elapsed;
- extra_data.insert("find_event_ids",
+ data.insert("find_event_ids",
new Variant.double(find_event_ids_elapsed));
- extra_data.insert("get_events",
+ data.insert("get_events",
new Variant.double(get_events_elapsed));
- extra_data.insert("find_events",
+ data.insert("find_events",
new Variant.double(find_events_elapsed));
- extra_data.insert("marsh_events",
+ data.insert("marsh_events",
new Variant.double(marsh_events_elapsed));
- extra_data.insert("events", marsh_events);
+ data.insert("events", marsh_events);
- return extra_data;
+ return data;
+ }
+
+ public override void unload ()
+ {
+ try
+ {
+ var connection = Bus.get_sync (BusType.SESSION, null);
+ if (registration_id != 0)
+ {
+ connection.unregister_object (registration_id);
+ registration_id = 0;
+ }
+ }
+ catch (Error err)
+ {
+ warning ("%s", err.message);
+ }
+
+ debug ("%s, this.ref_count = %u", Log.METHOD, this.ref_count);
}
}
diff --git a/tools/development/README b/tools/development/README
index 631b5907..08549d26 100644
--- a/tools/development/README
+++ b/tools/development/README
@@ -1,7 +1,7 @@
# USAGE
#
-# To run the benchmarks on a certain branch of zeitgeist make sure you are
-# running and instance of the branch. Make sure the branch includes the benchmark
+# To run the benchmarks on a certain branch of Zeitgeist make sure you are
+# running an instance of the branch. Make sure the branch includes the benchmark
# extension.
#
# To benchmark and output timing to 'output.json' run
@@ -9,12 +9,11 @@
# If you already have data in the output file and want to merge both
# data sets (build avg.) run
# ./query_timings.py -m -o output.json
-# To plot the data use the '--plot' argument, multible '--plot' arguments
-# When plotting one needs to choose between several types of plots such using
-# --type with arguments marsh_time, get_events_time, find_ids_time, find_events, overall)
+# To plot the data use the '--plot' argument, multiple '--plot' arguments
+# will define multiple series.
+# When plotting one needs to choose between several types of plots using
+# --type with arguments marsh_time, get_events_time, find_ids_time, find_events and overall
#
-# will define multible series.
-# ./query_timings.py --plot output.json --plot output1.json -o plot.svg
# In short, a run always looks like:
# tools/development/query_timings.py --name "lp:zeitgeist" -o trunk.json \
# --queries tools/development/query_sets/timerange_always.txt
diff --git a/tools/development/benchmark.py b/tools/development/benchmark.py
index 097524e2..9f8f7b0e 100644
--- a/tools/development/benchmark.py
+++ b/tools/development/benchmark.py
@@ -12,6 +12,3 @@ benchmark_interface = dbus.Interface(benchmark_obj,
def find_events(time_frame, templates, storage_type, num_events, result_type):
return benchmark_interface.FindEvents(time_frame, templates, storage_type,
num_events, result_type)
-
-if __name__ == "__main__":
- print find_events([0,9999999999990], [], 2, 20, 2).keys()
diff --git a/tools/development/query_timings.py b/tools/development/query_timings.py
index 7be022ef..c8250acd 100755
--- a/tools/development/query_timings.py
+++ b/tools/development/query_timings.py
@@ -4,6 +4,8 @@
# Zeitgeist
#
# Copyright © 2010 Markus Korn <thekorn@gmx.net>
+# Copyright © 2011 Collabora Ltd.
+# By Seif Lotfy <seif@lotfy.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by