mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
nginx_upstream_multi_: fix namespace overide of "time"
This commit is contained in:
parent
5f9e882bce
commit
734da6b9c8
1 changed files with 7 additions and 7 deletions
|
@ -49,7 +49,7 @@ import math
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from time import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
# How we've been called
|
# How we've been called
|
||||||
|
@ -131,7 +131,7 @@ if "graphs" in os.environ:
|
||||||
else:
|
else:
|
||||||
graphs_enabled = ["cache", "http", "time", "request"]
|
graphs_enabled = ["cache", "http", "time", "request"]
|
||||||
|
|
||||||
now = int(time())
|
now = int(time.time())
|
||||||
|
|
||||||
lastBytePath = "%s/nginx_upstream_multi_%s_lastByte.txt" % (stateDir, siteName)
|
lastBytePath = "%s/nginx_upstream_multi_%s_lastByte.txt" % (stateDir, siteName)
|
||||||
try:
|
try:
|
||||||
|
@ -242,7 +242,7 @@ else:
|
||||||
if (match):
|
if (match):
|
||||||
# Extract data
|
# Extract data
|
||||||
address = match.group(1)
|
address = match.group(1)
|
||||||
time = match.group(2)
|
request_time = match.group(2)
|
||||||
status = match.group(3)
|
status = match.group(3)
|
||||||
cache = match.group(4)
|
cache = match.group(4)
|
||||||
|
|
||||||
|
@ -251,9 +251,9 @@ else:
|
||||||
address = address.replace(" : ", " ")
|
address = address.replace(" : ", " ")
|
||||||
address = re.sub(r"\s+", " ", address)
|
address = re.sub(r"\s+", " ", address)
|
||||||
|
|
||||||
time = time.replace(",", " ")
|
request_time = request_time.replace(",", " ")
|
||||||
time = time.replace(" : ", " ")
|
request_time = request_time.replace(" : ", " ")
|
||||||
time = re.sub(r"\s+", " ", time)
|
request_time = re.sub(r"\s+", " ", request_time)
|
||||||
|
|
||||||
status = status.replace(",", " ")
|
status = status.replace(",", " ")
|
||||||
status = status.replace(" : ", " ")
|
status = status.replace(" : ", " ")
|
||||||
|
@ -264,7 +264,7 @@ else:
|
||||||
cache = re.sub(r"\s+", " ", cache)
|
cache = re.sub(r"\s+", " ", cache)
|
||||||
|
|
||||||
addresses = address.split()
|
addresses = address.split()
|
||||||
times = time.split()
|
times = request_time.split()
|
||||||
statuses = status.split()
|
statuses = status.split()
|
||||||
caches = cache.split()
|
caches = cache.split()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue