Giter Site home page Giter Site logo

xuwenyihust / lunaticlog Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 2.0 5.36 MB

Fake HTTP log generator module, test if your monitor system can survive under the log spikes.

License: MIT License

Python 100.00%
apache log fake python traffic dummy-data stress-testing spike

lunaticlog's Introduction

Python PyPI version Travis Coverage Status Percentage of issues still open license

Lunaticlog: Fake Log Generator - Read The Docs

Lunaticlog is a mock HTTP log generator package, use it's fake log workloads to test if your monitor / analyzer can survive various extreme conditions.

Documentation

Lunaticlog's documentation can be found on https://xuwenyihust.github.io/lunaticlog/lunaticlog/html/.

Overview

Lunaticlog can generate logs with customized contents. The log traffic can also be configured.

Supported Log Format

What kinds of log formats does it support now?

  • Apache Access Log

    127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

  • [TODO] Nginx Access Log

    123.65.150.10 - - [23/Aug/2010:03:50:59 +0000] "POST /wordpress3/wp-admin/admin-ajax.php HTTP/1.1" 200 2 "http://www.example.com/wordpress3/wp-admin/post-new.php" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.25 Safari/534.3"

  • [TODO] Amazon S3 Log

    79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be mybucket [06/Feb/2014:00:00:38 +0000] 192.0.2.3 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be 3E57427F3EXAMPLE REST.GET.VERSIONING - "GET /mybucket?versioning HTTP/1.1" 200 - 113 - 7 - "-" "S3Console/0.4" -

Log Rotation

Set attribute rotation_size to rotate logs when current log file achieves the max size.

Log Generation Mode

The fate of lunaticlog is to create chaos to test your system. So it needs to generate various extreme cases, such as sudden traffic spikes.

What traffic modes are supported now?

  • uniform

    Generate logs at a random rate, which is uniformly distributed.

  • push

    Generate logs at highest speed(which can be configured).

  • spike

    Generate logs at sudden very high rates periodically.

The scripts to plot these bandwidth charts can be found under ./scripts.

Output Formats

  • STDOUT

  • .log file

  • .gz file

Install

pip install lunaticlog

Usage Example

apache_gen Class

Instantiation

from lunaticlog import apache_gen

log_gen = apache_gen(out_path='./apache.log', mode='uniform', rotation=True)
log_gen.run()

Arguments

  • out_path: path of output logs

  • out_format: format of output logs

  • mode: log traffic mode

License

See the LICENSE file for license rights and limitations (MIT).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.