github.com/lulzWill/go-agent@v2.1.2+incompatible/internal/tools/utilization/main.go (about)

     1  package main
     2  
     3  import (
     4  	"encoding/json"
     5  	"fmt"
     6  	"os"
     7  
     8  	"github.com/lulzWill/go-agent"
     9  	"github.com/lulzWill/go-agent/internal/utilization"
    10  )
    11  
    12  func main() {
    13  	util := utilization.Gather(utilization.Config{
    14  		DetectAWS:    true,
    15  		DetectAzure:  true,
    16  		DetectDocker: true,
    17  		DetectPCF:    true,
    18  		DetectGCP:    true,
    19  	}, newrelic.NewDebugLogger(os.Stdout))
    20  
    21  	js, err := json.MarshalIndent(util, "", "\t")
    22  	if err != nil {
    23  		fmt.Printf("%s\n", err)
    24  	} else {
    25  		fmt.Printf("%s\n", js)
    26  	}
    27  }