#NEWLINE# def xml( self , request ) : #NEWLINE# #INDENT# sch = etree . Element ( 'Scheduler' , version = '1.0' ) #NEWLINE# data = self . scheduler . stats ( ) #NEWLINE# lat = etree . SubElement ( sch , 'Latency' , period = str ( data [ 'latency' ] [ 'period' ] ) ) #NEWLINE# etree . SubElement ( lat , 'Maximum' ) . text = ( '%f' % data [ 'latency' ] [ 'max' ] ) #NEWLINE# etree . SubElement ( lat , 'Minimum' ) . text = ( '%f' % data [ 'latency' ] [ 'min' ] ) #NEWLINE# etree . SubElement ( lat , 'Average' ) . text = ( '%f' % data [ 'latency' ] [ 'avg' ] ) #NEWLINE# tasks = etree . SubElement ( sch , 'Tasks' , count = str ( data [ 'tasks' ] [ 'count' ] ) ) #NEWLINE# for task_type in data [ 'tasks' ] : #NEWLINE# #INDENT# if ( task_type == 'count' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# task_node = etree . SubElement ( sch , task_type , count = str ( data [ 'tasks' ] [ task_type ] [ 'count' ] ) ) #NEWLINE# for sub_type in data [ 'tasks' ] [ task_type ] : #NEWLINE# #INDENT# if ( sub_type == 'count' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# etree . SubElement ( task_node , task_type , type = sub_type , count = str ( data [ 'tasks' ] [ task_type ] [ sub_type ] [ 'count' ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# return sch