Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document k6/experimental/fs module #1419

Merged
merged 11 commits into from
Nov 29, 2023
Merged

Document k6/experimental/fs module #1419

merged 11 commits into from
Nov 29, 2023

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Nov 20, 2023

The k6/experimental/fs module will land in v0.48.0 and will empower users to read files efficiently and conveniently within their k6 scripts.

This Pull Request documents the module's APIs.

Copy link
Contributor

@codebien codebien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oleiade does it work make docs for you? I wasn't able to see the preview with the current changes included.

@oleiade
Copy link
Member Author

oleiade commented Nov 21, 2023

@codebien make docs does work on my side, what error are you experiencing?

$ cd docs/

$ make docs
docker pull -q grafana/docs-base:latest
docker.io/grafana/docs-base:latest
/Users/theocrevon/Dev/grafana/documentation/k6-docs/docs/make-docs k6:UNVERSIONED:k6-docs
node scripts/docs/versions.js
k6 -> v0.47.x
/usr/local/bin/hugo server --environment=docs -p 3003 --buildDrafts=false --buildFuture=false --bind 0.0.0.0 --noHTTPCache --minify --poll 700ms --renderToDisk -d dist | grep -Ev 'REF_NOT_FOUND: Ref "/(go|blog)/'
Start building sites …
hugo v0.115.2 linux/arm64 BuildDate=unknown


                   |  EN  |  DE  |  FR  |  ES  | PT-BR | ZH-CN
-------------------+------+------+------+------+-------+--------
  Pages            | 2328 |   12 |   12 |   12 |    12 |    12
  Paginator pages  |    0 |    0 |    0 |    0 |     0 |     0
  Non-page files   |    0 |    0 |    0 |    0 |     0 |     0
  Static files     | 1274 | 1274 | 1274 | 1274 |  1274 |  1274
  Processed images |    0 |    0 |    0 |    0 |     0 |     0
  Aliases          |    4 |    0 |    0 |    0 |     0 |     0
  Sitemaps         |    2 |    1 |    1 |    1 |     1 |     1
  Cleaned          |    0 |    0 |    0 |    0 |     0 |     0

Built in 2541 ms
Watching for changes in /hugo/{content,data,i18n,layouts,package.json,static}
Use watcher with poll interval 700ms
Watching for config changes in /hugo/config/_default, /hugo/config/docs
Environment: "docs"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender

View documentation locally:
                             http://localhost:3002/docs/k6/

                                                           Press Ctrl+C to stop the server

oleiade and others added 2 commits November 21, 2023 09:41
Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com>
oleiade and others added 2 commits November 21, 2023 12:38
Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com>
@olegbespalov olegbespalov mentioned this pull request Nov 23, 2023
48 tasks
Copy link
Collaborator

@heitortsergent heitortsergent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, mostly small nits!

docs/sources/next/javascript-api/k6-experimental/_index.md Outdated Show resolved Hide resolved

In the following example, we open a file and read it in chunks of 128 bytes until we reach the end of the file.

{{< code >}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a comment, the {{< code >}} shortcode main purpose is to support multiple code snippets (how to do X in JavaScript, and in Ruby, for example). It still works if you have a single code snippet inside of it, but we don't necessarily need it here. 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's good to know! I think it still makes sense to have it even with a single example? Makes it more explicit too as it will display "Javascript" above the code right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still get the "JavaScript" title even without the code shortcode. (I wasn't sure about it so I tested it out 😆). The only UI difference seems to be the underline in the shortcode version.

Screenshot 2023-11-28 at 2 29 02 PM

oleiade and others added 2 commits November 28, 2023 09:45
Co-authored-by: Heitor Tashiro Sergent <heitortsergent@gmail.com>
Co-authored-by: Heitor Tashiro Sergent <heitortsergent@gmail.com>
@oleiade oleiade merged commit 78a4d62 into main Nov 29, 2023
6 checks passed
@oleiade oleiade deleted the experimental/fs-module branch November 29, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants