@@ -236,7 +236,7 @@ func FormatFederationDetails(federationDetails []config.FederationDescription, t
236236 var nodeID , _ = strconv .Atoi (value .NodeID )
237237 table .AddRow (formatSmallInteger (int32 (nodeID )))
238238
239- if target == " destinations" {
239+ if target == destinations {
240240 bytes = value .TotalBytesSent
241241 messages = value .TotalMsgSent
242242 records = value .TotalRecordsSent
@@ -359,7 +359,7 @@ func FormatFederationSummary(federationSummaries []config.FederationSummary, tar
359359 )
360360
361361 for _ , value := range federationSummaries {
362- if target == " destinations" {
362+ if target == destinations {
363363 bytes = value .TotalBytesSent .Sum
364364 messages = value .TotalMsgSent .Sum
365365 records = value .TotalRecordsSent .Sum
@@ -956,8 +956,8 @@ func FormatCacheDetailsSizeAndAccess(cacheDetails []config.CacheDetail) string {
956956 if OutputFormat == constants .WIDE {
957957 table .AddColumnsToRow (formatLargeInteger (totalHits ),
958958 formatLargeInteger (value .CacheMisses ), formatPercent (hitProb ),
959- formatLargeInteger (value .StoreReads ), formatLargeInteger (value .StoreWrites ),
960- formatLargeInteger (value .StoreFailures ))
959+ formatLargeIntegerOrDash (value .StoreReads ), formatLargeIntegerOrDash (value .StoreWrites ),
960+ formatLargeIntegerOrDash (value .StoreFailures ))
961961 }
962962 }
963963
@@ -1521,7 +1521,7 @@ func FormatNetworkStatistics(members []config.Member) string {
15211521 table .AddColumnsToRow (formatLargeInteger (value .PacketsSent ), formatLargeInteger (value .PacketsReceived ),
15221522 formatLargeInteger (value .PacketsResent ), formatPercent (value .PacketDeliveryEfficiency ),
15231523 formatLargeInteger (value .SendQueueSize ), formattingFunction (value .TransportSentBytes ),
1524- formattingFunction (value .TransportReceivedBytes ), formatSmallInteger (value .WeakestChannel ))
1524+ formattingFunction (value .TransportReceivedBytes ), formatSmallIntegerOrDash (value .WeakestChannel ))
15251525 }
15261526
15271527 return table .String ()
@@ -1685,18 +1685,18 @@ func FormatServices(services []config.ServiceSummary) string {
16851685 table := newFormattedTable ().WithHeader (ServiceNameColumn , "TYPE" , MembersColumn , "STATUS HA" , "STORAGE" ,
16861686 "SENIOR" , partitions , "STATUS" ).WithSortingColumn (ServiceNameColumn )
16871687 if OutputFormat == constants .WIDE {
1688- table .WithAlignment (L , L , R , L , R , R , R , L , R , R , R , L )
1689- table .AddHeaderColumns (endangered , "VULNERABLE" , "UNBALANCED" , "SUSPENDED" )
1688+ table .WithAlignment (L , L , R , L , R , R , R , L , R , R , R , R , L )
1689+ table .AddHeaderColumns (endangered , "VULNERABLE" , "UNBALANCED" , "PENDING REQ" , " SUSPENDED" )
16901690 table .AddFormattingFunction (8 , endangeredPartitionsFormatter )
16911691 table .AddFormattingFunction (9 , vulnerablePartitionsFormatter )
16921692 table .AddFormattingFunction (10 , vulnerablePartitionsFormatter )
16931693 table .AddFormattingFunction (11 , yesBoolFormatter )
16941694 } else {
1695- table .WithAlignment (L , L , R , L , R , R , R , L )
1695+ table .WithAlignment (L , L , R , L , R , R , R , R , L )
16961696 }
16971697
16981698 table .AddFormattingFunction (3 , statusHAFormatter )
1699- table .AddFormattingFunction (7 , statusHAFormatter )
1699+ table .AddFormattingFunction (8 , statusHAFormatter )
17001700
17011701 for _ , value := range services {
17021702 var (
@@ -1729,12 +1729,13 @@ func FormatServices(services []config.ServiceSummary) string {
17291729
17301730 table .AddRow (value .ServiceName , value .ServiceType , formatSmallInteger (value .MemberCount ),
17311731 value .StatusHA , formatSmallInteger (value .StorageEnabledCount ), formatSmallInteger (value .SeniorMemberID ),
1732- formatSmallInteger (value .PartitionsAll ), status )
1732+ formatSmallIntegerOrDash (value .PartitionsAll ), status )
17331733
17341734 if OutputFormat == constants .WIDE {
1735- table .AddColumnsToRow (formatSmallInteger (value .PartitionsEndangered ),
1736- formatSmallInteger (value .PartitionsVulnerable ),
1737- formatSmallInteger (value .PartitionsUnbalanced ), suspended )
1735+ table .AddColumnsToRow (formatSmallIntegerOrDash (value .PartitionsEndangered ),
1736+ formatSmallIntegerOrDash (value .PartitionsVulnerable ),
1737+ formatSmallIntegerOrDash (value .PartitionsUnbalanced ),
1738+ formatSmallInteger (value .RequestPendingCount ), suspended )
17381739 }
17391740 }
17401741
@@ -2102,6 +2103,22 @@ func formatSmallInteger(value int32) string {
21022103 return printer .Sprintf ("%d" , value )
21032104}
21042105
2106+ // formatSmallIntegerOrDash formats a small integer but if the value is -1 returns "n/a"
2107+ func formatSmallIntegerOrDash (value int32 ) string {
2108+ if value == - 1 {
2109+ return "-"
2110+ }
2111+ return formatSmallInteger (value )
2112+ }
2113+
2114+ // formatLargeIntegerOrDash formats a large integer but if the value is -1 returns "n/a"
2115+ func formatLargeIntegerOrDash (value int64 ) string {
2116+ if value == - 1 {
2117+ return "-"
2118+ }
2119+ return formatLargeInteger (value )
2120+ }
2121+
21052122// formatPort formats a small integer with a max length.
21062123func formatPort (value int32 ) string {
21072124 return fmt .Sprintf ("%d" , value )
0 commit comments