Change config file indentation to 2 spaces
This commit is contained in:
parent
555436a222
commit
4e5ed9d3b9
|
@ -355,17 +355,13 @@ var header = `# Telegraf configuration
|
||||||
[agent]
|
[agent]
|
||||||
# Default data collection interval for all plugins
|
# Default data collection interval for all plugins
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
|
|
||||||
# If utc = false, uses local time (utc is highly recommended)
|
# If utc = false, uses local time (utc is highly recommended)
|
||||||
utc = true
|
utc = true
|
||||||
|
|
||||||
# Precision of writes, valid values are n, u, ms, s, m, and h
|
# Precision of writes, valid values are n, u, ms, s, m, and h
|
||||||
# note: using second precision greatly helps InfluxDB compression
|
# note: using second precision greatly helps InfluxDB compression
|
||||||
precision = "s"
|
precision = "s"
|
||||||
|
|
||||||
# run telegraf in debug mode
|
# run telegraf in debug mode
|
||||||
debug = false
|
debug = false
|
||||||
|
|
||||||
# Override default hostname, if empty use os.Hostname()
|
# Override default hostname, if empty use os.Hostname()
|
||||||
hostname = ""
|
hostname = ""
|
||||||
|
|
||||||
|
|
|
@ -33,13 +33,13 @@ var sampleConfig = `
|
||||||
# The target database for metrics (telegraf will create it if not exists)
|
# The target database for metrics (telegraf will create it if not exists)
|
||||||
database = "telegraf" # required
|
database = "telegraf" # required
|
||||||
|
|
||||||
# # Connection timeout (for the connection with InfluxDB), formatted as a string.
|
# Connection timeout (for the connection with InfluxDB), formatted as a string.
|
||||||
# # Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
||||||
# # If not provided, will default to 0 (no timeout)
|
# If not provided, will default to 0 (no timeout)
|
||||||
# timeout = "5s"
|
# timeout = "5s"
|
||||||
# username = "telegraf"
|
# username = "telegraf"
|
||||||
# password = "metricsmetricsmetricsmetrics"
|
# password = "metricsmetricsmetricsmetrics"
|
||||||
# # Set the user agent for the POSTs (can be useful for log differentiation)
|
# Set the user agent for the POSTs (can be useful for log differentiation)
|
||||||
# user_agent = "telegraf"
|
# user_agent = "telegraf"
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
@ -104,31 +104,42 @@ func (n *Apache) gatherScores(data string, acc plugins.Accumulator, tags map[str
|
||||||
for _, s := range strings.Split(data, "") {
|
for _, s := range strings.Split(data, "") {
|
||||||
|
|
||||||
switch s {
|
switch s {
|
||||||
case "_": waiting++
|
case "_":
|
||||||
case "S": S++
|
waiting++
|
||||||
case "R": R++
|
case "S":
|
||||||
case "W": W++
|
S++
|
||||||
case "K": K++
|
case "R":
|
||||||
case "D": D++
|
R++
|
||||||
case "C": C++
|
case "W":
|
||||||
case "L": L++
|
W++
|
||||||
case "G": G++
|
case "K":
|
||||||
case "I": I++
|
K++
|
||||||
case ".": open++
|
case "D":
|
||||||
|
D++
|
||||||
|
case "C":
|
||||||
|
C++
|
||||||
|
case "L":
|
||||||
|
L++
|
||||||
|
case "G":
|
||||||
|
G++
|
||||||
|
case "I":
|
||||||
|
I++
|
||||||
|
case ".":
|
||||||
|
open++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
acc.Add("scboard_waiting", float64(waiting), tags);
|
acc.Add("scboard_waiting", float64(waiting), tags)
|
||||||
acc.Add("scboard_starting", float64(S), tags);
|
acc.Add("scboard_starting", float64(S), tags)
|
||||||
acc.Add("scboard_reading", float64(R), tags);
|
acc.Add("scboard_reading", float64(R), tags)
|
||||||
acc.Add("scboard_sending", float64(W), tags);
|
acc.Add("scboard_sending", float64(W), tags)
|
||||||
acc.Add("scboard_keepalive", float64(K), tags);
|
acc.Add("scboard_keepalive", float64(K), tags)
|
||||||
acc.Add("scboard_dnslookup", float64(D), tags);
|
acc.Add("scboard_dnslookup", float64(D), tags)
|
||||||
acc.Add("scboard_closing", float64(C), tags);
|
acc.Add("scboard_closing", float64(C), tags)
|
||||||
acc.Add("scboard_logging", float64(L), tags);
|
acc.Add("scboard_logging", float64(L), tags)
|
||||||
acc.Add("scboard_finishing", float64(G), tags);
|
acc.Add("scboard_finishing", float64(G), tags)
|
||||||
acc.Add("scboard_idle_cleanup", float64(I), tags);
|
acc.Add("scboard_idle_cleanup", float64(I), tags)
|
||||||
acc.Add("scboard_open", float64(open), tags);
|
acc.Add("scboard_open", float64(open), tags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get tag(s) for the apache plugin
|
// Get tag(s) for the apache plugin
|
||||||
|
|
|
@ -156,7 +156,6 @@ func getTags(addr *url.URL) map[string]string {
|
||||||
return map[string]string{"server": host, "port": port}
|
return map[string]string{"server": host, "port": port}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
plugins.Add("nginx", func() plugins.Plugin {
|
plugins.Add("nginx", func() plugins.Plugin {
|
||||||
return &Nginx{}
|
return &Nginx{}
|
||||||
|
|
|
@ -104,7 +104,7 @@ type cachedtimings struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_ *Statsd) Description() string {
|
func (_ *Statsd) Description() string {
|
||||||
return "Statsd listener"
|
return "Statsd Server"
|
||||||
}
|
}
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
|
|
Loading…
Reference in New Issue