Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Need to split vbucket number with node number

  • Loading branch information...
commit 023c67a69ea22b07d24b6a0c5e4847fd764b78a2 1 parent 2c1724e
@bcui6611 bcui6611 authored
View
10 analyzer.py
@@ -113,8 +113,8 @@ def run_analysis(self):
"impact" : pill["indicator"]["impact"],
"action" : pill["indicator"]["action"],
}
- for val in values["error"]:
- bucket_node_status[bucket][val["node"]] = "error"
+ for node in val[1]:
+ bucket_node_status[bucket][node["node"]] = "error"
elif val[0] == "warn":
indicator_warn[counter["name"]] = {"description" : counter["description"],
"bucket": bucket,
@@ -134,9 +134,9 @@ def run_analysis(self):
node_disparate[counter["name"]] = {"description" : counter["description"], "bucket": bucket, "value":values}
if len(indicator_error) > 0:
- globals["cluster_health"] = "error"
+ globals["cluster_health"] = "Error"
elif len(indicator_warn) > 0:
- globals["cluster_health"] = "warning"
+ globals["cluster_health"] = "Warning"
def run_report(self, txtfile, htmlfile, verbose):
@@ -177,4 +177,4 @@ def run_report(self, txtfile, htmlfile, verbose):
print >> f, Template(file="report-htm.tmpl", searchList=[dict])
f.close()
- sys.stderr.write("\nThis run finishes successfully. Please find output result at '{0}'".format(htmlfile))
+ sys.stderr.write("\nThe run finished successfully. Please find output result at '{0}'".format(htmlfile))
View
2  bucket_stats.py
@@ -30,7 +30,7 @@ def run(self, accessor):
read_ratio = read[2] *100 / total
write_ratio = write[2] * 100 / total
del_ratio = delete[2] * 100 /total
- result.append((read[0], read[1], "{0}:{1}:{2}".format(read_ratio, write_ratio, del_ratio)))
+ result.append((read[0], read[1], "{0}% reads : {1}% writes : {2}% deletes".format(read_ratio, write_ratio, del_ratio)))
return result
View
2  buckets.py
@@ -107,7 +107,7 @@ def runCmd(self, cmd, server, port,
data = rest.restCmd(methods[cmd], self.rest_cmd,
self.user, self.password, opts)
- if cmd in("bucket-get", "bucket-stats", "bucket-node-stats"):
+ if cmd in ("bucket-get", "bucket-stats", "bucket-node-stats"):
return rest.getJson(data)
elif cmd == "bucket-list":
if output == 'json':
View
28 cluster_stats.py
@@ -85,7 +85,7 @@ def run(self, accessor):
for read, write, delete in zip(ops_avg['cmd_get'], ops_avg['cmd_set'], ops_avg['delete_hits']):
count = read[1] + write[1] + delete[1]
if count == 0:
- res.append((read[0], "0:0:0"))
+ res.append((read[0], "0% reads : 0% writes : 0% deletes"))
else:
read_ratio = read[1] *100 / count
read_total += read_ratio
@@ -93,11 +93,11 @@ def run(self, accessor):
write_total += write_ratio
del_ratio = delete[1] * 100 / count
del_total += del_ratio
- res.append((read[0], "{0}:{1}:{2}".format(int(read_ratio+.5), int(write_ratio+.5), int(del_ratio+.5))))
+ res.append((read[0], "{0}% reads : {1}% writes : {2}% deletes".format(int(read_ratio+.5), int(write_ratio+.5), int(del_ratio+.5))))
read_total /= len(ops_avg['cmd_get'])
write_total /= len(ops_avg['cmd_set'])
del_total /= len(ops_avg['delete_hits'])
- res.append(("total", "{0}:{1}:{2}".format(int(read_total+.5), int(write_total+.5), int(del_total+.5))))
+ res.append(("total", "{0}% reads : {1}% writes : {2}% deletes".format(int(read_total+.5), int(write_total+.5), int(del_total+.5))))
result[bucket] = res
return result
@@ -189,12 +189,16 @@ def run(self, accessor):
class NumVbuckt:
def run(self, accessor):
result = {}
+ num_node = len(stats_buffer.nodes)
+ if num_node == 0:
+ return result
+ avg_threshold = accessor["threshold"] / num_node
for bucket, stats_info in stats_buffer.buckets.iteritems():
num_error = []
values = stats_info[accessor["scale"]][accessor["counter"]]
nodeStats = values["nodeStats"]
for node, vals in nodeStats.iteritems():
- if vals[-1] < accessor["threshold"]:
+ if vals[-1] < avg_threshold:
num_error.append({"node":node, "value": int(vals[-1])})
if len(num_error) > 0:
result[bucket] = {"error" : num_error}
@@ -320,7 +324,7 @@ def run(self, accessor):
"perNode" : True,
"perBucket" : True,
"indicator" : {
- "cause" : "blah",
+ "cause" : "Cache miss ratio is too high.",
"impact" : "blah",
"action" : "blah",
},
@@ -353,7 +357,7 @@ def run(self, accessor):
"perNode" : True,
"perBucket" : True,
"indicator" : {
- "cause" : "blah",
+ "cause" : "Active resident ratio is less than replica resident ratio.",
"impact" : "blah",
"action" : "blah",
},
@@ -423,12 +427,6 @@ def run(self, accessor):
{"name" : "RebalancePerformance",
"ingredients" : [
{
- "name" : "rebalanceStuck",
- "description" : "Check if rebalance is stuck",
- "counter" : "idle",
- "code" : "RebalanceStuck",
- },
- {
"name" : "highBackfillRemaing",
"description" : "Tap queue backfilll remaining is too high",
"counter" : "ep_tap_queue_backfillremaining",
@@ -437,7 +435,7 @@ def run(self, accessor):
},
],
"indicator" : {
- "cause" : "blah",
+ "cause" : "Tap queue backfill remaining is higher than threshold.",
"impact" : "blah",
"action" : "blah",
}
@@ -487,7 +485,7 @@ def run(self, accessor):
},
],
"indicator" : {
- "cause" : "blah",
+ "cause" : "Severe IO issue possibly caused by memory fragmentation",
"impact" : "blah",
"action" : "blah",
},
@@ -524,7 +522,7 @@ def run(self, accessor):
},
],
"indicator" : {
- "cause" : "blah",
+ "cause" : "Poor engine KPIs",
"impact" : "blah",
"action" : "blah",
},
View
11 healthchecker 100644 → 100755
@@ -20,7 +20,7 @@ log.setLevel(logging.INFO)
log.addHandler(logging.StreamHandler())
def parse_opt():
- (cluster, user, password, txtfile, htmlfile, verbose) = ('', '', '', 'kpi_report.txt', 'health_report.html', True)
+ (cluster, user, password, txtfile, htmlfile, verbose) = ('', '', '', 'clusterstats.txt', 'health_report.html', True)
try:
(opts, _args) = getopt.getopt(sys.argv[1:],
@@ -61,14 +61,15 @@ def usage(error_msg=''):
print """healthChecker - cluster key performance indicator stats
-usage: healthChecker CLUSTER OPTIONS
+usage: healthChecker CLUSTER USERNAME PASSWORD OPTIONS
CLUSTER:
- --cluster=HOST[:PORT] or -c HOST[:PORT]
-
-OPTIONS:
+ --cluster=HOST[:PORT] or -c HOST[:PORT] Default port is 8091
+USERNAME:
-u USERNAME, --user=USERNAME admin username of the cluster
+PASSWORD:
-p PASSWORD, --password=PASSWORD admin password of the cluster
+OPTIONS:
-o FILENAME, --output=FILENAME Default output filename is 'kpi_report.txt'
-d --debug
-v --verbose Display detailed node level information
View
1  node_stats.py
@@ -78,6 +78,7 @@ def run(self, accessor):
"replicaCurrentItems" : values["systemStats"]["replicaCurrentItems"]})
return result
+
class ConnectionTrend:
def run(self, accessor):
result = {}
Please sign in to comment.
Something went wrong with that request. Please try again.