Skip to content

Commit

Permalink
mapic: Invert flag to skip mist stats (#213)
Browse files Browse the repository at this point in the history
* mapic: Invert flag to skip mist stats

Mist cant handle a boolean flag set to false,
its default value must be false instead and
it can only be set to true lol

* default false
  • Loading branch information
victorges authored Oct 21, 2022
1 parent 82207dc commit be9af8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/mist-api-connector/mist-api-connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func main() {
mistConnectTimeout := fs.Duration("mist-connect-timeout", 5*time.Minute, "Max time to wait attempting to connect to Mist server")
mistStreamSource := fs.String("mist-stream-source", "push://", "Stream source we should use for created Mist stream")
mistHardcodedBroadcasters := fs.String("mist-hardcoded-broadcasters", "", "Hardcoded broadcasters for use by MistProcLivepeer")
mistScrapeMetrics := fs.Bool("mist-scrape-metrics", true, "Scrape statistics from MistServer and publish to RabbitMQ")
noMistScrapeMetrics := fs.Bool("no-mist-scrape-metrics", false, "Scrape statistics from MistServer and publish to RabbitMQ")
sendAudio := fs.String("send-audio", "record", "when should we send audio? {always|never|record}")
apiToken := fs.String("api-token", "", "Token of the Livepeer API to be used by the Mist server")
apiServer := fs.String("api-server", livepeer.ACServer, "Livepeer API server to use")
Expand Down Expand Up @@ -123,7 +123,7 @@ func main() {
OwnRegion: *ownRegion,
MistStreamSource: *mistStreamSource,
MistHardcodedBroadcasters: *mistHardcodedBroadcasters,
MistScrapeMetrics: *mistScrapeMetrics,
NoMistScrapeMetrics: *noMistScrapeMetrics,
}
mc, err := mistapiconnector.NewMac(opts)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/app/mistapiconnector/mistapiconnector_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ type (
AMQPUrl, OwnRegion string
MistStreamSource string
MistHardcodedBroadcasters string
MistScrapeMetrics bool
NoMistScrapeMetrics bool
}

trackList map[string]*trackListDesc
Expand Down Expand Up @@ -263,7 +263,7 @@ func NewMac(opts MacOptions) (IMac, error) {
mistHardcodedBroadcasters: opts.MistHardcodedBroadcasters,
}
go mc.recoverSessionLoop()
if producer != nil && opts.MistScrapeMetrics {
if producer != nil && !opts.NoMistScrapeMetrics {
startMetricsCollector(ctx, statsCollectionPeriod, opts.NodeID, opts.OwnRegion, opts.MistAPI, producer, ownExchangeName, mc)
}
return mc, nil
Expand Down

0 comments on commit be9af8b

Please sign in to comment.