Skip to content

Commit

Permalink
Add failing test case for #217
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Nov 20, 2021
1 parent b321e09 commit 71a82c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions features/issues.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ Feature: Various issues reported in the bug tracker remain solved
28.90.74.145 - - [17/Jan/2020:10:18:11 +0000] "GET /category/finance HTTP/1.1" 200 83 "/category/books?from=20" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" 5175 1477 8842
"""
Then the exporter should report value 1 for metric test_http_response_count_total{method="GET",status="200"}

Scenario: Issue 217: Multiple response time values
Given a running exporter listening with configuration file "test-config-issue217.yaml"
When the following HTTP request is logged to "access.log"
"""
www.example.com 10.0.0.1 - - [27/Oct/2021:06:00:14 +0200] "GET /websocket HTTP/1.1" 200 552 "-" "SomeUserAgentString" 0.000 "1.000, 0.250, 2.000, 0.750" . TLSv1.3/TLS_AES_256_GCM_SHA384 1234567890 www.example.com
www.example.com 10.0.0.2 - - [27/Oct/2021:06:00:15 +0200] "GET /websocket HTTP/1.1" 200 552 "-" "AnotherUserAgent" 0.000 "1.000, 0.250, 2.000, 0.750" . TLSv1.3/TLS_AES_256_GCM_SHA384 1234567890 www.example.com
www.example.com 10.0.0.3 - - [27/Oct/2021:06:00:15 +0200] "GET /websocket HTTP/1.1" 200 150 "-" "SomeUserAgentString" 0.001 "1.000, 0.250, 2.000, 0.750" . TLSv1.3/TLS_AES_256_GCM_SHA384 1234567890 www.example.com
"""
Then the exporter should report value 12 for metric test_http_upstream_time_seconds_sum{method="GET",status="200"}
10 changes: 10 additions & 0 deletions features/test-config-issue217.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
enable_experimental: true

listen:
port: 4040

namespaces:
- name: test
format: "$server_name $remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time \"$upstream_response_time\" $pipe $ssl_protocol/$ssl_cipher $request_id $host"
source_files:
- .behave-sandbox/access.log

0 comments on commit 71a82c2

Please sign in to comment.