Giter VIP home page Giter VIP logo

Comments (7)

bojand avatar bojand commented on September 15, 2024

Hello, ghz-web is a completely separate complimentary application for storing, viewing and comparing the results of test runs over time. It would have separate config not related to your ghz runs. It seems I am compiling it incorrectly so sqlite3 support may not work atm, I'll work on fixing this; and also improving the documentation. But it should work with postgres or mysql. So to get started, for example run postgres and create a database called ghz.

Create a web.yml wherever ghz-web is:

---
server:
  port: 3000
database:
  type: postgres
  connection: host=localhost port=5432 dbname=ghz sslmode=disable
log:
  level: debug

Run it using

ghz-web -config web.yml

Go to http://localhost:3000/ and you should see a UI. Create a project. Take note of the ID.

The idea is that then you can perform ghz tests over time and use curl or HTTPie to send the JSON results to the server to save then for tracking and viewing. The web server has a special ingest API for performing this:

ghz -insecure \
    -proto ./greeter.proto \
    -call helloworld.Greeter.SayHello \
    -d '{"name": "Bob"}' \
    -tags '{"env": "staging", "created by":"Joe Developer"}' \
    -name 'Greeter SayHello' \
    -O json \
    0.0.0.0:50051 | http POST localhost:3000/api/projects/1/ingest

Basically do a ghz call, make sure to use -O json to create a JSON report, then pipe the output to http (or curl) to send to the web server's ingest API endpoint under project with ID 1 (substitute the project id here if needed).

Note that ghz itself can output to HTML (sample), which may be useful if you do not absolutely need all the functionality of ghz-web and do not want the additional operational implications of running a server.

Hope this helps.

ghz-web tool is Beta and still a bit of a WIP heh. I'll work to fix the compile issue above and improve the documentation.

from ghz.

minddazed avatar minddazed commented on September 15, 2024

I think there's something wrong with the sqlite3 compilation as well. I'm getting the same error when trying to start the server on OSX 10.13.6 using the 0.26.0 Darwin build. Looking forward to trying this out!

from ghz.

bojand avatar bojand commented on September 15, 2024

Hello, can you please try v0.27.0 and see if that works for you.

from ghz.

minddazed avatar minddazed commented on September 15, 2024

Thanks for the quick fix! I was able to get past starting the web server with the new build. However when using the generic write endpoint (POST /api/projects/:id/ingest) I get the following error:

HTTP/1.1 404 Not Found
Access-Control-Allow-Origin: *
Content-Length: 64
Content-Type: application/json; charset=UTF-8
Date: Fri, 25 Jan 2019 19:56:33 GMT
Vary: Origin
X-Request-Id: vCYTodNuAGEWR8HMrHiFt30HXFrJ7ZMu

{
    "message": "strconv.ParseUint: parsing \":id\": invalid syntax"
}

Server log:

{"time":"2019-01-25T11:55:26.499443-08:00","id":"iWu3JXDEHsnyxsEEP6hv70MYBBBA0SYp","remote_ip":"::1","host":"localhost:3333","method":"POST","uri":"/api/projects/:id/ingest/","status":404, "latency":198452,"latency_human":"198.452ยตs","bytes_in":19042,"bytes_out":64}

My command:
ghz -config ./telemetry-test.json | http POST localhost:3333/api/projects/:id/ingest

Post works against a known project id.

from ghz.

bojand avatar bojand commented on September 15, 2024

The idea is that normally you would create a project and then use that ID to ingest multiple runs for that project and track them over time. So use the UI to create a project for a specific call for example, and then use that project ID for all tests of that call. Alternatively there is an /api/ingest endpoint that will automatically create the project and ingest the result. But normally you would want to create the project yourself, as it does not really make sense to constantly create project + a result every time. It defeats the purpose of grouping runs together so they can be traced over time and compared.

from ghz.

BesSlaaneshi avatar BesSlaaneshi commented on September 15, 2024

can i ask question too about ghz web?
so.
i have web.yml

server:
  port: 3306
database:
  type: mysql
  connection: root:fdsafasfasdfa@/ghz
log:
  level: info
  path: /tmp/ghz.log

i start command ghz-web -config web.yml
than i go to http://localhost:3306/
command completes succefully
and see this:
default
than i start command
ghz -config .\FSI.json POST localhost:3306/api/projects/1/ingest
this config have "O": "json"
it completes and i see json result in stdout, so all good.
and still no changes on http://localhost:3306/

from ghz.

srenatus avatar srenatus commented on September 15, 2024

Heya! What a surprise to stumble upon my own issue here ๐Ÿ˜…

It's been a while, and I've had a chance to look into gRPC performance once more. Using ghz via the Golang interface is really nice, and I've been trying to inject the JSON report via the API:

$ ghz --insecure -Ojson --call LoadService.PushDataStruct -d '{"path":"/foo", "data": {"bar": 2}}' 127.0.0.1:8
080 > cli-rep.json
$ curl -XPOST 127.0.0.1:80/api/ingest -d @cli-rep.json
{"project":{"id":4,"createdAt":"2022-12-09T14:14:06.239526+01:00","updatedAt":"2022-12-09T14:14:06.239526+01:00","name":"young-
catfish-46","description":"","status":"ok"},"report":{"id":9,"createdAt":"2022-12-09T14:14:06.240694+01:00","updatedAt":"2022-1
2-09T14:14:06.240694+01:00","projectID":4,"endReason":"normal","date":"0001-01-01T00:00:00Z","count":0,"total":0,"average":0,"f
astest":0,"slowest":0,"rps":0,"status":"ok","latencyDistribution":[]},"options":{"id":9,"createdAt":"2022-12-09T14:14:06.241357
+01:00","updatedAt":"2022-12-09T14:14:06.241357+01:00","reportID":9,"info":{"insecure":false,"load-schedule":"","load-start":0,
"load-end":0,"load-step":0,"load-step-duration":0,"load-max-duration":0,"concurrency-schedule":"","concurrency-start":0,"concur
rency-end":0,"concurrency-step":0,"concurrency-step-duration":0,"concurrency-max-duration":0,"binary":false,"CPUs":0}},"histogr
am":{"id":9,"createdAt":"2022-12-09T14:14:06.241929+01:00","updatedAt":"2022-12-09T14:14:06.241929+01:00","reportID":9,"buckets
":[]},"details":{"success":0,"fail":0}}

AFAICT that looks OK, however, on the ghz-web interface, it doesn't look OK:

image

Clicking on the report, I get a blank page, and this console log:

image

I've tried both firefox and chrome. I've built ghz-web using go build ./cmd/ghz-web in a repo checkout because the binary from the Darwin release bundle wasn't recognized as an executable on my system.

Would you happen to know what I did wrong?

from ghz.

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.