本文整理汇总了Golang中github.com/weaveworks/scope/report.Report.Topology方法的典型用法代码示例。如果您正苦于以下问题:Golang Report.Topology方法的具体用法?Golang Report.Topology怎么用?Golang Report.Topology使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/weaveworks/scope/report.Report
的用法示例。
在下文中一共展示了Report.Topology方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NodeTables
// NodeTables produces a list of tables (to be consumed directly by the UI) based
// on the report and the node. It uses the report to get the templates for the node's
// topology.
func NodeTables(r report.Report, n report.Node) []report.Table {
if _, ok := n.Counters.Lookup(n.Topology); ok {
// This is a group of nodes, so no tables!
return nil
}
if topology, ok := r.Topology(n.Topology); ok {
return topology.TableTemplates.Tables(n)
}
return nil
}
示例2: NodeMetadata
// NodeMetadata produces a table (to be consumed directly by the UI) based on
// an a report.Node, which is (hopefully) a node in one of our topologies.
func NodeMetadata(r report.Report, n report.Node) []report.MetadataRow {
if _, ok := n.Counters.Lookup(n.Topology); ok {
// This is a group of nodes, so no metadata!
return nil
}
if topology, ok := r.Topology(n.Topology); ok {
return topology.MetadataTemplates.MetadataRows(n)
}
return nil
}
示例3: NodeMetrics
// NodeMetrics produces a table (to be consumed directly by the UI) based on
// an a report.Node, which is (hopefully) a node in one of our topologies.
func NodeMetrics(r report.Report, n report.Node) []report.MetricRow {
if _, ok := n.Counters.Lookup(n.Topology); ok {
// This is a group of nodes, so no metrics!
return nil
}
topology, ok := r.Topology(n.Topology)
if !ok {
return nil
}
return topology.MetricTemplates.MetricRows(n)
}
示例4: Render
// Render implements Renderer
func (t TopologySelector) Render(r report.Report, _ Decorator) report.Nodes {
topology, _ := r.Topology(string(t))
return topology.Nodes
}
示例5: controls
func controls(r report.Report, n report.Node) []ControlInstance {
if t, ok := r.Topology(n.Topology); ok {
return controlsFor(t, n.ID)
}
return []ControlInstance{}
}