This is a asset to send http request timing
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
common
example
middlewares
types
vendor
.gitignore
Dockerfile
Gopkg.lock
Gopkg.toml
LICENSE
README.MD
build_image.sh
config.yaml
timing.go
timing_request-k8s.yaml
timing_test.go

README.MD

Timing Request

Circle CI

Introduction

Timing is used for send http request timing

Quick Start

  • get code

    go get -v github.com/vinkdong/timing
  • build execute file

    go build
  • edit config file

    you can find a example conf file at ./config.yaml, config file is under the yaml format you can use follow keys:

    • url: address you want requested
    • method: request method you need
    • body: request body, if you have 2 or more bodies it will send with difference body
    • range: special time period you want to send request, you can use hour,minute,second,microseconds,month and weekday, from now,then you can use gt,lt,gte,lte and eq as condition,they're AND relationship,Time is UTC time, and Sunday in weekday is 0, Monday is 1 by parity of reasoning.
    • run_every: interval time for wait next request, you can use seconds,minutes,hours and days,if there have 2 or more, they're AND relationship too.
    • log_response: whether log response body
    • using go templete in request uri and body such as {{ .RenderRelativeTime "now-15h" "2006-01-02" }}
    • auto reload config when config file changed

    in additional, you can use multi yaml split --- as multi request entities

  • start program

    ./timing --conf path/your/config

BTW, your can use --help to display help information

Monitoring with prometheus

you can monitoring this process via prometheus, this is a experimental

  • start with prometheus monitoring

    .timing --conf path/your/config -enable_metrics --addr :9800
  • additional arguments

    • buckets: prometheus buckets, default is 0.1, 0.3, 1.2, 5.0
  • then your can scape metrics by prometheus

    scrape_configs:
    - job_name: 'TimingRequest'
    static_configs:
    - targets:
        - '127.0.0.1:9800'