Giter Site home page Giter Site logo

-j doesn't always output JSON about siege HOT 5 OPEN

SJrX avatar SJrX commented on July 18, 2024
-j doesn't always output JSON

from siege.

Comments (5)

JoeDog avatar JoeDog commented on July 18, 2024

from siege.

SJrX avatar SJrX commented on July 18, 2024

With this Dockerfile

FROM ubuntu:22.04

RUN apt-get update && apt-get install -y siege jq

Build it and start a new shell

docker build -t siege-test  .
docker run -it --rm siege-test /bin/bash

Then run the following commands.

# siege -c 1 -r 1 -j www.google.ca > report.json
# cat report.json | jq
parse error: Invalid numeric literal at line 1, column 4
# cat report.json
New configuration template added to /root/.siege
Run siege -C to view the current settings in that file
{       "transactions":                            2,
        "availability":                       100.00,
        "elapsed_time":                         0.26,
        "data_transferred":                     0.02,
        "response_time":                        0.13,
        "transaction_rate":                     7.69,
        "throughput":                           0.08,
        "concurrency":                          1.00,
        "successful_transactions":                 2,
        "failed_transactions":                     0,
        "longest_transaction":                  0.21,
        "shortest_transaction":                 0.05
}

If you run it again, it will pass.

Another example is.

#siege -c 1 -r 1 --log=./siege_log.txt -j www.google.ca  > file.json
cat file.txt | jq
{
  "transactions": 2,
  "availability": 100,
  "elapsed_time": 0.18,
  "data_transferred": 0.02,
  "response_time": 0.09,
  "transaction_rate": 11.11,
  "throughput": 0.12,
  "concurrency": 1,
  "successful_transactions": 2,
  "failed_transactions": 0,
  "longest_transaction": 0.13,
  "shortest_transaction": 0.05
}
parse error: Invalid numeric literal at line 14, column 4

#cat file.json
{       "transactions":                            2,
        "availability":                       100.00,
        "elapsed_time":                         0.18,
        "data_transferred":                     0.02,
        "response_time":                        0.09,
        "transaction_rate":                    11.11,
        "throughput":                           0.12,
        "concurrency":                          1.00,
        "successful_transactions":                 2,
        "failed_transactions":                     0,
        "longest_transaction":                  0.13,
        "shortest_transaction":                 0.05
}
LOG FILE: ./siege_log.txt
You can disable this log file notification by editing
/root/.siege/siege.conf and changing 'show-logfile' to false.

In these cases the benefits of having a json formatted output is lost in my opinion, because other output means it can't really be handled programmatically easily.

from siege.

JoeDog avatar JoeDog commented on July 18, 2024

from siege.

JoeDog avatar JoeDog commented on July 18, 2024

from siege.

SJrX avatar SJrX commented on July 18, 2024

Thank you.

That will go to stderr now. There's not much I can do to help you with
running siege.config. It's a shell script. You can edit it.

This part I didn't understand.

I think maybe the safest thing would be to have a way of just putting the JSON file output somewhere specific. I think that if you have a flag that says output will be json, all output should be json. I'm kind of leary about putting on logging or verbosity with the -j flag. I'm not sure what can handle JSON with non JSON.

But I found a way around this now :) Thanks again.

from siege.

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.