Performance test for graphQL API

前端 未结 7 1584
北恋
北恋 2021-02-04 20:07

Today I\'m doing my API automation testing and performance testing with Jmeter when the server is a REST API.

Now the development changed to graphQL API, and I have two

7条回答
  •  忘掉有多难
    2021-02-04 20:42

    You can try using easygraphql-load-tester

    How it works:

    easygraphql-load-tester is a node library created to make load testing on GraphQL based on the schema; it'll create a bunch of queries, that are going to be the ones used to test your server.

    Examples:

    • Artillery.io
    • K6

    Result:

    Using this package, it was possible to me, to identify a bad implementation using dataloaders on the server.

    Results without dataloaders

    All virtual users finished
    Summary report @ 10:07:55(-0500) 2018-11-23
      Scenarios launched:  5
      Scenarios completed: 5
      Requests completed:  295
      RPS sent: 36.88
      Request latency:
        min: 1.6
        max: 470.9
        median: 32.9
        p95: 233.2
        p99: 410.8
      Scenario counts:
        GraphQL Query load test: 5 (100%)
      Codes:
        200: 295
    

    Results with dataloaders

    All virtual users finished
    Summary report @ 10:09:09(-0500) 2018-11-23
      Scenarios launched:  5
      Scenarios completed: 5
      Requests completed:  295
      RPS sent: 65.85
      Request latency:
        min: 1.5
        max: 71.9
        median: 3.3
        p95: 19.4
        p99: 36.2
      Scenario counts:
        GraphQL Query load test: 5 (100%)
      Codes:
        200: 295
    

提交回复
热议问题