ó
‰ÎðYc @ s& d d l m Z d d l Z y d d l Z Wn d d l Z n Xi g d 6g d 6g d 6g d 6a d a e j ƒ Z d „ Z e e 7Z d „ Z
e j e
7_ e j ƒ Z d
„ Z
e e
7Z e j ƒ Z d „ Z e e 7Z e j ƒ Z d a d a d
„ Z e e 7Z d „ Z e j e 7_ d S( iÿÿÿÿ( t eventsNt req_successt
throughputt downloadst
req_errorsi c K sJ t d j i t j ƒ d 6| j d d ƒ d 6ƒ d | j d d ƒ GHd S( NR t timestampt messaget t msgs
Req Error: %st unknown( t metricst appendt timet get( t kw( ( sJ /Users/geo25002/Documents/Projects/LoadTesting/source/code/locustEvents.pyt req_error s 1c K s0 t d j i | d 6| d 6t j ƒ d 6ƒ d S( NR R t lenR ( R
R R ( t request_typet namet
response_timet response_lengthR ( ( sJ /Users/geo25002/Documents/Projects/LoadTesting/source/code/locustEvents.pyR s c K sN | j d d ƒ } t d 7a d t GHt d j i t j ƒ d 6t d 6ƒ d S( Nt sizeiÿÿÿÿi s Downlod Started: %dR R ( R
R R
R R ( R R ( ( sJ /Users/geo25002/Documents/Projects/LoadTesting/source/code/locustEvents.pyt on_download_start s
c K sN | j d d ƒ } t d 8a d t GHt d j i t j ƒ d 6t d 6ƒ d S( NR iÿÿÿÿi s Download Ended: %dR R ( R
R R
R R ( R R ( ( sJ /Users/geo25002/Documents/Projects/LoadTesting/source/code/locustEvents.pyt on_download_end% s
g c K s‰ t | j d d ƒ 7a t | j d d ƒ 7a d } t d k rK t t } n t d j i t j ƒ d 6t d 6t d 6t d 6| d
6ƒ d S( Nt bytesReadi t secondsg R R R t timeSpentR t rate( t
bytesRecvdR
R R
R R R ( R R ( ( sJ /Users/geo25002/Documents/Projects/LoadTesting/source/code/locustEvents.pyt on_chunk1 s
c C s\ t t j ƒ ƒ } t d | d ƒ } t j t | ƒ | j ƒ | j ƒ d t t ƒ GHd S( Ns ../results/%d_results.pklt wbs Req metrics captured: %d( t intR t opent picklet dumpR
t flusht closeR ( t tfint f( ( sJ /Users/geo25002/Documents/Projects/LoadTesting/source/code/locustEvents.pyt exiting; s
( t locustR R t cPickleR! R
R t EventHookt reqErrorR R t request_successt
downloadStartR t downloadEndR t chunkHookR R R R'