lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.92k stars 549 forks source link

"make benchmark" is not available #309

Open jserv opened 3 years ago

jserv commented 3 years ago

Quote from top-level documentation:

Benchmark ~/lwan/build$ make benchmark This will compile testrunner and execute benchmark script src/scripts/benchmark.py.

However, after configuring cmake, I found no target named benchmark.

jserv commented 3 years ago

I checked the executable file specified in LWAN_PATH of script src/scripts/benchmark.py. It was not built with make testrunner. Instead, the appropriate path would be build/src/bin/testrunner/testrunner.

jserv commented 3 years ago

Related: #270

JackyYin commented 3 years ago

Hello, I think it's because you're missing lua or python3 package.

Check the following code block in CMakeList.txt:

#
# Set up testsuite and benchmark targets
#
find_package(PythonInterp 3)
if (LUA_FOUND AND PYTHONINTERP_FOUND)
    add_custom_target(testsuite
        COMMAND ${PYTHON_EXECUTABLE}
            ${PROJECT_SOURCE_DIR}/src/scripts/testsuite.py -v ${CMAKE_BINARY_DIR}
        DEPENDS testrunner techempower
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        COMMENT "Running test suite.")

    add_custom_target(benchmark
        COMMAND ${PYTHON_EXECUTABLE}
            ${PROJECT_SOURCE_DIR}/src/scripts/benchmark.py
            ${CMAKE_BINARY_DIR}/src/bin/testrunner/testrunner
        DEPENDS testrunner
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        COMMENT "Running benchmark.")
endif()

After I successfully installed lua and python3, I am able to see benchmark and testsuite in my Makefile.

this is my Dockerfile config:

FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && \
  apt-get install -y \
  git cmake zlib1g-dev pkg-config lua5.1-dev libsqlite3-dev libmysqlclient-dev  python3 \
  gcc g++ make valgrind gdb
jserv commented 3 years ago

Thank @JackyYin for prompt reply. I would send a pull request on explicit prerequisites for target testsuite and benchmark later.

JackyYin commented 3 years ago

Thanks @jserv , I have made a related PR: #311 for fixing benchmark.py and CMakeList.txt, but I didn't modify the README.md, you can make another PR for documentation.