def applyCommand(self): cluster = getCluster(self.options.cname) if not cluster: return False if self.options.follow: try: previous = cluster.counters print "Starting measurements." while True: new = cluster.counters compareCounters(previous, new) previous = new except KeyboardInterrupt: pass elif self.options.once: print "Collecting counters, wait a moment..." first = cluster.counters try: print "Ready. Use Ctrl-C to make comparison." # Wait for interrupt while True: time.sleep(10) except KeyboardInterrupt: print "Collecting counters, wait a moment..." second = cluster.counters compareCounters(first, second) else: print cluster.counters return True
def applyCommand(self): cluster = getCluster (self.options.cname) if not cluster: return False load_category = "Normal" keys = sorted(cluster.getProcessorsOfType ("dicos")) tps = [] for name in keys: tps.append (cluster.processors[name]) try: while True: loads = [] for tp in tps: loads.append (tp.load[load_category]) sys.stdout.write (" ".join ('%.1f' % round(load, 1) for load in loads)) sys.stdout.write ("\n") sys.stdout.flush () time.sleep (float(self.options.poll_rate)/1000) except KeyboardInterrupt: pass return True
def applyCommand(self): cluster = getCluster(self.options.cname) if not cluster: return False print cluster.clusterName return True
def applyCommand(self): cluster = getCluster (self.options.cname) if not cluster: return False cluster.setEnvironmentVariable (self.options.variable, self.options.value) return True
def applyCommand(self): cluster = getCluster(self.options.cname) if not cluster: return False for tp in sorted(cluster.processors.keys()): print tp, return True
def applyCommand(self): cluster = getCluster(self.options.cname) if not cluster: return False if self.options.ws: print cluster.workspace else: print cluster.describe() return True
def applyCommand(self): cluster = getCluster (self.options.cname) if not cluster: return False value = cluster.getEnvironmentVariable (self.options.variable) if value: print value return True else: print "No variable with name %s" % self.options.variable return False