项目作者: ans-hub

项目描述 :
Perform generate mock data in format like "string string date string string"
高级语言: Shell
项目地址: git://github.com/ans-hub/logen.git
创建时间: 2017-03-11T17:19:30Z
项目社区:https://github.com/ans-hub/logen

开源协议:MIT License

下载


Logen (Logs Generator)

This bash script is provides generate mock data for test applications, that needs to work with dates range in different files. Script putting lines like “4832 2980 date 21390” in text files or gz archives.

Usage

Usage of this script is explained by the example for generating string like “%d5 %d5 %d5 date %d5”.

Install

  1. git clone https://github.com/ans-hub/logen.git

Make script executable:

  1. $ chmod +x logen
  1. $ sudo ln -s ~/folder_with_logen_app/logen /usr/local/bin/logen

Note: in next steps all code writed without “./“, as if you have performed command above.

Read built-in help for command usage:

  1. $ logen -h

Build options for script and test it in shell:

  1. $ logen -o "data" -d "[%Y-%b-%d:%H:%M:%S" -s 4 -g "4,5,\040,3" "2016-12-29 12:34:00" "2017-01-07 11:03:00"

The command above will have generated 10 files with date string like “21782 35321 [2016-12-29:12:34:00 43212” and interval with 4 seconds. By default, logen script change mtime of created files.

More examples:

Examples with different mock data source you may find in test case script “logen_test_main” or “logen_test_perfomance”
Real usage of logen script in test cases you may see in the Dasp script

Recemmendations:

Use -t option to improve perfomance

Known issues:

Auto packing generated data in gz archive is planned in the next versions