Giter Club home page Giter Club logo

Comments (6)

FutureSharks avatar FutureSharks commented on May 27, 2024

On what OS did you run sudo pip3 install invokust --target=python-packages?

from invokust.

supunsandeeptha avatar supunsandeeptha commented on May 27, 2024

I tried on Ubuntu 18.04

from invokust.

supunsandeeptha avatar supunsandeeptha commented on May 27, 2024

More Information About the Operating System @FutureSharks
Virtualization: xen
Operating System: Ubuntu 18.04.5 LTS
Kernel: Linux 5.4.0-1030-aws
Architecture: x86-64

from invokust.

FutureSharks avatar FutureSharks commented on May 27, 2024

I think you'll have to paste your locust file also.

from invokust.

supunsandeeptha avatar supunsandeeptha commented on May 27, 2024

Locust File
`
from locust import HttpLocust, TaskSet, task, between
from os import environ

class WebsiteUser(HttpLocust):
wait_time = between(5.0, 9.0)

@task()
def get_home_page(self):
    """
    Gets /
    """
    self.client.get("/")

`

Lambda_Locust File
`
import sys
sys.path.insert(0, "python-packages")

import logging
import json
from invokust.aws_lambda import get_lambda_runtime_info
from invokust import LocustLoadTest, create_settings

logging.basicConfig(level=logging.INFO)

def handler(event=None, context=None):
try:
if event:
settings = create_settings(**event)
else:
settings = create_settings(from_environment=True)

    loadtest = LocustLoadTest(settings)
    loadtest.run()

except Exception as e:
    logging.error("Locust exception {0}".format(repr(e)))

else:
    locust_stats = loadtest.stats()
    lambda_runtime_info = get_lambda_runtime_info(context)
    loadtest_results = locust_stats.copy()
    loadtest_results.update(lambda_runtime_info)
    json_results = json.dumps(loadtest_results)

    logging.info(json_results)
    return json_results

`

Lambda Test Json Object
{ "locustfile": "princess_locustfile.py", "host": "https://cms.mod.studio/", "num_clients": "30", "hatch_rate": "1", "run_time": "5m" }

The newest Error That I'm getting

image

from invokust.

FutureSharks avatar FutureSharks commented on May 27, 2024

Your code blocks are all messed up so it's difficult to read what you have written. But it looks like you're not importing User anywhere so the issue title does not make sense?

from invokust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.