Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix all scripts per issues reported in #88

  • Loading branch information...
commit f6689eeb3ecae997f13e06b1731c6e54e3802d89 1 parent b085df4
@vvuksan vvuksan authored
View
5 apache_status/python_modules/apache_status.py
@@ -7,6 +7,7 @@
import urllib2
import traceback
import re
+import copy
# global to store state for "total accesses"
METRICS = {
@@ -14,7 +15,7 @@
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
#Metric prefix
@@ -106,7 +107,7 @@ def get_metrics():
traceback.print_exc()
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
5 blueeyes_service/python_modules/blueeyes_service.py
@@ -30,6 +30,7 @@
import os
import re
import time
+import copy
PARAMS = {
@@ -43,7 +44,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_TTL = 1
@@ -84,7 +85,7 @@ def get_metrics():
metrics = {}
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
6 mongodb/python_modules/mongodb.py
@@ -31,7 +31,7 @@
import socket
import string
import time
-
+import copy
NAME_PREFIX = 'mongodb_'
PARAMS = {
@@ -42,7 +42,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_TTL = 3
@@ -85,7 +85,7 @@ def get_metrics():
metrics = {}
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
6 network/conntrack/python_modules/conntrack.py
@@ -27,7 +27,7 @@
import os
import time
-
+import copy
NAME_PREFIX = 'conntrack_'
PARAMS = {
@@ -37,7 +37,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
def create_desc(skel, prop):
@@ -67,7 +67,7 @@ def get_metrics():
metrics[values[0]] = 0
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
5 network/multi_interface/python_modules/multi_interface.py
@@ -2,6 +2,7 @@
import time
import sys
import os
+import copy
PARAMS = {}
@@ -11,7 +12,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
INTERFACES = []
@@ -153,7 +154,7 @@ def get_metrics():
metrics[dev_name] = re.split("\s+", a[1].lstrip())
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
5 system/cpu_stats/python_modules/cpu_stats.py
@@ -3,6 +3,7 @@
import os
import re
import time
+import copy
METRICS = {
'time' : 0,
@@ -23,7 +24,7 @@
'rcu' : 10
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
@@ -53,7 +54,7 @@ def get_metrics():
metrics[parts[0]] = list(parts[1:])
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
5 system/mem_fragmentation/python_modules/mem_fragmentation.py
@@ -1,6 +1,7 @@
import sys
import re
import time
+import copy
PARAMS = {}
@@ -15,7 +16,7 @@
buddyinfo_file = "/proc/buddyinfo"
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
stats_pos = {}
@@ -82,7 +83,7 @@ def get_metrics():
file.close
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': values
View
7 system/vm_stats/python_modules/vm_stats.py
@@ -1,8 +1,7 @@
import sys
-#import traceback
-#import os
import re
import time
+import copy
PARAMS = {}
@@ -12,7 +11,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
###############################################################################
@@ -47,7 +46,7 @@ def get_metrics():
metrics[parts[0]] = parts[1]
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
6 tokyo_tyrant/python_modules/tokyo_tyrant.py
@@ -27,7 +27,7 @@
import os
import time
-
+import copy
NAME_PREFIX = 'tokyo_tyrant_'
PARAMS = {
@@ -37,7 +37,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 1
@@ -61,7 +61,7 @@ def get_metrics():
metrics[values[0]] = values[1]
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
View
6 varnish/python_modules/varnish.py
@@ -27,7 +27,7 @@
import os
import time
-
+import copy
NAME_PREFIX = 'varnish_'
PARAMS = {
@@ -37,7 +37,7 @@
'time' : 0,
'data' : {}
}
-LAST_METRICS = dict(METRICS)
+LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
def create_desc(skel, prop):
@@ -67,7 +67,7 @@ def get_metrics():
metrics[values[0]] = 0
# update cache
- LAST_METRICS = dict(METRICS)
+ LAST_METRICS = copy.deepcopy(METRICS)
METRICS = {
'time': time.time(),
'data': metrics
Please sign in to comment.
Something went wrong with that request. Please try again.