Changeset 6765


Ignore:
Timestamp:
Feb 5, 2018, 1:42:32 PM (19 months ago)
Author:
mabarracus
Message:

update test suite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/testing_utils/test_analytics.py

    r5560 r6765  
    2525REAL_FLAVOURS=True      # TRUE FLAVOURS (release 15)
    2626DATE_ROUNDS=15           # DIFERENTS MONTHS SENDED
    27 NCLIENTS=3000           # NUMBER DIFFERENT CLIENTS
    28 MAX_THREADS=5           # PARALLEL CLIENTS SENDING DATA (> 5 == no effect)
     27NCLIENTS=20000           # NUMBER DIFFERENT CLIENTS
     28MAX_THREADS=1           # PARALLEL CLIENTS SENDING DATA (> 5 == no effect)
    2929CACHE_CONNECTIONS=1     # python requests cache hosts
    3030NAPPS=5000                # MAX NUMBER DIFFERENT APPS
    31 CLIENT_MAX_APPS=10      # MAX NUMBER APPS SENDING
    32 CLIENT_UPDATE_FREQ=5    # PERCENT OF CLIENTS THAT UPDATE INTRA ROUND
     31CLIENT_MAX_APPS=100      # MAX NUMBER APPS SENDING
     32CLIENT_UPDATE_FREQ=3    # PERCENT OF CLIENTS THAT UPDATE INTRA ROUND
    3333LOOPS=5                # LOOPS INTRA DATE LOOP
    3434SLEEP_THREAD_TIME=0     # SLEEP THREAD AFTER SENDING
     
    3939SHOW_BY_APP=True
    4040PAUSE_SHOW_STATS=False
    41 PAUSE_WITH_DATE_ROUNDS=False
     41PAUSE_WITH_DATE_ROUNDS=True
    4242# STAT COUNTERS
    4343NPET=0
     
    4747UPDATED_TOTAL=0
    4848UPDATED=0
    49 RANDOM=True
     49RANDOM=True     # Random generation releases, flavours, macs
    5050
    5151exit_threads=0
     
    118118            print "Closed connection"
    119119
    120 if NCLIENTS <= MAX_RANDOM_CLIENTS:
     120if RANDOM and NCLIENTS <= MAX_RANDOM_CLIENTS:
    121121    MACS_USED=[]
    122122else:
     
    141141    def __init__(self):
    142142        self.mac=self.gen_mac()
    143         self.release=RELEASES[random.randint(0,4)%2] # more probabilities for the first listed release
     143        if RANDOM:
     144            self.release=RELEASES[random.randint(0,4)%2] # more probabilities for the first listed release
     145        else:
     146            self.release=RELEASES[0]
    144147        self.release_number=self.gen_rel_number(self.release)
    145         fla=FLAVOURS[self.release][random.randint(0,len(FLAVOURS[self.release])-1)]
     148        if RANDOM:
     149            fla=FLAVOURS[self.release][random.randint(0,len(FLAVOURS[self.release])-1)]
     150        else:
     151            fla=FLAVOURS[self.release][0]
    146152        self.flavour=fla['name']
    147153        self.real_flavour=fla['real']
     
    155161        global NCLIENTS,MAX_RANDOM_CLIENTS,MACS_USED
    156162
    157         if NCLIENTS <= MAX_RANDOM_CLIENTS:
     163        if RANDOM and NCLIENTS <= MAX_RANDOM_CLIENTS:
    158164            mac = "02:00:00:%02x:%02x:%02x" % (random.randint(0, 255),random.randint(0, 255),random.randint(0, 255))
    159165            while mac in MACS_USED:
     
    166172
    167173    def gen_rel_number(self,release,dummy=False):
     174        if not RANDOM:
     175            dummy=True
    168176        if release == '15':
    169177            if not dummy:
    170178                self.num=random.randint(100,100+MAX_RELNUMBER)
     179            else:
     180                self.num=100
    171181            rnum='15.05.0.{}'.format(self.num)
    172182        else:
     
    174184                self.year=random.randint(16,16+(MAX_RELNUMBER/12))
    175185                self.month=random.randint(1,1+(MAX_RELNUMBER%12))
     186                self.day=1
     187            else:
     188                self.year=16
     189                self.month=1
    176190                self.day=1
    177191            rnum='16.{}{:02d}{:02d}'.format(self.year,self.month,self.day)
     
    185199        else:
    186200            napps=CLIENT_MAX_APPS
    187             start_app_at=random.randint(1,NAPPS-CLIENT_MAX_APPS)
     201            start_app_at=random.randint(1,NAPPS-CLIENT_MAX_APPS+1)
    188202        for i in range(napps):
    189203            if RANDOM:
Note: See TracChangeset for help on using the changeset viewer.