#NEWLINE# def random_datapoint( n ) : #NEWLINE# #INDENT# point = DataPoint ( n ) #NEWLINE# overall = point [ DataPoint . CURRENT ] . get ( '' , KPISet ( ) ) #NEWLINE# overall [ KPISet . CONCURRENCY ] = r ( 100 ) #NEWLINE# overall [ KPISet . SAMPLE_COUNT ] = ( int ( ( 100 * r ( 1000 ) ) ) + 1 ) #NEWLINE# overall [ KPISet . SUCCESSES ] = int ( ( overall [ KPISet . SAMPLE_COUNT ] * random ( ) ) ) #NEWLINE# overall [ KPISet . FAILURES ] = ( overall [ KPISet . SAMPLE_COUNT ] - overall [ KPISet . SUCCESSES ] ) #NEWLINE# overall [ KPISet . PERCENTILES ] [ '25' ] = r ( 10 ) #NEWLINE# overall [ KPISet . PERCENTILES ] [ '50' ] = r ( 20 ) #NEWLINE# overall [ KPISet . PERCENTILES ] [ '75' ] = r ( 30 ) #NEWLINE# overall [ KPISet . PERCENTILES ] [ '90' ] = r ( 40 ) #NEWLINE# overall [ KPISet . PERCENTILES ] [ '99' ] = r ( 50 ) #NEWLINE# overall [ KPISet . PERCENTILES ] [ '100' ] = r ( 100 ) #NEWLINE# overall [ KPISet . RESP_CODES ] [ rc ( ) ] = 1 #NEWLINE# overall [ KPISet . AVG_RESP_TIME ] = r ( 100 ) #NEWLINE# overall [ KPISet . AVG_CONN_TIME ] = ( overall [ KPISet . AVG_RESP_TIME ] / 3.0 ) #NEWLINE# overall [ KPISet . AVG_LATENCY ] = ( ( 2.0 * overall [ KPISet . AVG_RESP_TIME ] ) / 3.0 ) #NEWLINE# overall . sum_rt = ( overall [ KPISet . AVG_RESP_TIME ] * overall [ KPISet . SAMPLE_COUNT ] ) #NEWLINE# overall . sum_cn = ( overall [ KPISet . AVG_CONN_TIME ] * overall [ KPISet . SAMPLE_COUNT ] ) #NEWLINE# overall . sum_lt = ( overall [ KPISet . AVG_LATENCY ] * overall [ KPISet . SAMPLE_COUNT ] ) #NEWLINE# cumul = point [ DataPoint . CUMULATIVE ] . get ( '' , KPISet ( ) ) #NEWLINE# cumul . merge_kpis ( overall ) #NEWLINE# cumul . recalculate ( ) #NEWLINE# point . recalculate ( ) #NEWLINE# overall [ KPISet . AVG_RESP_TIME ] = r ( 100 ) #NEWLINE# overall [ KPISet . AVG_CONN_TIME ] = ( overall [ KPISet . AVG_RESP_TIME ] / 3.0 ) #NEWLINE# overall [ KPISet . AVG_LATENCY ] = ( ( 2.0 * overall [ KPISet . AVG_RESP_TIME ] ) / 3.0 ) #NEWLINE# return point