summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2010-06-30 19:22:55 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-06-30 19:28:16 +0200
commit5de3cf4ef49b9a66866bd8bd0cdcfaaf767577c9 (patch)
tree18aff7ae941d9716f51eb0fcaa3091c985f0aca9 /test
parent14236b2a2b6121963d1fc1e1eead753a380498f2 (diff)
downloadconnman-5de3cf4ef49b9a66866bd8bd0cdcfaaf767577c9.tar.gz
connman-5de3cf4ef49b9a66866bd8bd0cdcfaaf767577c9.tar.bz2
connman-5de3cf4ef49b9a66866bd8bd0cdcfaaf767577c9.zip
Update service statistics
Instead of collecting statistics on interface name base and storing it local in counter.c, update the Service object. counter.c maps interface names to Service objects. The assumption is made that there is a 1:1 mapping between Service objects and interface name. A Counter object will only show Service object statistics for services in the ready state. There is no interface (yet) for retrieving information on Service objects in idle/failure/configuration/.. state.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-counter12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/test-counter b/test/test-counter
index 70a30273..c32cb9ef 100755
--- a/test/test-counter
+++ b/test/test-counter
@@ -15,14 +15,12 @@ class Counter(dbus.service.Object):
mainloop.quit()
@dbus.service.method("org.moblin.connman.Counter",
- in_signature='a{sv}', out_signature='')
- def Usage(self, stats):
+ in_signature='oa{sv}', out_signature='')
+ def Usage(self, path, stats):
+ print "%s" % (path)
for key in stats.keys():
- if key in ["Interface"]:
- val = str(stats[key])
- else:
- val = int(stats[key])
- print "%s = %s" % (key, val)
+ val = int(stats[key])
+ print " %s = %s" % (key, val)
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)