Permalink
Browse files

Correctly show warning counter values

Should not mix warning values from alarm ones.
  • Loading branch information...
1 parent e86194b commit a293115a915516a85b17bb1997b9c52e419a4024 @bcui6611 bcui6611 committed Jul 24, 2012
Showing with 21 additions and 13 deletions.
  1. +6 −6 analyzer.py
  2. +1 −1 cbhealthchecker
  3. +12 −4 cluster_stats.py
  4. +2 −2 reports/template.tmpl
View
@@ -95,7 +95,7 @@ def run_analysis(self, scale):
for node in val[1]:
node_error.append(node["node"])
break
- elif val[0] == "warn":
+ if val[0] == "warn":
bucket_status = "Warning"
for node in val[1]:
node_warn.append(node["node"])
@@ -117,20 +117,20 @@ def run_analysis(self, scale):
else:
if bucket_node_symptoms[bucket].has_key(val[0]) == False:
bucket_node_symptoms[bucket][val[0]] = []
- status = "OK"
+ counter_status = "OK"
if val[0] in node_warn:
- status = "Warning"
+ counter_status = "Warning"
if val[0] in node_error:
- status = "Error"
+ counter_status = "Error"
if counter.has_key("formula"):
bucket_node_symptoms[bucket][val[0]].append({"description" : counter["description"],
"value" : val[1],
- "status":status,
+ "status":counter_status,
"formula":counter["formula"]})
else:
bucket_node_symptoms[bucket][val[0]].append({"description" : counter["description"],
"value" : val[1],
- "status":status,
+ "status":counter_status,
"formula":"N/A"})
if pill.has_key("perNode") and pill["perNode"] :
if counter.has_key("formula"):
View
@@ -24,7 +24,7 @@ def parse_opt():
time_file_name = time.strftime('%Y-%m-%d_%H-%M-%S')
(bucket, cluster, user, password, txtfile, htmlfile, statsfile, verbose, debug,
inputfile, scale, statsonly) = ('all', '', '', '', time_file_name + '.txt',
- time_file_name + '.html', time_file_name + '.json', True, True, '', 'day', False)
+ time_file_name + '.html', time_file_name + '.json', False, False, '', 'day', False)
try:
(opts, _args) = getopt.getopt(sys.argv[1:],
View
@@ -386,16 +386,19 @@ def run(self, accessor, scale, threshold=None):
if len_element != correct_len:
symptom = "vBucketMap element length {0} is not consistent to replica {1}".format(len_element, numReplica)
num_error.append({"node" : "total", "value" : symptom})
+ trend.append((node, len_element))
for element in vbucket:
#check three - each vbucket index correctness
if element > len_serverMap - 1:
symptom = "vBucketMap element server index {0} can not be found in server list".format(element)
num_error.append({"node" : "total", "value" : symptom})
+ trend.append((node, element))
#check four - check unqiueness for vbucket
new_set = set(vbucket)
if len(new_set) < len_element:
symptom = "vBucketMap element {0} violates index uniqueness".format(vbucket)
num_error.append({"node" : "total", "value" : symptom})
+ trend.append((node, vbucket))
if len(num_error) > 0:
trend.append(("error", num_error))
result[bucket] = trend
@@ -417,6 +420,7 @@ def run(self, accessor, scale, threshold=None):
if len(new_set) < len(serverMap):
symptom = "vBucketMap server list {0} violates node uniqueness".format(serverMap)
num_error.append({"node" : "total", "value" : symptom})
+ trend.append((node, serverMap))
if len(num_error) > 0:
trend.append(("error", num_error))
result[bucket] = trend
@@ -432,6 +436,7 @@ def run(self, accessor, scale, threshold=None):
threshold_val = accessor["threshold"]
for bucket, bucket_stats in stats_buffer.node_stats.iteritems():
num_warn = []
+ res = []
for node, stats_info in bucket_stats.iteritems():
warnings = []
for key, value in stats_info.iteritems():
@@ -441,8 +446,10 @@ def run(self, accessor, scale, threshold=None):
if len(warnings) > 0:
symptom = accessor["symptom"].format(len(warnings), threshold_val)
num_warn.append({"node":node, "value": symptom})
+ res.append((node, {"value":symptom, "raw":warnings}))
if len(num_warn) > 0:
- result[bucket] = {"warn" : num_warn}
+ res.append(("warn", num_warn))
+ result[bucket] = res
return result
class CalcFragmentation:
@@ -575,7 +582,7 @@ def run(self, accessor, scale, threshold=None):
"name" : "minFreeDiskSpace",
"description" : "Node with least available disk space",
"code" : "LeastDiskSpace",
- "symptom" : "'{0}' with free disk space '{1}'",
+ "symptom" : "'{0}' with space '{1}'",
"formula" : "Min(Storage['hdd']['free'])",
},
],
@@ -756,15 +763,16 @@ def run(self, accessor, scale, threshold=None):
},
{
"name" : "tapNack",
- "description" : "Number of nacks",
+ "description" : "Number of backoff",
"counter" : "num_tap_nack",
"code" : "RebalanceStuck",
"threshold" : 5,
- "symptom" : "There are {0} stats showing number of negative tap acks received above threshold '{1}'",
+ "symptom" : "Backoff received above threshold '{1}'",
"formula" : "Total(num_tap_nack > threshold)",
},
],
"indicator" : True,
+ "perBucket" : True,
},
{"name" : "MemoryFragmentation",
"ingredients" : [
View
@@ -146,7 +146,7 @@
#if $symptom["status"] == "Error"
#set $statusClass = "status-error"
#elif $symptom["status"] == "Warning"
- #set $statusClass = "status-error"
+ #set $statusClass = "status-warning"
#else
#set $statusClass = ""
#end if
@@ -189,7 +189,7 @@
#if $node_value["status"] == "Error"
#set $statusClass = "status-error"
#elif $node_value["status"] == "Warning"
- #set $statusClass = "status-error"
+ #set $statusClass = "status-warning"
#else
#set $statusClass = ""
#end if

0 comments on commit a293115

Please sign in to comment.