Fix linting, cleanup, and add example to flag

This commit is contained in:
Roland Schilter
2017-06-29 14:15:49 +02:00
parent 702220f2ce
commit d0527d28df
4 changed files with 6 additions and 5 deletions

View File

@@ -29,8 +29,8 @@ export default class NodeDetailsHealthLinkItem extends React.Component {
}
render() {
const {links, withoutGraph, ...props} = this.props;
const href = this.buildHref(links[props.id] && links[props.id].url);
const {links, withoutGraph, id, ...props} = this.props;
const href = this.buildHref(links[id] && links[id].url);
if (!href) return <NodeDetailsHealthItem {...props} />;

View File

@@ -356,7 +356,7 @@ func setupFlags(flags *flags) {
flag.IntVar(&flags.app.memcachedCompressionLevel, "app.memcached.compression", gzip.DefaultCompression, "How much to compress reports stored in memcached.")
flag.StringVar(&flags.app.userIDHeader, "app.userid.header", "", "HTTP header to use as userid")
flag.BoolVar(&flags.app.externalUI, "app.externalUI", false, "Point to externally hosted static UI assets")
flag.StringVar(&flags.app.metricsGraphURL, "app.metrics-graph", "", "Enable extended metrics graph by providing a templated URL (supports :orgID and :query)")
flag.StringVar(&flags.app.metricsGraphURL, "app.metrics-graph", "", "Enable extended metrics graph by providing a templated URL (supports :orgID and :query). Example: --app.metric-graph=/prom/:orgID/notebook/new")
flag.IntVar(&flags.app.blockProfileRate, "app.block.profile.rate", 0, "If more than 0, enable block profiling. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked.")

View File

@@ -66,7 +66,7 @@ func SetMetricsGraphURL(url string) {
metricsGraphURL = url
}
// NodeLinks returns the links of a node. The links are collected
// NodeMetricLinks returns the links of a node. The links are collected
// by a predefined set but filtered depending on whether a query
// is configured or not for the particular topology.
func NodeMetricLinks(_ report.Report, n report.Node) []MetricLink {
@@ -89,7 +89,7 @@ func NodeMetricLinks(_ report.Report, n report.Node) []MetricLink {
return links
}
// RenderLinks executes the templated links by supplying the node summary as data.
// RenderMetricLinks executes the templated links by supplying the node summary as data.
// It returns the modified summary.
func RenderMetricLinks(summary NodeSummary, n report.Node) NodeSummary {
queries := topologyQueries[n.Topology]

View File

@@ -9,6 +9,7 @@ import (
"github.com/weaveworks/scope/test/fixture"
)
// Exported for testing.
var (
circle = "circle"
square = "square"