<commit_before>homepage: https://github.com/3kyro/servant-benchmark#readme
changelog-type: markdown
hash: be54c87791fd6313034c2ed3e0d8c80230f451ee607ff92973a3cada22f590cd
test-bench-deps:
  bytestring: -any
  case-insensitive: -any
  base: '>=4.7 && <5'
  base64-bytestring: -any
  hspec: -any
  text: -any
  servant-benchmark: -any
  servant: -any
  QuickCheck: -any
  http-types: -any
  aeson: -any
  yaml: -any
  http-media: -any
maintainer: <EMAIL>
synopsis: Generate benchamrk files from a Servant API
changelog: |
  # Changelog for servant-wrt

  ## Unreleased changes
basic-deps:
  bytestring: -any
  case-insensitive: -any
  base: '>=4.7 && <5'
  base64-bytestring: -any
  text: -any
  servant: -any
  QuickCheck: -any
  http-types: -any
  aeson: -any
  yaml: -any
  http-media: -any
all-versions:
- 0.1.0.0
author: <NAME>
latest: 0.1.0.0
description-type: markdown
description: "# servant-benchmark\n\nA library for producing random request data from
  *Servant* APIs. \n\n## Building a `Generator`\n\nThe `Generator` type must closely
  follow the structure of the *Servant* API. \n\n* Different endpoints are combined
  with the `:|:` operator\n* Different generators are combined with the `:>:` operator\n*
  Every endpoint must end with a  `(Text, Word)` tuple consisting of the endpoint
  name and its corresponding weight.\n  Endpoint names are only used for additional
  information passed to the benchmark implementations\n  and do not have to follow
  specific rules. That being said, generators for extensive APIs can get\n  rather
  big and hard to read, so providing sensible naming could be very beneficial.  \n*
  The weight of an endpoint specifies the number of instances per testing run\n  of
  the API. Endpoints with 0 weight will be ignored.\n* For every API combinator expecting
  a request value, a `Gen a` random value generator from the\n  [QuickCheck](https://hackage.haskell.org/package/QuickCheck)
  package must be provided. \n  The following combinators require a value generator:\n
  \   * `ReqBody`\n    * `QueryParams`\n    * `Capture`\n    * `CaptureAll`\n    *
  `Header`\n    * `Fragment`\n* For the `BasicAuth` combinator, see the dedicated
  section below \n\nAs an example, the following is a valid `Generator` for a contrived
  servant API\n\n````haskell\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE DataKinds
  #-}\n{-# LANGUAGE TypeOperators #-}\n\ntype API = \n    \"books\" :> Get '[JSON]
  [Book]\n    :<|> \"view-my-referer\" :> Header \"from\" Referer :> Get '[JSON] Referer\n
  \   :<|> \"users\" :> Capture \"userId\" Integer :> ReqBody '[JSON] User :> Put
  '[JSON] User\n    :<|> \"post\" :> QueryParam \"segments\" Text :> Get '[JSON] Post\n
  \   :<|> Raw\n\ngenerator :: Generator API\nlet generator =\n    (\"books\", 1)\n
  \   :|: arbitrary :>: (\"referer\", 2)\n    :|: pure 1001 :>: arbitrary :>: (\"users
  endpoint\", 2)\n    :|: elements [\"title\", \"contents\", \"post\"] :>: (\"post\",
  4)\n    :|: (\"raw\", 0)\n````\n\nThe first endpoint \"books\" does not require
  request data and so only the name / weight tuple is\nprovided.\n\nThe \"view-my-referer\"
  endpoint requires a \"from\" header with an accompanying `Referer` value. Here\nwe
  assume `Referer` has an `Arbitrary` instance to provide a random value. The endpoint
  generator\nfinishes with the name/weight indication.\n\nThe \"users\" endpoint requires
  two different request values. An Integer capture representing a user\nid as well
  as a `User` value. We hard-code the user id to `1001` using the monadic `pure` and
  assume that\n`User` has an `Arbitrary` instance to produce a random value. We finish
  with the endpoint's name/weight as necessary.\n\nThe \"post\" endpoint requires
  a `Text` query parameter. We provide a fixed set of possible values\nusing the `elements`
  function from the `QuickCheck` package. With a weight of 4, four instances of\nthe
  \"post\" endpoint will be produced, each with a random value from the specified
  set.\n\nFinally our API provides a `Raw` endpoint for serving static files, but
  we'd rather not benchmark\nit. Providing a 0 weight ensures that no request will
  be generated \n\n### Basic Auth\n\nA generator for an endpoint using a `BasicAuth`
  combinator requires both a function to convert the\nrequested user data type to
  `BasicAuthData` as well as a `Gen` value for the requested user data. \n\nexample:\n\n````haskell\ntype
  privateAPI = \"private\" :> BasicAuth \"foo-realm\" User :> PrivateAPI\n\ntoBasicAuthData
  :: User -> BasicAuthData\ntoBasicAuthData user = ... \n\n-- assuming `User` has
  an `Arbitrary` instance\nlet generator = toBasicAuthData :>: arbitrary :>: (\"basicAuth\",
  1)\n````\n\nThe information will be encoded as an `Authorization` header.\n\n##
  Supported tools\n\nThe following benchmarking tools are supported :\n\n- [wrk](https://github.com/wg/wrk)\n-
  [Drill](https://github.com/fcsonline/drill)\n- [Siege](src/Servant/Benchmark/Tools/Siege.hs)\n\nIf
  you'd like your favorite tool to be supported, don't hesitate to tell me so in an
  issue,\nor better yet submit a PR.\n\n## Next steps\n\n* Provide support for *servant-auth*
  combinators\n* Expand the support for benchmarking frameworks\n"
license-name: BSD-3-Clause
<commit_msg>Update from Hackage at 2021-04-26T08:09:49Z<commit_after>homepage: https://github.com/3kyro/servant-benchmark#readme
changelog-type: markdown
hash: 2c11a9a1f4e84d2e6d284a21df84cdf00ddc40ffef547541b73218ca007612c4
test-bench-deps:
  bytestring: -any
  case-insensitive: -any
  base: '>=4.7 && <5'
  base64-bytestring: -any
  hspec: -any
  text: -any
  servant-benchmark: -any
  servant: -any
  QuickCheck: -any
  http-types: -any
  aeson: -any
  yaml: -any
  http-media: -any
maintainer: <EMAIL>
synopsis: Generate benchmark files from a Servant API
changelog: |
  # Changelog for servant-wrt

  ## 0.1.1.0

  - Fix Typos

  ## Unreleased changes
basic-deps:
  bytestring: -any
  case-insensitive: -any
  base: '>=4.7 && <5'
  base64-bytestring: -any
  text: -any
  servant: -any
  QuickCheck: -any
  http-types: -any
  aeson: -any
  yaml: -any
  http-media: -any
all-versions:
- 0.1.0.0
- 0.1.1.0
author: <NAME>
latest: 0.1.1.0
description-type: markdown
description: "# servant-benchmark\n\nA library for producing random request data from
  *Servant* APIs. \n\n## Building a `Generator`\n\nThe `Generator` type must closely
  follow the structure of the *Servant* API. \n\n* Different endpoints are combined
  with the `:|:` operator\n* Different generators are combined with the `:>:` operator\n*
  Every endpoint must end with a  `(Text, Word)` tuple consisting of the endpoint
  name and its corresponding weight.\n  Endpoint names are only used for additional
  information passed to the benchmark implementations\n  and do not have to follow
  specific rules. That being said, generators for extensive APIs can get\n  rather
  big and hard to read, so providing sensible naming could be very beneficial.  \n*
  The weight of an endpoint specifies the number of instances per testing run\n  of
  the API. Endpoints with 0 weight will be ignored.\n* For every API combinator expecting
  a request value, a `Gen a` random value generator from the\n  [QuickCheck](https://hackage.haskell.org/package/QuickCheck)
  package must be provided. \n  The following combinators require a value generator:\n
  \   * `ReqBody`\n    * `QueryParams`\n    * `Capture`\n    * `CaptureAll`\n    *
  `Header`\n    * `Fragment`\n* For the `BasicAuth` combinator, see the dedicated
  section below \n\nAs an example, the following is a valid `Generator` for a contrived
  servant API\n\n````haskell\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE DataKinds
  #-}\n{-# LANGUAGE TypeOperators #-}\n\ntype API = \n    \"books\" :> Get '[JSON]
  [Book]\n    :<|> \"view-my-referer\" :> Header \"from\" Referer :> Get '[JSON] Referer\n
  \   :<|> \"users\" :> Capture \"userId\" Integer :> ReqBody '[JSON] User :> Put
  '[JSON] User\n    :<|> \"post\" :> QueryParam \"segments\" Text :> Get '[JSON] Post\n
  \   :<|> Raw\n\ngenerator :: Generator API\nlet generator =\n    (\"books\", 1)\n
  \   :|: arbitrary :>: (\"referer\", 2)\n    :|: pure 1001 :>: arbitrary :>: (\"users
  endpoint\", 2)\n    :|: elements [\"title\", \"contents\", \"post\"] :>: (\"post\",
  4)\n    :|: (\"raw\", 0)\n````\n\nThe first endpoint \"books\" does not require
  request data and so only the name / weight tuple is\nprovided.\n\nThe \"view-my-referer\"
  endpoint requires a \"from\" header with an accompanying `Referer` value. Here\nwe
  assume `Referer` has an `Arbitrary` instance to provide a random value. The endpoint
  generator\nfinishes with the name/weight indication.\n\nThe \"users\" endpoint requires
  two different request values. An Integer capture representing a user\nid as well
  as a `User` value. We hard-code the user id to `1001` using the monadic `pure` and
  assume that\n`User` has an `Arbitrary` instance to produce a random value. We finish
  with the endpoint's name/weight as necessary.\n\nThe \"post\" endpoint requires
  a `Text` query parameter. We provide a fixed set of possible values\nusing the `elements`
  function from the `QuickCheck` package. With a weight of 4, four instances of\nthe
  \"post\" endpoint will be produced, each with a random value from the specified
  set.\n\nFinally our API provides a `Raw` endpoint for serving static files, but
  we'd rather not benchmark\nit. Providing a 0 weight ensures that no request will
  be generated \n\n### Basic Auth\n\nA generator for an endpoint using a `BasicAuth`
  combinator requires both a function to convert the\nrequested user data type to
  `BasicAuthData` as well as a `Gen` value for the requested user data. \n\nexample:\n\n````haskell\ntype
  privateAPI = \"private\" :> BasicAuth \"foo-realm\" User :> PrivateAPI\n\ntoBasicAuthData
  :: User -> BasicAuthData\ntoBasicAuthData user = ... \n\n-- assuming `User` has
  an `Arbitrary` instance\nlet generator = toBasicAuthData :>: arbitrary :>: (\"basicAuth\",
  1)\n````\n\nThe information will be encoded as an `Authorization` header.\n\n##
  Supported tools\n\nThe following benchmarking tools are supported :\n\n- [wrk](https://github.com/wg/wrk)\n-
  [Drill](https://github.com/fcsonline/drill)\n- [Siege](src/Servant/Benchmark/Tools/Siege.hs)\n\nIf
  you'd like your favorite tool to be supported, don't hesitate to tell me so in an
  issue,\nor better yet submit a PR.\n\n## Next steps\n\n* Provide support for *servant-auth*
  combinators\n* Expand the support for benchmarking frameworks\n"
license-name: BSD-3-Clause

{'fraction_non_alphanumeric': 0.12872870988990306, 'fraction_numerical': 0.016467488472758068, 'mean_word_length': 3.592912705272256, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 55, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3933130', 'n_tokens_mistral': 3619, 'n_tokens_neox': 3466, 'n_words': 1224}