Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/cmd/formatting.go
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,7 @@ func FormatPersistenceServices(services []config.ServiceSummary, isSummary bool)
table.WithAlignment(L, R, L, R, R, R, R, R, L)
table.WithHeader(ServiceNameColumn, "STORAGE COUNT", "PERSISTENCE MODE",
"ACTIVE SPACE", "BACKUP SPACE", "AVG LATENCY", "MAX LATENCY", "SNAPSHOTS", "STATUS")
table.AddFormattingFunction(8, persistenceStatusFormatter)
} else {
table.WithAlignment(R, L, R, R, R, R)
table.WithHeader(NodeIDColumn, "PERSISTENCE MODE", "ACTIVE SPACE", "BACKUP SPACE", "AVG LATENCY", "MAX LATENCY")
Expand Down
18 changes: 15 additions & 3 deletions pkg/cmd/formatting_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ var statusHAFormatter = func(s string) string {
return s
}

// persistenceStatusFormatter formats a column value containing persistence status.
var persistenceStatusFormatter = func(s string) string {
if isWindows() {
return s
}
if strings.Contains(s, "in progress") || strings.Contains(s, "snapshot") {
return yellow(s)
}

return s
}

// hitRateFormatter formats a column value which represents a cache hit rate.
var hitRateFormatter = func(s string) string {
if isWindows() {
Expand Down Expand Up @@ -229,7 +241,7 @@ var healthSummaryFormatter = func(s string) string {

// healthMonitoringFormatter formats a column value for health monitoring summary.
var healthMonitoringFormatter = func(s string) string {
if monitorCluster {
if isWindows() {
return s
}
if strings.Contains(s, http200) || strings.Contains(s, "4") {
Expand All @@ -246,7 +258,7 @@ var healthMonitoringFormatter = func(s string) string {

// healthSummaryFormatter formats a column value for federation state.
var federationStateFormatter = func(s string) string {
if monitorCluster {
if isWindows() {
return s
}
lowerCase := strings.ToLower(s)
Expand All @@ -262,7 +274,7 @@ var federationStateFormatter = func(s string) string {

// networkStatsFormatter formats a column value representing publisher or receiver rates.
var networkStatsFormatter = func(s string) string {
if monitorCluster {
if isWindows() {
return s
}
floatValue, err := strconv.ParseFloat(trimPercent(s), 32)
Expand Down
Loading