Skip to content

Commit

Permalink
chore: add zh and en docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liukj committed Jan 16, 2025
1 parent 6595b93 commit 0c7ab24
Show file tree
Hide file tree
Showing 14 changed files with 561 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/public/
/resources/
/themes/
/config.bak
54 changes: 54 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
SHELL=/bin/bash

# Basic info
PRODUCT?= $(shell basename "$(shell cd .. && pwd)")
BRANCH?= main
VERSION?= $(shell [[ "$(BRANCH)" == "main" ]] && echo "main" || echo "$(BRANCH)")
CURRENT_VERSION?= $(VERSION)
VERSIONS?= "main"
OUTPUT?= "/tmp/docs"
THEME_FOLDER?= "themes/book"
THEME_REPO?= "https://github.com/infinilabs/docs-theme.git"
THEME_BRANCH?= "main"

.PHONY: docs-build

default: docs-build

docs-init:
@if [ ! -d $(THEME_FOLDER) ]; then echo "theme does not exist";(git clone -b $(THEME_BRANCH) $(THEME_REPO) $(THEME_FOLDER) ) fi

docs-env:
@echo "Debugging Variables:"
@echo "PRODUCT: $(PRODUCT)"
@echo "BRANCH: $(BRANCH)"
@echo "VERSION: $(VERSION)"
@echo "CURRENT_VERSION: $(CURRENT_VERSION)"
@echo "VERSIONS: $(VERSIONS)"
@echo "OUTPUT: $(OUTPUT)"

docs-config: docs-init
cp config.yaml config.bak
# Detect OS and apply the appropriate sed command
@if [ "$$(uname)" = "Darwin" ]; then \
echo "Running on macOS"; \
sed -i '' "s/BRANCH/$(VERSION)/g" config.yaml; \
else \
echo "Running on Linux"; \
sed -i 's/BRANCH/$(VERSION)/g' config.yaml; \
fi

docs-build: docs-config
hugo --minify --theme book --destination="$(OUTPUT)/$(PRODUCT)/$(VERSION)" \
--baseURL="/$(PRODUCT)/$(VERSION)"
@$(MAKE) docs-restore-generated-file

docs-serve: docs-config
hugo serve
@$(MAKE) docs-restore-generated-file

docs-place-redirect:
echo "<!DOCTYPE html> <html> <head> <meta http-equiv=refresh content=0;url=main /> </head> <body> <p><a href=main />REDIRECT TO THE LATEST_VERSION</a>.</p> </body> </html>" > $(OUTPUT)/$(PRODUCT)/index.html

docs-restore-generated-file:
mv config.bak config.yaml
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

97 changes: 97 additions & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# VERSIONS=latest,v1.0 hugo --minify --baseURL="/product/v1.0/" -d public/product/v1.0

title: INFINI Loadgen
theme: book

# Book configuration
disablePathToLower: true
enableGitInfo: false

# Needed for mermaid/katex shortcodes
markup:
goldmark:
renderer:
unsafe: true
tableOfContents:
startLevel: 1

# Multi-lingual mode config
# There are different options to translate files
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
defaultContentLanguage: zh
languages:
zh:
languageName: 简体中文
contentDir: content.zh
weight: 3
en:
languageName: English
contentDir: content.en
weight: 4


menu:
before: []
after:
- name: "Github"
url: "https://github.com/infinilabs/loadgen"
weight: 10

params:
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme: "auto"

# (Optional, default true) Controls table of contents visibility on right side of pages.
# Start and end levels can be controlled with markup.tableOfContents setting.
# You can also specify this parameter per page in front matter.
BookToC: true

# (Optional, default none) Set the path to a logo for the book. If the logo is
# /static/logo.png then the path would be logo.png
BookLogo: img/logo

# (Optional, default none) Set leaf bundle to render as side menu
# When not specified file structure and weights will be used
# BookMenuBundle: /menu

# (Optional, default docs) Specify root page to render child pages as menu.
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
BookSection: docs

# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
BookRepo: https://github.com/infinilabs/loadgen

# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Edit path must point to root directory of repo.
BookEditPath: edit/BRANCH/docs

# Configure the date format used on the pages
# - In git information
# - In blog posts
BookDateFormat: "January 2, 2006"

# (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website.
# Configuration for indexing can be adjusted in i18n folder per language.
BookSearch: false

# (Optional, default true) Enables comments template on pages
# By default partals/docs/comments.html includes Disqus template
# See https://gohugo.io/content-management/comments/#configure-disqus
# Can be overwritten by same param in page frontmatter
BookComments: false

# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks: true

# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker: false
5 changes: 5 additions & 0 deletions docs/content.en/docs/getting-started/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
weight: 10
title: Getting Started
bookCollapseSection: true
---
31 changes: 31 additions & 0 deletions docs/content.en/docs/getting-started/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
weight: 10
title: Installing the Loadgen
asciinema: true
---

# Installing the Loadgen

INFINI Loadgen supports mainstream operating systems and platforms. The program package is small, with no extra external dependency. So, the loadgen can be installed very rapidly.

## Downloading

**Automatic install**

```bash
curl -sSL http://get.infini.cloud | bash -s -- -p loadgen
```

> The above script can automatically download the latest version of the corresponding platform's loadgen and extract it to /opt/loadgen
> The optional parameters for the script are as follows:
> &nbsp;&nbsp;&nbsp;&nbsp;_-v [version number](Default to use the latest version number)_
> &nbsp;&nbsp;&nbsp;&nbsp;_-d [installation directory] (default installation to /opt/loadgen)_
**Manual install**

Select a package for downloading in the following URL based on your operating system and platform:

[https://release.infinilabs.com/loadgen/](https://release.infinilabs.com/loadgen/)
118 changes: 118 additions & 0 deletions docs/content.en/docs/release-notes/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
weight: 80
title: "Release Notes"
---

# Release Notes

Information about release notes of INFINI Loadgen is provided here.

## 1.28.0 (2025-01-11)

### Improvements

- Synchronize updates for known issues fixed in the Framework.

## 1.27.0 (2024-12-13)

### Improvements

- The code is open source, and Github [repository](https://github.com/infinilabs/loadgen) is used for development.
- Keep the same version number as INFINI Console.
- Synchronize updates for known issues fixed in the Framework.

### Bug fix

- Fix the abnormal problem of the API interface testing logic.

## 1.26.1 (2024-08-13)

### Improvements

- Keep the same version number as INFINI Console.
- Synchronize updates for known issues fixed in the Framework.

## 1.26.0 (2024-06-07)

### Improvements

- Keep the same version number as INFINI Console.
- Synchronize updates for known issues fixed in the Framework.

## 1.25.0 (2024-04-30)

### Improvements

- Keep the same version number as INFINI Console.
- Synchronize updates for known issues fixed in the Framework.

## 1.24.0 (2024-04-15)

### Improvements

- Keep the same version number as INFINI Console.
- Synchronize updates for known issues fixed in the Framework.

## 1.22.0 (2024-01-26)

### Improvements

- Unified version number with INFINI Console

## 1.8.0 (2023-11-02)

### Breaking changes

- The original Loadrun function is incorporated into Loadgen.
- Test the requests, assertions, etc. that is configured using the new Loadgen DSL syntax.

## 1.7.0 (2023-04-20)

### Breaking changes

- The variables with the same `name` are no longer allowed to be defined in `variables`.

### Features

- Add the `log_status_code` configuration to support printing request logs of specific status codes.

## 1.6.0 (2023-04-06)

### Breaking ghanges

- The `file` type variable by default no longer escapes the `"` and `\` characters. Use the `replace` function to manually set variable escaping.

### Features

- The variable definition adds an optional `replace` option, which is used to escape characters such as `"` and `\`.

### Improvements

- Optimize memory usage.

### Bug fix

- Fix the problem that the `\n` cannot be used in the YAML strings.
- Fix the problem that invalid assert configurations are ignored.

## 1.5.1

### Bug fix

- [DOC] Fix invalid variable grammar in `loadgen.yml`.

## 1.5.0

### Features

- Added `assert` configuration, support testing response data.
- Added `register` configuration, support registering dynamic variables.
- Added `env` configuration, support loading and using environment variables in `loadgen.yml`.
- Support using dynamic variables in the `headers` configuration.

### Improvements

- `-l` option: precisely control the number of requests to send.
- Added `runner.no_warm` to skip warm-up stage.

### Bug fix
6 changes: 6 additions & 0 deletions docs/content.en/menu/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
headless: true
---

- [**Documentation**]({{< relref "/docs/" >}})
<br />
5 changes: 5 additions & 0 deletions docs/content.zh/docs/getting-started/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
weight: 10
title: 入门指南
bookCollapseSection: true
---
31 changes: 31 additions & 0 deletions docs/content.zh/docs/getting-started/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
weight: 10
title: 下载安装
asciinema: true
---

# 安装 INFINI Loadgen

INFINI Loadgen 支持主流的操作系统和平台,程序包很小,没有任何额外的外部依赖,安装起来应该是很快的 :)

## 下载安装

**自动安装**

```bash
curl -sSL http://get.infini.cloud | bash -s -- -p loadgen
```

> 通过以上脚本可自动下载相应平台的 loadgen 最新版本并解压到/opt/loadgen
> 脚本的可选参数如下:
> &nbsp;&nbsp;&nbsp;&nbsp;_-v [版本号](默认采用最新版本号)_
> &nbsp;&nbsp;&nbsp;&nbsp;_-d [安装目录](默认安装到/opt/loadgen)_
**手动安装**

根据您所在的操作系统和平台选择下面相应的下载地址:

[https://release.infinilabs.com/loadgen/](https://release.infinilabs.com/loadgen/)
Loading

0 comments on commit 0c7ab24

Please sign in to comment.