Skip to content

Commit

Permalink
Start project
Browse files Browse the repository at this point in the history
  • Loading branch information
pm5 committed Oct 10, 2016
0 parents commit 0edf341
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

## Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Usage
=====

```
$ pip install -r requirements
$ locust -f locustfile.py --host=https://lowiki.tw
# check <http://localhost:8089/>
```
38 changes: 38 additions & 0 deletions locustfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python
# encoding=utf-8

from locust import HttpLocust, TaskSet, task

class WebsiteTasks(TaskSet):
# def on_start(self):
# self.client.post("/Users/login/?next=//lowiki.tw/", {
# "username": "anonymous",
# "password": "foobarbaz"
# })

@task
def region(self):
self.client.get("/tw1000201-027/")

@task
def edit_frontpage(self):
self.client.get("/tw1000201-027/Front_Page/_edit")

@task
def map(self):
self.client.get("/tw1000201-027/map/")

@task
def edit_page(self):
self.client.get(u"/tw1000201-027/梅洲里鎮平宮/_edit")

@task
def tags(self):
self.client.get(u"/tw1000201-027/tags/避難收容處所")

class WebsiteUser(HttpLocust):
host = "https://lowiki.tw"
task_set = WebsiteTasks
min_wait = 5000
max_wait = 15000

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
locustio==0.7.5
pyzmq==15.4.0

0 comments on commit 0edf341

Please sign in to comment.