Skip to content

Commit

Permalink
add role count to cluster stats table
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstimothy committed Jan 27, 2025
1 parent 392bea9 commit 3cde547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tool/tctl/common/top/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func renderCommon(report *Report, width int) string {
"Cert Gen Requests/sec",
"Cert Gen Throttled Requests/sec",
"Auth Watcher Queue Size",
"Roles",
"Active Migrations",
},
},
Expand All @@ -234,6 +235,7 @@ func renderCommon(report *Report, width int) string {
humanize.FormatFloat("", report.Cluster.GenerateRequestsCount.GetFreq()),
humanize.FormatFloat("", report.Cluster.GenerateRequestsThrottledCount.GetFreq()),
humanize.FormatFloat("", report.Cache.QueueSize),
humanize.FormatFloat("", report.Cluster.Roles),
cmp.Or(strings.Join(report.Cluster.ActiveMigrations, ", "), "None"),
},
},
Expand Down
3 changes: 3 additions & 0 deletions tool/tctl/common/top/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ type ClusterStats struct {
GenerateRequestsHistogram Histogram
// ActiveMigrations is a set of active migrations
ActiveMigrations []string
// Roles is the number of roles that exist in the cluster.
Roles float64
}

// RemoteCluster is a remote cluster (or local cluster)
Expand Down Expand Up @@ -419,6 +421,7 @@ func generateReport(metrics map[string]*dto.MetricFamily, prev *Report, period t
GenerateRequestsThrottledCount: Counter{Count: getCounterValue(metrics[teleport.MetricGenerateRequestsThrottled])},
GenerateRequestsHistogram: getHistogram(metrics[teleport.MetricGenerateRequestsHistogram], atIndex(0)),
ActiveMigrations: getActiveMigrations(metrics[prometheus.BuildFQName(teleport.MetricNamespace, "", teleport.MetricMigrations)]),
Roles: getGaugeValue(metrics[prometheus.BuildFQName(teleport.MetricNamespace, "", "roles_total")]),
}

if prev != nil {
Expand Down

0 comments on commit 3cde547

Please sign in to comment.