File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 33import optparse
44import socket
55import sys
6- import os
7- import subprocess
86
97import mc_bin_client
108
9+
1110def main ():
1211 parser = optparse .OptionParser (
1312 usage = "usage: %prog ip1:memcachedport1,ip2:memcachedport2" ,
@@ -85,12 +84,12 @@ def main():
8584 # ------ Global Stats Collected ----------
8685 item_count = 0
8786 for vbid in vbstats :
88- active_count = int (vbstats [vbid ]["num_items" ][ "active" ] )
89- replica_count = int (vbstats [vbid ]["num_items" ][ "replica" ] )
87+ active_count = int (vbstats [vbid ]["num_items" ]. get ( "active" , 0 ) )
88+ replica_count = int (vbstats [vbid ]["num_items" ]. get ( "replica" , 0 ) )
9089 if active_count != replica_count :
9190 print ("VBucket %d: active count %d != %d replica count \n "
9291 % (vbid , active_count , replica_count ))
93- item_count += int (vbstats [vbid ]["num_items" ][ "active" ] )
92+ item_count += int (vbstats [vbid ]["num_items" ]. get ( "active" , 0 ) )
9493 print ("Active item count = %d\n " % item_count )
9594
9695if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments