Skip to content

Commit 6ff1d21

Browse files
committed
Documentation: Publish docs to https://tsperf.readthedocs.io/
- Refactoring - Polishing - Wording - Layout
1 parent e4ba40e commit 6ff1d21

23 files changed

+512
-224
lines changed

.readthedocs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
4+
# Details
5+
# - https://docs.readthedocs.io/en/stable/config-file/v2.html
6+
7+
# Required
8+
version: 2
9+
10+
build:
11+
os: "ubuntu-22.04"
12+
tools:
13+
python: "3.11"
14+
15+
python:
16+
install:
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- docs
21+
22+
sphinx:
23+
configuration: docs/conf.py
24+
builder: html
25+
fail_on_warning: true
26+
27+
# Optionally build your docs in additional formats such as PDF
28+
#formats:
29+
# - pdf

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
## Unreleased
4+
5+
## 2021/05/17 1.1.0
6+
- Refactoring

README.md

Lines changed: 42 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,38 @@ in the spirit of TimescaleDB's Time Series Benchmark Suite (TSBS).
2323

2424
## About
2525

26-
The `tsperf` program is a database workload generator including two different domains,
27-
one for writing data and another one for reading.
26+
The `tsperf` program includes both a database workload generator, and a query
27+
timer. That effectively spans two domains, one for writing data, and another
28+
one for reading.
2829

29-
- [Data generator]: Generate time series data and feed it into database.
30+
- [Data Generator]: Generate time series data and feed it into database.
3031
Use `tsperf write --help` to explore its options.
31-
- [Query timer]: Probe responsiveness of database on the read path.
32+
- [Query Timer]: Probe responsiveness of database on the read path.
3233
Use `tsperf read --help` to explore its options.
3334

3435
For the purpose of capacity testing, both domains try to simulate the generation and querying of
3536
time-series data. As the program is easy to use, it provides instant reward without the need to
3637
set up a whole data ingestion chain.
3738

38-
[Data generator]: tsperf/write/README.md
39-
[Query timer]: tsperf/read/README.md
40-
4139

4240
## Features
4341

42+
### General
4443
* Generate random data which follows a statistical model to better reflect real world scenarios,
4544
real world data is almost never truly random.
4645
* The "steady load"-mode can simulate a constant load of a defined number of messages per second.
4746
* Ready-made to deploy and scale data generators with Docker containers. In order to maximize
48-
performance, multiple instances of the Data Generator can be run in parallel.
49-
This can be achieved by [using Kubernetes](KUBERNETES.md).
47+
performance, multiple instances of the data generator can be run in parallel.
48+
This can be achieved by [parallelizing using Kubernetes].
5049
* Metrics are exposed for consumption by Prometheus.
51-
* Data generator features
52-
* Easy to define your own [schema](tsperf/write/README.md#data-generator-schemas).
53-
* Full control on how many values will be inserted.
54-
* Scale out to multiple clients is a core concept.
55-
* Huge sets of data can be inserted without creating files as intermediate storage.
5650

57-
### Supported databases
51+
### Data Generator
52+
* Capability to [define your own schema].
53+
* Full control on how many values will be inserted.
54+
* Scale out to multiple clients is a core concept.
55+
* Huge sets of data can be inserted without creating files as intermediate storage.
56+
57+
### Database Coverage
5858
* CrateDB
5959
* InfluxDB
6060
* Microsoft SQL Server
@@ -64,20 +64,6 @@ set up a whole data ingestion chain.
6464
* Timestream
6565

6666

67-
## Prior art
68-
69-
### TSBS
70-
The [Time Series Benchmark Suite (TSBS)] is a collection of Go programs that are used to generate
71-
datasets and then benchmark read and write performance of various databases.
72-
73-
### cr8 + mkjson
74-
`mkjson` combined with `cr8 insert-json` makes it easy to generate random entries into a table.
75-
See [generate data sets using mkjson] for an example how to use `cr8` together with `mkjson`.
76-
77-
[generate data sets using mkjson]: https://zignar.net/2020/05/01/generating-data-sets-using-mkjson/
78-
[Time Series Benchmark Suite (TSBS)]: https://github.com/timescale/tsbs
79-
80-
8167
## Install
8268

8369
### Python package
@@ -87,190 +73,54 @@ pip install --user tsperf
8773

8874
### Docker image
8975
```shell
90-
docker run -it --rm --network=host tsperf tsperf write --help
76+
alias tsperf="docker run -it --rm --network=host tsperf tsperf"
77+
tsperf --help
9178
```
9279

93-
9480
## Usage
9581

96-
This section outlines the usage of `tsperf` on different databases. Please note that using Docker
97-
here is just for demonstration purposes. In reality, you will want to run the database workload
98-
against a database instance running on a decently powered machine.
99-
100-
- For increasing concurrency, try `--concurrency=8`.
101-
- For enabling Prometheus metrics export, try `--prometheus-enable=true` and maybe `--prometheus-listen=0.0.0.0:8000`.
102-
- For increasing concurrency and number of iterations when querying, try `--concurrency=10 --iterations=2000`.
103-
- For displaying the list of built-in schemas, run `tsperf schema --list`.
104-
105-
106-
### CrateDB
107-
```shell
108-
# Run CrateDB
109-
docker run -it --rm --publish=4200:4200 --publish=5432:5432 crate:4.5.1
110-
111-
# Feed data into CrateDB table.
112-
# Adjust write parameters like `--partition=day --shards=6 --replicas=3`.
113-
tsperf write --adapter=cratedb --schema=tsperf.schema.basic:environment.json
114-
tsperf write --schema=tsperf.schema.basic:environment.json --adapter=cratedb --address=cratedb.example.org:4200
115-
116-
# Use Docker.
117-
docker run -it --rm --network=host tsperf tsperf write --schema=tsperf.schema.basic:environment.json --adapter=cratedb
118-
119-
# Query data from CrateDB table.
120-
tsperf read --adapter=cratedb --query="SELECT * FROM environment LIMIT 10;"
121-
```
122-
123-
### CrateDB+PostgreSQL
124-
```shell
125-
# Run CrateDB workload via PostgreSQL protocol.
126-
tsperf write --adapter=cratedbpg --schema=tsperf.schema.basic:environment.json
127-
tsperf read --adapter=cratedbpg --iterations=3000 --query="SELECT * FROM environment LIMIT 10;"
128-
129-
# Run PostgreSQL workload on CrateDB.
130-
tsperf write --adapter=postgresql --schema=tsperf.schema.basic:environment.json
131-
tsperf read --adapter=postgresql --username=crate --iterations=3000 --query="SELECT * FROM environment LIMIT 10;"
132-
```
133-
134-
135-
### InfluxDB
136-
```shell
137-
# Run and configure InfluxDB
138-
docker run -it --rm --publish=8086:8086 influxdb:2.0
139-
influx setup --name=default --username=root --password=12345678 --org=acme --bucket=environment --retention=0 --force
140-
cat /Users/amo/.influxdbv2/configs
141-
142-
# Configure tsperf
143-
export ADAPTER=influxdb
144-
export ADDRESS=http://localhost:8086/
145-
export INFLUXDB_ORGANIZATION=acme
146-
export INFLUXDB_TOKEN="X1kHPaXvS...p1IAQ=="
147-
148-
# Feed data into InfluxDB bucket.
149-
tsperf write --schema=tsperf.schema.basic:environment.json
150-
151-
# Query data from InfluxDB bucket.
152-
tsperf read --query='from(bucket:"environment") |> range(start:-2h, stop:2h) |> limit(n: 10)'
153-
```
154-
155-
On InfluxDB Cloud, after generating an "All Access Token", configure `tsperf` like:
156-
```shell
157-
export ADAPTER=influxdb
158-
export ADDRESS="https://eu-central-1-1.aws.cloud2.influxdata.com/"
159-
export INFLUXDB_ORGANIZATION=a05test6edtest2d
160-
export INFLUXDB_TOKEN="wpNtestfeNUveYitDLk8Ld47vrSVUTKB_vEaEwWC7qXj_ZqvOwYCRhQTB4EDty3uLFMXWP2C195gtestt4XGFQ=="
161-
```
162-
163-
164-
### Microsoft SQL Server
165-
```shell
166-
# Run Microsoft SQL Server
167-
docker run -it --rm --publish=1433:1433 --env="ACCEPT_EULA=Y" --env="SA_PASSWORD=yayRirr3" mcr.microsoft.com/mssql/server:2019-latest
168-
docker exec -it aeba7fdd4d73 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P yayRirr3 -Q "select @@Version"
169-
170-
# Install the Microsoft ODBC driver for SQL Server
171-
- Visit: https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server
82+
Please refer to the [usage] documentation.
17283

173-
# Configure tsperf
174-
export ADAPTER=mssql
17584

176-
# Feed data into MSSQL table.
177-
tsperf write --schema=tsperf.schema.basic:environment.json
85+
## Prior Art
17886

179-
# Query data from MSSQL table.
180-
tsperf read --iterations=3000 --query="SELECT TOP 10 * FROM environment;"
181-
```
182-
183-
184-
### MongoDB
185-
```shell
186-
# Run and configure MongoDB
187-
docker run -it --rm --publish=27017:27017 mongo:4.4
188-
189-
# Feed data into MongoDB collection.
190-
tsperf write --adapter=mongodb --schema=tsperf.schema.basic:environment.json
191-
192-
# Query data from MongoDB collection.
193-
tsperf read --adapter=mongodb --schema=tsperf.schema.basic:environment.json
194-
195-
# For connecting to MongoDB Atlas, use:
196-
export ADDRESS="mongodb+srv://username:[email protected]/tsperf?retryWrites=true&w=majority"
197-
```
198-
199-
200-
### PostgreSQL
201-
```shell
202-
# Run PostgreSQL
203-
docker run -it --rm --env="POSTGRES_HOST_AUTH_METHOD=trust" --publish=5432:5432 postgres:13.3
204-
205-
# Configure tsperf
206-
export ADAPTER=postgresql
207-
208-
# Feed data into PostgreSQL table.
209-
tsperf write --schema=tsperf.schema.basic:environment.json
210-
211-
# Query data from PostgreSQL table.
212-
tsperf read --iterations=3000 --query="SELECT * FROM environment LIMIT 10;"
213-
```
214-
215-
216-
### TimescaleDB
217-
```shell
218-
# Run TimescaleDB
219-
docker run -it --rm --env="POSTGRES_HOST_AUTH_METHOD=trust" --publish=5432:5432 timescale/timescaledb:2.3.0-pg13
220-
221-
# Configure tsperf
222-
export ADAPTER=timescaledb
223-
224-
# Feed data into TimescaleDB hypertable.
225-
# Adjust write parameters like `--timescaledb-distributed --timescaledb-pgcopy`.
226-
tsperf write --schema=tsperf.schema.basic:environment.json
227-
228-
# Query data from TimescaleDB hypertable.
229-
tsperf read --iterations=3000 --query="SELECT * FROM environment LIMIT 10;"
230-
```
231-
232-
233-
### Timestream
234-
```shell
235-
# Run Timestream
236-
237-
# There is no way to run Amazon Timestream on premises.
238-
# - https://aws.amazon.com/timestream/
239-
# - https://docs.aws.amazon.com/timestream/
240-
241-
# Configure tsperf
242-
export ADAPTER=timestream
243-
export ADDRESS=ingest-cell1.timestream.us-west-2.amazonaws.com
244-
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
245-
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
246-
export AWS_REGION_NAME=us-west-2
87+
### cr8 + mkjson
88+
`mkjson` combined with `cr8 insert-json` makes it easy to generate random entries into a table.
89+
See [generate data sets using mkjson] for an example how to use `cr8` together with `mkjson`.
24790

248-
# Feed data into Timestream table.
249-
tsperf write --schema=tsperf.schema.basic:environment.json
91+
### TSBS
92+
The [Time Series Benchmark Suite (TSBS)] is a collection of Go programs that are used to generate
93+
datasets and then benchmark read and write performance of various databases.
25094

251-
# Query data from Timestream table.
252-
tsperf read --iterations=3000 --query="SELECT * FROM environment LIMIT 10;"
253-
```
25495

96+
## Project Information
25597

256-
## Contributing
257-
We are always happy to receive code contributions, ideas, suggestions and problem reports from the community.
98+
### Contributing
99+
We are always happy to receive code contributions, ideas, suggestions and
100+
problem reports from the community.
258101

259-
So, if you’d like to contribute you’re most welcome. Spend some time taking a look around, locate a bug, design
260-
issue or spelling mistake and then send us a pull request or open an issue on GitHub.
102+
So, if you’d like to contribute you’re most welcome. Spend some time taking
103+
a look around, locate a bug, design issue or spelling mistake and then send
104+
us a pull request or open an issue on GitHub.
261105

262106
Thanks in advance for your efforts, we really appreciate any help or feedback.
263107

264-
265-
## Acknowledgements
108+
### Acknowledgements
266109
Thanks to all the contributors who helped to co-create and conceive `tsperf`
267110
in one way or another and kudos to all authors of the foundational libraries.
268111

269-
270-
## License
112+
### License
271113
This project is licensed under the terms of the Apache 2.0 license.
272114

273115

116+
[Data Generator]: https://tsperf.readthedocs.io/data-generator.html
117+
[define your own schema]: https://tsperf.readthedocs.io/data-generator.html#data-generator-schemas
118+
[generate data sets using mkjson]: https://zignar.net/2020/05/01/generating-data-sets-using-mkjson/
119+
[parallelizing using Kubernetes]: https://tsperf.readthedocs.io/performance.html
120+
[Query Timer]: https://tsperf.readthedocs.io/query-timer.html
121+
[Time Series Benchmark Suite (TSBS)]: https://github.com/timescale/tsbs
122+
[Usage]: https://tsperf.readthedocs.io/usage.html
123+
274124
[Changelog]: https://github.com/crate/tsperf/blob/main/CHANGES.md
275125
[Documentation]: https://tsperf.readthedocs.io/
276126
[Issues]: https://github.com/crate/tsperf/issues

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/_build

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/.gitkeep

Whitespace-only changes.

docs/_templates/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)