Coder Social home page Coder Social logo

smark's Introduction

Actions Status Actions Status Actions Status Actions Status Actions Status codecov Conventional Commits

Smark

HTTP benchmark tool.

Develop

Wiki

Build and run the standalone target

Use the following command to build and run the executable target.

cmake -Hstandalone -Bbuild/standalone
cmake --build build/standalone
./build/standalone/Smark --help

Build and run test suite

Use the following commands from the project's root directory to run the test suite.

cmake -Htest -Bbuild/test
cmake --build build/test
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test

# or simply call the executable: 
./build/test/SmarkTests

To collect code coverage information, run CMake with the -DENABLE_TEST_COVERAGE=1 option.

Run clang-format

Use the following commands from the project's root directory to run clang-format (must be installed on the host system).

cmake -Htest -Bbuild/test

# view changes
cmake --build build/test --target format

# apply changes
cmake --build build/test --target fix-format

Due to this issue, for WSL developer:

git config core.filemode true

cmake --build build/test --target check-format # format or check-format

git config core.filemode false

Note: This is just a temporary solution for those working on WSL.

See Format.cmake for more options.

Additional tools

The project includes an tools.cmake file that can be used to import additional tools on-demand through CMake configuration arguments. The following are currently supported.

  • -DUSE_SANITIZER=<Address | Memory | MemoryWithOrigins | Undefined | Thread | Leak | 'Address;Undefined'>
  • -DUSE_CCACHE=<YES | NO>

Acknowledgement

Project template: TheLartians: ModernCppStarter

smark's People

Contributors

cvelth avatar eijnewgnaw avatar robertindie avatar thelartians avatar

Watchers

 avatar  avatar

smark's Issues

[Feat] Add command line parser

According to cxxopts, add following options:

  • h, host: set remote host
  • p, port: set remote port
  • t, threads: set the number of threads.
  • c, connections: set the number of connections.

Use the following codes to run smark:

  Smark smark;
  smark.setting.connection_count = 4; // -c 4 or --connections 4
  smark.setting.thread_count = 2; // -t 2 or --threads 2
  smark.setting.ip = "127.0.0.1"; // -h 127.0.0.1 or --host 127.0.0.1
  smark.setting.port = 12138; // -p 12138 or --port 12138
  smark.Run();

When the smark ends, print smark.status.finish_count .

[Bug] Test fail when use uv in testsvr

Code: bug_uv branch

Fail case 1: uv hanlde is already closed.

/mnt/g/codebase/smark/test/source/smark.cpp:63(0 Success):Run TCP server on port:12239
/mnt/g/codebase/smark/test/source/testsvr.cpp:69(0 Success):New connection
/mnt/g/codebase/smark/test/source/smark.cpp:94(115 Operation now in progress):Test: BasicBenchmark
/mnt/g/codebase/smark/test/source/smark.cpp:98(0 Success):Run Http server on port:12240
/mnt/g/codebase/smark/source/client.cpp:46(115 Operation now in progress):HttpClient connect to: ip=127.0.0.1 port=12240 
/mnt/g/codebase/smark/test/source/testsvr.cpp:69(0 Success):New connection
SmarkTests: /mnt/g/codebase/smark/build/test/_deps/uv_a-src/src/unix/core.c:113: uv_close: Assertion `!uv__is_closing(handle)' failed.
/mnt/g/codebase/smark/source/client.cpp:46(115 Operation now in progress):HttpClient connect to: ip=127.0.0.1 port=12240 
/mnt/g/codebase/smark/test/source/testsvr.cpp:69(11 Resource temporarily unavailable):New connection

Fail case 2: The SmarkTest process enters a suspended state and cannot be killed by kill -9 ${PID}.

When rerunning:

/mnt/g/codebase/smark/test/source/smark.cpp:63(0 Success):Run TCP server on port:12139

// waiting forever ... . You must change the default testsvr port to rerun SmarkTest

Fail case 3: n <= stream->write_queue_size,

In testsvr.cpp:217, variable data turn to '\000' after calling uv_write

/mnt/g/codebase/smark/test/source/smark.cpp:63(0 Success):Run TCP server on port:12239
/mnt/g/codebase/smark/test/source/testsvr.cpp:69(0 Success):New connection
/mnt/g/codebase/smark/test/source/smark.cpp:94(115 Operation now in progress):Test: BasicBenchmark
/mnt/g/codebase/smark/test/source/smark.cpp:98(0 Success):Run Http server on port:12240
/mnt/g/codebase/smark/source/client.cpp:46(115 Operation now in progress):HttpClient connect to: ip=127.0.0.1 port=12240 
/mnt/g/codebase/smark/test/source/testsvr.cpp:69(0 Success):New connection
SmarkTests: /mnt/g/codebase/smark/build/test/_deps/uv_a-src/src/unix/stream.c:743: uv__write_req_update: Assertion `n <= stream->write_queue_size' failed.
/mnt/g/codebase/smark/source/client.cpp:46(115 Operation now in progress):HttpClient connect to: ip=127.0.0.1 port=12240 
/mnt/g/codebase/smark/test/source/testsvr.cpp:69(11 Resource temporarily unavailable):New connection

v1.0 plan

  • benchmark with n connections
  • http benchmark

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.