@@ -23,6 +23,7 @@ package cmd
2323import (
2424 "bytes"
2525 "encoding/json"
26+ "fmt"
2627 "io/ioutil"
2728 "log"
2829 "net/http"
@@ -59,6 +60,7 @@ var sqsEndpoint string
5960var parallelRequests int
6061var svc * sqs.SQS
6162var httpClient * http.Client
63+ var port int
6264
6365// RootCmd represents the base command when called without any subcommands
6466var RootCmd = & cobra.Command {
@@ -86,6 +88,7 @@ func init() {
8688 RootCmd .PersistentFlags ().StringVar (& awsRegion , "aws-region" , "us-east-1" , "AWS Region for the SQS queue" )
8789 RootCmd .PersistentFlags ().StringVar (& sqsEndpoint , "sqs-endpoint" , "" , "SQS Endpoint for using with fake_sqs" )
8890 RootCmd .PersistentFlags ().IntVar (& parallelRequests , "parallel" , 1 , "Number of messages to be consumed in parallel" )
91+ RootCmd .PersistentFlags ().IntVar (& port , "port" , 8090 , "Port used by metrics server" )
8992
9093 httpClient = & http.Client {}
9194}
@@ -128,7 +131,7 @@ func startGohaqd(cmd *cobra.Command, args []string) {
128131 }
129132
130133 http .Handle ("/metrics" , promhttp .Handler ())
131- log .Fatal (http .ListenAndServe (":8080" , nil ))
134+ log .Fatal (http .ListenAndServe (":" + fmt . Sprint ( port ) , nil ))
132135}
133136
134137func initializeQueue (queue Queue ) {
0 commit comments