You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Adds support for -server mode and concurrently downloading dashboards (#21)
* adds error logger to logger package
* sets up flag to run detection on a periodic interval
* Working now. Added flag for -server mode. Added a web server with an /output route which returns a JSON payload of dashboard objects that are still using angular. Updates the in memory representation of that list every (default) 10m interval. This can be hooked up directly to grafana via the infinity data source plugin
* moves flag handling to flags.go package. cleans up http handler
* comment
* setup flag for server port
* add comment
* add readiness probe since full detections can take 5+ minutes. refactors for loop on channel to be after http server is setup
* update readiness check to use sync.Once. Creates struct with mutex for output data
* add support for concurrently download dashboards to speed up detection runs
* update test
* refactor
* Fix CLI mode not working
* refactor
* more refactoring
* moved run channel inside loop goroutine
* removed context with cancel
* incorporate PR feedback
* do not set feault server args
* add log when running dector
* add a log statement when interval ticker is setup for periodic runs
* sets up runServer method with graceful termintion
* Update flags/flags.go
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
* Update flags/flags.go
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
* Update main.go
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
* rename handleOutputRequest to handleDetectionsRequest
* Update flags/flags.go
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
---------
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
flag.DurationVar(&flags.Interval, "interval", 5*time.Minute, "detection refresh interval when running in HTTP server mode")
27
+
flag.StringVar(&flags.Server, "server", "", "Run as HTTP server instead of CLI. Value must be a listen address (e.g.: 0.0.0.0:5000. Output is exposed as JSON at /detections.")
28
+
flag.IntVar(&flags.MaxConcurrency, "max-concurrency", 10, "maximum number of concurrent dashboard downloads")
0 commit comments