Permalink
Browse files

Fix all scripts per issues reported in #88

1 parent b085df4 commit f6689eeb3ecae997f13e06b1731c6e54e3802d89 @vvuksan vvuksan committed Oct 17, 2012
@@ -7,14 +7,15 @@
import urllib2
import traceback
import re
+import copy
# global to store state for "total accesses"
METRICS = {
'time' : 0,
'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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit f6689ee

Please sign in to comment.