Skip to content

Commit ec7d00c

Browse files
committed
Adjust documentation
Former-commit-id: 7062769
1 parent b5d8132 commit ec7d00c

File tree

5 files changed

+43
-44
lines changed

5 files changed

+43
-44
lines changed

DATA_GENERATOR.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The Data Generator is a tool to generate timeseries data which adheres to a [sta
8686

8787
An easy way to use the Data Generator is to install it via `pip`:
8888

89-
+ Open a terminal and type `pip install tsdb-data-generator`
89+
+ Open a terminal and type `pip install tsdg`
9090
+ Look at the default configuration of the Data Generator by executing `tsdg -h` in a terminal
9191
+ Run the Data Generator with the desired configuration values by executing `tsdg` in a terminal
9292

LICENSE

-25
Original file line numberDiff line numberDiff line change
@@ -175,28 +175,3 @@
175175
of your accepting any such warranty or additional liability.
176176

177177
END OF TERMS AND CONDITIONS
178-
179-
APPENDIX: How to apply the Apache License to your work.
180-
181-
To apply the Apache License to your work, attach the following
182-
boilerplate notice, with the fields enclosed by brackets "[]"
183-
replaced with your own identifying information. (Don't include
184-
the brackets!) The text should be enclosed in the appropriate
185-
comment syntax for the file format. We also recommend that a
186-
file or class name and description of purpose be included on the
187-
same "printed page" as the copyright notice for easier
188-
identification within third-party archives.
189-
190-
Copyright [yyyy] [name of copyright owner]
191-
192-
Licensed under the Apache License, Version 2.0 (the "License");
193-
you may not use this file except in compliance with the License.
194-
You may obtain a copy of the License at
195-
196-
http://www.apache.org/licenses/LICENSE-2.0
197-
198-
Unless required by applicable law or agreed to in writing, software
199-
distributed under the License is distributed on an "AS IS" BASIS,
200-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201-
See the License for the specific language governing permissions and
202-
limitations under the License.

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![tag_build_and_push](https://github.com/crate/ts-data-generator/workflows/tag_build_and_push/badge.svg?branch=master) ![code_quality](https://github.com/crate/ts-data-generator/workflows/code_quality/badge.svg)
1+
![Tests](https://github.com/crate/tsdg/workflows/Tests/badge.svg)
22

33
# Data Generator
44

@@ -9,3 +9,11 @@ data, without the need to set up an ingestion chain (which could be Azure IoTHub
99
## Maximizing Performance
1010

1111
To maximize performance multiple instances of the Data Generator must be run in parallel. One way to achieve this is using kubernetes how to do this is documented [here](KUBERNETES.md).
12+
13+
## Setup sandbox
14+
```shell
15+
python3 -m venv .venv
16+
source .venv/bin/activate
17+
pip install --editable=.[testing]
18+
pytest -vvv tests
19+
```

QUERY_TIMER.md renamed to query_timer/README.md

+31-15
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ The Query Timer is a tool to run queries against different databases and determi
1212

1313
#### Pip install
1414

15-
The Query Timer is part of the tsdb-data-generator package and can be installed using `pip install tsdb-data-generator`.
15+
The Query Timer is part of the tsdb-data-generator package and can be installed using `pip install tsdg`.
1616

17-
By calling `tsqt -h` the possible configurations are listed. For further details see [Query Timer Configuration](#query-timer-configuration). All configurations can be done with either command line arguments or environment variables but when both are set then command line arguments will be used.
17+
By calling `tsqt -h` the possible configurations are listed. For further details see
18+
[Query Timer Configuration](#query-timer-configuration). All configurations can be done with either command line
19+
arguments or environment variables but when both are set then command line arguments will be used.
1820

19-
When calling `tsqt` with the desired arguments the Query Timer outputs live updated statistics on the query execution. This includes:
21+
When calling `tsqt` with the desired arguments the Query Timer outputs live updated statistics on the query execution.
22+
This includes:
2023

2124
+ concurrency: how many threads are running, defined by [CONCURRENCY](#concurrency)
2225
+ iterations: how many queries will be done in each thread, defined by [ITERATIONS](#iterations)
@@ -48,7 +51,8 @@ Currently 7 Databases are
4851

4952
##### Client Library
5053

51-
For CrateDB the [crate](https://pypi.org/project/crate/) library is used. To connect to CrateDB the following environment variables must be set:
54+
For CrateDB the [crate](https://pypi.org/project/crate/) library is used. To connect to CrateDB the following
55+
environment variables must be set:
5256

5357
+ [HOST](#host): hostname including port e.g. `localhost:4200`
5458
+ [USERNAME](#username): CrateDB username.
@@ -58,7 +62,8 @@ For CrateDB the [crate](https://pypi.org/project/crate/) library is used. To con
5862

5963
##### Client Library
6064

61-
For InfluxDB the [influx-client](https://pypi.org/project/influxdb-client/) library is used as the Data Generator only supports InfluxDB V2. To connect to InfluxDB the following environment variables must be set:
65+
For InfluxDB the [influx-client](https://pypi.org/project/influxdb-client/) library is used as the Data Generator only
66+
supports InfluxDB V2. To connect to InfluxDB the following environment variables must be set:
6267

6368
+ [HOST](#host): hostname
6469
+ [TOKEN](#token): InfluxDB Read/Write token
@@ -86,7 +91,8 @@ To connect with TimescaleDB the following environment variables must be set:
8691

8792
##### Client Library
8893

89-
For MongoDB the [MongoClient](https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html) library is used.
94+
For MongoDB the [MongoClient](https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html) library is
95+
used.
9096

9197
To connect with MongoDB the following environment variables must be set:
9298

@@ -97,7 +103,8 @@ To connect with MongoDB the following environment variables must be set:
97103

98104
##### Specifics
99105

100-
Because `pymongo` does not support queries as string, Support for MongoDB is turned of in the binary. To still use the Query Timer with Mongo DB have a look at the [Using MongoDB](#using-mongodb) section of this documentation.
106+
Because `pymongo` does not support queries as string, Support for MongoDB is turned of in the binary. To still use the
107+
Query Timer with Mongo DB have a look at the [Using MongoDB](#using-mongodb) section of this documentation.
101108

102109
#### PostgreSQL
103110

@@ -128,7 +135,8 @@ To connect with AWS Timestream the following environment variables must be set:
128135

129136
##### Specifics
130137

131-
+ Tests have shown that queries often fail due to server errors. To accommodate this an automatic retry is implemented that tries to execute the query a second time. If it fails again the query is marked as failure.
138+
+ Tests have shown that queries often fail due to server errors. To accommodate this an automatic retry is implemented
139+
that tries to execute the query a second time. If it fails again the query is marked as failure.
132140

133141
#### Microsoft SQL Server
134142

@@ -146,21 +154,24 @@ To connect with Microsoft SQL Server the following environment variables must be
146154

147155
### Using MongoDB
148156

149-
To use the Query Timer with MongoDB the code of the Query Timer needs to be changed. Therefore checkout this [repository](https://www.github.com/crate/ts-data-generator).
157+
To use the Query Timer with MongoDB the code of the Query Timer needs to be changed. Therefore checkout this
158+
[repository](https://www.github.com/crate/tsdg).
150159

151160
+ In [this](query_timer/__main__.py) file uncomment the import statement of the `MongoDBWriter`
152161
+ Also uncomment the instantiation of the `db_writer` in the `get_db_writer` function
153162
+ Comment the `ValueError` in the line above
154163

155164
This should let you start the Query Timer using `DATABASE` set to MongoDB.
156165

157-
To add the query you want to measure add a variable containing your query to the script and pass this variable to `db_writer.execute_query()` in the `start_query_run` function, instead of `config.query`.
166+
To add the query you want to measure add a variable containing your query to the script and pass this variable to
167+
`db_writer.execute_query()` in the `start_query_run` function, instead of `config.query`.
158168

159169
Now the Query Timer is able to measure query execution times for MongoDB.
160170

161171
## Query Timer Configuration
162172

163-
The Query Timer is mostly configured by setting Environment Variables (or command line arguments start with `-h` for more information). This chapter lists all available Environment Variables and explains their use in the Query Time.
173+
The Query Timer is mostly configured by setting Environment Variables (or command line arguments start with `-h` for
174+
more information). This chapter lists all available Environment Variables and explains their use in the Query Time.
164175

165176
### Environment variables configuring the behaviour of the Query Time
166177

@@ -288,7 +299,8 @@ Default: empty string
288299
used with TimescaleDB, MongoDB, AWS Timestream, Postgresql, MSSQL.
289300

290301
**TimescaleDB, Postgresql, MSSQL:**
291-
The value of `DB_NAME` is used when connecting to TimescaleDB. This database must already exist in your TimescaleDB instance and must have already been initialized with `CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;`.
302+
The value of `DB_NAME` is used when connecting to TimescaleDB. This database must already exist in your TimescaleDB
303+
instance and must have already been initialized with `CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;`.
292304

293305
**MongoDB:**
294306
The value of `DB_NAME` is used as the database parameter of MongoDB.
@@ -362,11 +374,14 @@ Default: empty string
362374

363375
## Alternative Query Timers
364376

365-
As the Query Timer is just a by-product of the Data Generator there are other alternatives that offer more features and ways to time queries. The main advantage of the Query Timer is that it supports all Databases that are also supported by the Data Generator and is easy and fast to use.
377+
As the Query Timer is just a by-product of the Data Generator there are other alternatives that offer more features and
378+
ways to time queries. The main advantage of the Query Timer is that it supports all Databases that are also supported by
379+
the Data Generator and is easy and fast to use.
366380

367381
### cr8
368382

369-
[cr8](https://github.com/mfussenegger/cr8) is a highly sophisticated tool that offers the possibility to measure query execution times for CrateDB and other Databases using the postgres protocol.
383+
[cr8](https://github.com/mfussenegger/cr8) is a highly sophisticated tool that offers the possibility to measure query
384+
execution times for CrateDB and other Databases using the postgres protocol.
370385

371386
Pros:
372387

@@ -380,7 +395,8 @@ Cons:
380395

381396
### JMeter
382397

383-
[Jmeter](https://jmeter.apache.org/) is a well known and great tool that offers the possibility to measure query execution times for Databases using JDBC.
398+
[Jmeter](https://jmeter.apache.org/) is a well known and great tool that offers the possibility to measure query
399+
execution times for Databases using JDBC.
384400

385401
Pros:
386402

tictrack/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# tictrack
22

3-
`tictrack` is a python library to measure function execution times and apply statistical functions on the results.
3+
`tictrack` is a Python library to measure function execution times and apply statistical functions on the results.
44

55
## Why using tictrack instead of other libraries
66

77
Other libraries that measure function execution times require the same repetitive code for each time you want to use it.
8-
This reduces readability and code needs to be changed when execution times no longer want to be tracked. Also if an
8+
This reduces readability and code needs to be changed when execution times no longer want to be tracked. Also, if an
99
average (or other statistical value) execution time needs to be calculated time keeping needs to be implemented again.
1010

1111
`tictrack` solves this with the following features:

0 commit comments

Comments
 (0)