mirror of
				https://github.com/viq/NewsBlur.git
				synced 2025-11-01 09:09:16 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			No EOL
		
	
	
		
			589 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			No EOL
		
	
	
		
			589 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import sys
 | 
						|
 | 
						|
class MuninGraph(object):
 | 
						|
 | 
						|
    def run(self):
 | 
						|
        cmd_name = None
 | 
						|
        if len(sys.argv) > 1:
 | 
						|
            cmd_name = sys.argv[1]
 | 
						|
        if cmd_name == 'config':
 | 
						|
            self.print_config()
 | 
						|
        else: 
 | 
						|
            metrics = self.calculate_metrics()
 | 
						|
            self.print_metrics(metrics)
 | 
						|
            
 | 
						|
    def print_config(self):
 | 
						|
        for key,value in self.graph_config.items():
 | 
						|
            print '%s %s' % (key, value)
 | 
						|
 | 
						|
    def print_metrics(self, metrics):
 | 
						|
        for key, value in metrics.items():
 | 
						|
            print '%s.value %s' % (key, value)
 | 
						|
             |