Skip to content

Commit

Permalink
Add initialization logging
Browse files Browse the repository at this point in the history
Signed-off-by: Renaud Gaubert <[email protected]>
  • Loading branch information
Renaud Gaubert committed May 2, 2020
1 parent d80538d commit 0a2895d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,16 @@ func main() {

func Run(c *cli.Context) error {
restart:

logrus.Info("Starting dcgm-exporter")
config := contextToConfig(c)

cleanup, err := dcgm.Init(dcgm.Embedded)
defer cleanup()
if err != nil {
logrus.Fatal(err)
}
logrus.Info("DCGM successfully initialized!")

ch := make(chan string, 10)
pipeline, cleanup, err := NewMetricsPipeline(config)
Expand Down
2 changes: 2 additions & 0 deletions pkg/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func NewMetricsPipelineWithGPUCollector(c *Config, collector *DCGMCollector) (*M
func (m *MetricsPipeline) Run(out chan string, stop chan interface{}, wg *sync.WaitGroup) {
defer wg.Done()

logrus.Info("Pipeline starting")

// Note we are using a ticker so that we can stick as close as possible to the collect interval.
// e.g: The CollectInterval is 10s and the transformation pipeline takes 5s, the time will
// ensure we really collect metrics every 10s by firing an event 5s after the run function completes.
Expand Down
1 change: 1 addition & 0 deletions pkg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (s *MetricsServer) Run(stop chan interface{}, wg *sync.WaitGroup) {
httpwg.Add(1)
go func() {
defer httpwg.Done()
logrus.Info("Starting webserver")
if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
logrus.Fatalf("Failed to Listen and Server HTTP server with err: `%v`", err)
}
Expand Down

0 comments on commit 0a2895d

Please sign in to comment.