Index: /trunk/src/libs/xpcom18a4/python/sample/shellcommon.py
===================================================================
--- /trunk/src/libs/xpcom18a4/python/sample/shellcommon.py	(revision 12402)
+++ /trunk/src/libs/xpcom18a4/python/sample/shellcommon.py	(revision 12403)
@@ -97,5 +97,5 @@
         return 'off'
 
-def guestStats(ctx,guest):
+def guestStats2(ctx,guest):
     stats = {
         'Guest statistics for sample': ctx['ifaces'].GuestStatisticType.SampleNumber,
@@ -115,4 +115,16 @@
             pass
 
+def guestStats(ctx,mach):
+    collector = ctx['vb'].performanceCollector
+    collector.setupMetrics(['*'], [mach], 1, 15)
+
+    (vals, names, objs, idxs, lens) = collector.queryMetricsData(["*"], [mach])
+    for i in range(0,len(names)):
+        valsStr = '['
+        for j in range(0, lens[i]):
+            valsStr += str(vals[idxs[i]])+' '
+        valsStr += ']'
+        print "Name:",names[i],"Vals:",valsStr
+
 def cmdExistingVm(ctx,mach,cmd):
     mgr=ctx['mgr']
@@ -131,5 +143,5 @@
         return
     # unfortunately IGuest is suppressed, thus WebServices knows not about it
-    if ctx['remote'] and cmd == 'stats':
+    if ctx['remote'] and cmd == 'stats2':
         print 'Trying to use local only functionality, ignored'
         return        
@@ -138,5 +150,7 @@
          'resume':     lambda: console.resume(),
          'powerdown':  lambda: console.powerDown(),
-         'stats':      lambda: guestStats(ctx, console.guest),
+# Guest stats not yet implemented
+#         'stats2':      lambda: guestStats2(ctx, console.guest),
+#         'stats':      lambda: guestStats(ctx, mach),
          }
     ops[cmd]()
@@ -264,5 +278,4 @@
     print "Executing",expr
     try:
-        #mach.BIOSSettings.IOAPICEnabled = True
         exec expr
     except Exception, e:
@@ -297,6 +310,10 @@
   
    (vals, names, objs, idxs, lens) = collector.queryMetricsData(["*"], [host])
-   for i in range(0,len(vals)):
-      print "for name:",names[i]," val:",vals[i]
+   for i in range(0,len(names)):
+       valsStr = '['
+       for j in range(0, lens[i]):
+           valsStr += str(vals[idxs[i]])+' '
+       valsStr += ']'
+       print "Name:",names[i],"Vals:",valsStr
 
    return 0
@@ -314,4 +331,5 @@
             'pause':['Pause virtual machine', pauseCmd],
             'resume':['Resume virtual machine', resumeCmd],
+# stats not yet well implemented
             'stats':['Stats for virtual machine', statsCmd],
             'powerdown':['Power down virtual machine', powerdownCmd],
@@ -338,8 +356,13 @@
 
 def interpret(ctx):
-    print "Running VirtualBox version %s" %(ctx['vb'].version)
+    vbox = ctx['vb']
+    print "Running VirtualBox version %s" %(vbox.version)
 
     autoCompletion(commands, ctx)
 
+    # to allow to print actual host information, we collect infor for
+    # last 150 secs maximum, (sample every 10 secs and keep up to 15 samples)
+    vbox.performanceCollector.setupMetrics(['*'], [vbox.host], 10, 15)
+   
     while True:
         try:
@@ -357,2 +380,3 @@
                 traceback.print_exc()
 
+    vbox.performanceCollector.disableMetrics(['*'], [vbox.host])
