<s> from kong . models import TestResult , Test <EOL> import munin <EOL> def slugify ( string ) : <EOL> return string . replace ( '<STR_LIT:->' , '<STR_LIT:_>' ) <EOL> class KongDuration ( munin . Plugin ) : <EOL> tests = Test . objects . all ( ) <EOL> def fetch ( self ) : <EOL> limit = len ( self . tests ) - <NUM_LIT:1> <EOL> results = TestResult . objects . filter ( site__pk = <NUM_LIT:2> ) [ : limit ] <EOL> for result in results : <EOL> yield ( '<STR_LIT>' % slugify ( result . test . slug ) , result . duration ) <EOL> def config ( self ) : <EOL> yield ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> for test in self . tests : <EOL> yield ( "<STR_LIT>" % slugify ( test . slug ) , test . name ) <EOL> yield ( "<STR_LIT>" % slugify ( test . slug ) , test . name ) <EOL> yield ( "<STR_LIT>" % slugify ( test . slug ) , "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> munin . run ( KongDuration ) </s>
