Metadata-Version: 2.1
Name: wtg-seal
Version: 0.3.0
Summary: A web traffic generator based on SURGE, Statistics and Locust
Home-page: https://github.com/mchoji/wtg-seal
Author: M. Choji
Author-email: mchoji@users.noreply.github.com
License: gpl3
Project-URL: Documentation, https://wtg-seal.readthedocs.io
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Testing :: Traffic Generation
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Requires-Dist: locust
Requires-Dist: scipy
Provides-Extra: testing
Requires-Dist: pytest ; extra == 'testing'
Requires-Dist: pytest-cov ; extra == 'testing'

[![Build Status](https://travis-ci.com/mchoji/wtg-seal.svg?branch=master)](https://travis-ci.com/mchoji/wtg-seal)
[![Documentation Status](https://readthedocs.org/projects/wtg-seal/badge/?version=latest)](https://wtg-seal.readthedocs.io/en/latest/?badge=latest)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/mchoji/wtg-seal.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mchoji/wtg-seal/alerts/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/mchoji/wtg-seal.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mchoji/wtg-seal/context:python)
[![Maintainability](https://api.codeclimate.com/v1/badges/2ad3251ae12e112ae33e/maintainability)](https://codeclimate.com/github/mchoji/wtg-seal/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/2ad3251ae12e112ae33e/test_coverage)](https://codeclimate.com/github/mchoji/wtg-seal/test_coverage)
[![Coverage Status](https://coveralls.io/repos/github/mchoji/wtg-seal/badge.svg?branch=master)](https://coveralls.io/github/mchoji/wtg-seal?branch=master)
[![Requirements Status](https://requires.io/github/mchoji/wtg-seal/requirements.svg?branch=master)](https://requires.io/github/mchoji/wtg-seal/requirements/?branch=master)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![GitHub license](https://img.shields.io/github/license/mchoji/wtg-seal)](https://github.com/mchoji/wtg-seal/blob/master/LICENSE.txt)
[![PyPI version fury.io](https://badge.fury.io/py/wtg-seal.svg)](https://pypi.python.org/pypi/wtg-seal/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/wtg-seal.svg)](https://pypi.python.org/pypi/wtg-seal/)
[![PyPI status](https://img.shields.io/pypi/status/wtg-seal.svg)](https://pypi.python.org/pypi/wtg-seal/)
[![DOI](https://zenodo.org/badge/242190083.svg)](https://zenodo.org/badge/latestdoi/242190083)

# WTG-SEAL
A **W**eb **T**raffic **G**enerator based on **S**URG**E**, St**a**tistics and
**L**ocust

## Overview
WTG-SEAL is a web traffic generator based on a statistical approach inspired
by SURGE <span id="a1">[[1]](#f1)</span> and implemented using
[Locust](https://github.com/locustio/locust).

In fact, it is expected that the input files for WTG-SEAL are the output files
from SURGE, although one should be able to create their own files.

## Getting Started

### Installing with pip
To install the latest release of WTG-SEAL, just run

```shell
pip install wtg-seal
```

### Requirements
In order to generate your `locustfile.py` using WTG-SEAL, you will need of two
text files formatted as follow:

#### Documents Definitions
A text file where each line describes a web document, which is defined as a
collection of one or more objects. For instance, a `docdef.txt` with the
following content:

```
1
5 8
```

maps to a document represented by a single file `1.txt` and another document
represented by the files `5.txt` and `8.txt`. Each document is identified by a
sequential number (the order it appears on the file, starting from 0).

Ideally, this is the `objout.txt` file generated by SURGE.

### Documents Requests Sequence
A text file where each line contains a document identifier (*i.e* an integer) in
the order they were to be requested to a web server. For instance, a
`docseq.txt` with the following content:

```
0
0
1
0
```

represents requests to documents 0, 0, 1, 0. This is used by WTG-SEAL to
calculate the weight of each locust task.

Ideally, this is the `name.txt` file generated by SURGE.

### Server Side
Considering the previous example, it would be necessary that files named
`1.txt`, `5.txt` and `8.txt` exist on a web-server to where the requests will be
made.

### Generating web traffic
Once you have the appropriate files, just run

```shell
wtgseal docdef.txt docseq.txt
```

This will create a file in the current directory named `locustfile.py`.

From here, you will rely on Locust to generate the web traffic towards a web
server of your choice. Just run

```shell
locust
```

and access the URL provided on your screen. For more information, [see Locust
documentation](https://docs.locust.io/en/stable/).

## Contributing
For contributing or making your own modifications to the source code, run:

```shell
git clone https://github.com/mchoji/wtg-seal.git
cd wtg-seal
pipenv install -e .
pipenv install --dev
```

### Pre-commit hooks
In order to make sure the hooks will run, please don't forget to install the
`pre-commit` package:

```shell
cd wtg-seal
pipenv install --dev
pipenv run pre-commit install
# update the hooks to the latest version
pipenv run pre-commit autoupdate
```

## Versioning
Versions defined according to [SemVer](https://semver.org). For the versions
available, see the [tags on this repository](https://github.com/mchoji/wtg-seal/tags).

## Authors
- M. Choji - [mchoji](https://github.com/mchoji)

## License
WTG-SEAL is licensed under the GNU General Public License v3.0.
See [LICENSE](LICENSE.txt) for more information.

## References
<b id="f1">[1]</b> Barford, P., & Crovella, M. (1998, June). Generating
representative web workloads for network and server performance evaluation.
In *Proceedings of the 1998 ACM SIGMETRICS joint international conference on
Measurement and modeling of computer systems* (pp. 151-160). [↩](#a1)


