diff --git a/cmd/get.go b/cmd/get.go index 7ecbc20..57533a0 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -16,11 +16,12 @@ package cmd import ( "encoding/json" "fmt" + "time" + "github.com/davecgh/go-spew/spew" "github.com/gosuri/uitable" "github.com/hipages/php-fpm_exporter/phpfpm" "github.com/spf13/cobra" - "time" ) // Configuration variables diff --git a/cmd/server.go b/cmd/server.go index 3e15f38..3146a34 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -16,14 +16,15 @@ package cmd import ( "context" "fmt" - "github.com/hipages/php-fpm_exporter/phpfpm" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/spf13/cobra" "net/http" "os" "os/signal" "time" + + "github.com/hipages/php-fpm_exporter/phpfpm" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/spf13/cobra" ) // Configuration variables @@ -114,14 +115,6 @@ to quickly create a Cobra application.`, func init() { RootCmd.AddCommand(serverCmd) - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // serverCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: serverCmd.Flags().StringVar(&listeningAddress, "web.listen-address", ":9253", "Address on which to expose metrics and web interface.") serverCmd.Flags().StringVar(&metricsEndpoint, "web.telemetry-path", "/metrics", "Path under which to expose metrics.") serverCmd.Flags().StringSliceVar(&scrapeURIs, "phpfpm.scrape-uri", []string{"tcp://127.0.0.1:9000/status"}, "FastCGI address, e.g. unix:///tmp/php.sock;/status or tcp://127.0.0.1:9000/status") diff --git a/cmd/version.go b/cmd/version.go index 9cb124e..6ad7252 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -31,14 +31,4 @@ var versionCmd = &cobra.Command{ func init() { RootCmd.AddCommand(versionCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // versionCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // versionCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/phpfpm/exporter.go b/phpfpm/exporter.go index 69af823..08c0fb2 100644 --- a/phpfpm/exporter.go +++ b/phpfpm/exporter.go @@ -11,12 +11,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package phpfpm provides convenient access to PHP-FPM pool data package phpfpm import ( + "sync" + "github.com/prometheus/client_golang/prometheus" "github.com/speps/go-hashids" - "sync" ) const ( diff --git a/phpfpm/phpfpm.go b/phpfpm/phpfpm.go index 5a3f1a0..06f3cba 100644 --- a/phpfpm/phpfpm.go +++ b/phpfpm/phpfpm.go @@ -17,12 +17,13 @@ package phpfpm import ( "encoding/json" "fmt" - "github.com/tomasen/fcgi_client" "io/ioutil" "net/url" "strconv" "sync" "time" + + "github.com/tomasen/fcgi_client" ) // PoolProcessRequestIdle defines a process that is idle.