Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information lost when response times are high #827

Open
Alpherie opened this issue Dec 23, 2019 · 1 comment
Open

Information lost when response times are high #827

Alpherie opened this issue Dec 23, 2019 · 1 comment

Comments

@Alpherie
Copy link

Alpherie commented Dec 23, 2019

When the response times are high (15-20s), yandextank loses some of statistics. For example, tank had made 28 requests (according to logs), but only 22 are displayed in stats. Sometimes even more is lost, with 3-5 requests only displayed.

Version of tank: YandexTank/1.12.6

My log:
tmp_log.txt

My config:

overload:
  enabled: true
  package: yandextank.plugins.DataUploader
  token_file: "token.txt"
influx:
  enabled: true
  address: my.ip.0.1
  port: 8086
  database: base
  username: user
  password: pass
  histograms: true
  labeled: true
  tank_tag: test
phantom:
  enabled: false
bfg:
  enabled: true
  ammofile: python_tests/ammores.txt
  instances: 32
  gun_config:
    class_name: LoadTest
    module_path: ./python_tests/
    module_name: test
    init_param: Not used
    address: http://127.0.0.1:8888
  gun_type: ultimate
  load_profile:
    load_type: rps
    schedule: const(8,1s) const(1, 20s)
  loop: 256
console:
  enabled: false
@Alpherie
Copy link
Author

Alpherie commented Dec 23, 2019

Some more info, that may be useful:
My python code for bfg:

# -*- coding: utf-8 -*-

import os
import json
import logging
log = logging.getLogger(__name__)

import requests as r

class LoadTest(object):
    def __init__(self, gun):
        self.gun = gun
        self.addr = self.gun.get_option("address")

    def case1(self, missile):
        with self.gun.measure('test') as m:
            try:
                res = r.post(self.addr)
            except r.exceptions.Timeout:
                m['proto_code'] = 601
            except Exception:
                m['proto_code'] = 602
            else:
                m['proto_code'] = res.status_code
        try:
            log.info(res.content)
        except Exception:
            log.info('Error!!!')
        

    def setup(self, param):
        ''' this will be executed in each worker before the test starts '''
        pass

    def teardown(self):
        ''' this will be executed in each worker after the end of the test '''
        os._exit(0)
        return 0

Test target I made for this problem (python3):

import time
import datetime
import random

import tornado.ioloop
import tornado.web
import tornado.locks

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")

    @tornado.web.asynchronous
    async def post(self):
        condition = tornado.locks.Condition()
        await condition.wait(datetime.timedelta(seconds=random.randint(10, 20)))
        self.write('Test answer')

def make_app():
    return tornado.web.Application([
        (r"/.*", MainHandler),
    ])

if __name__ == "__main__":
    print('Started')
    app = make_app()
    app.listen(8888)
    tornado.ioloop.IOLoop.current().start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant