Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
5fdf684e
Verified
Commit
5fdf684e
authored
Mar 05, 2018
by
Florian Pritz
Browse files
nginx-zabbix: Measure number of cached requests (0.000 request time)
Signed-off-by:
Florian Pritz
<
bluewind@xinu.at
>
parent
e28df1c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/zabbix-agent/files/nginx-zabbix.pl
View file @
5fdf684e
...
...
@@ -58,6 +58,7 @@ sub main {
},
# counter since prog start
request_count
=>
0
,
cached_request_count
=>
0
,
# calculated values since last send
request_time
=>
{
max
=>
0
,
...
...
@@ -88,6 +89,7 @@ sub main {
$stat
->
add_data
(
$+
{
request_time
})
if
$+
{
request_time
}
!=
0
;
$values
->
{
request_count
}
++
;
$values
->
{
cached_request_count
}
++
if
$+
{
request_time
}
==
0
;
my
$status_key
=
defined
$values
->
{
status
}
->
{
$+
{
status
}}
?
$+
{
status
}
:
"
other
";
$values
->
{
status
}
->
{
$status_key
}
++
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment