Identation and description

This commit is contained in:
Alexander Oleinik 2015-09-10 19:09:29 +00:00
parent 07c4f51157
commit 956cb528c2
1 changed files with 22 additions and 22 deletions

View File

@ -1,17 +1,17 @@
package webservercodes
import (
"net/http"
"strconv"
"sync"
"time"
"os"
"io"
"regexp"
"errors"
"net/http"
"strconv"
"sync"
"time"
"os"
"io"
"regexp"
"errors"
"github.com/rogpeppe/rog-go/reverse"
"github.com/influxdb/telegraf/plugins"
"github.com/rogpeppe/rog-go/reverse"
"github.com/influxdb/telegraf/plugins"
)
type Vhost struct {
@ -22,7 +22,7 @@ type Vhost struct {
}
type Webservercodes struct {
Vhosts []*Vhost
Vhosts []*Vhost
}
type HttpStats struct {
@ -48,15 +48,15 @@ interval = "10s"
`
func (n *Webservercodes) SampleConfig() string {
return sampleConfig
return sampleConfig
}
func (n *Webservercodes) Description() string {
return "Read webserver access log files and collects http return codes stats"
return "Read webserver access log files and count http return codes found"
}
func (n *Webservercodes) Gather(acc plugins.Accumulator) error {
var wg sync.WaitGroup
var wg sync.WaitGroup
hostStats := map[string]HttpStats{}
errChan := make(chan error)
@ -97,7 +97,7 @@ func (n *Webservercodes) Gather(acc plugins.Accumulator) error {
n.gatherCodes(vhost, stats, acc)
}
return nil
return nil
}
func SearchStringInSlice(a string, list []string) bool {
@ -249,7 +249,7 @@ func (n *Webservercodes) gatherCodes(vhost string, stats HttpStats, acc plugins.
}
func init() {
plugins.Add("webservercodes", func() plugins.Plugin {
return &Webservercodes{}
})
plugins.Add("webservercodes", func() plugins.Plugin {
return &Webservercodes{}
})
}