@@ -34,6 +34,7 @@ import (
3434	"github.com/valyala/fasthttp" 
3535	"github.com/valyala/fasthttp/fasthttpadaptor" 
3636	"golang.org/x/sync/errgroup" 
37+ 	"gopkg.in/yaml.v3" 
3738	"k8s.io/klog/v2" 
3839
3940	"github.com/llm-d/llm-d-inference-sim/pkg/common" 
@@ -847,15 +848,15 @@ func (s *VllmSimulator) getDisplayedModelName(reqModel string) string {
847848}
848849
849850func  (s  * VllmSimulator ) showConfig (dp  bool ) error  {
850- 	cfgJSON , err  :=  json .Marshal (s .config )
851+ 	cfgYAML , err  :=  yaml .Marshal (s .config )
851852	if  err  !=  nil  {
852- 		return  fmt .Errorf ("failed to marshal configuration to JSON : %w" , err )
853+ 		return  fmt .Errorf ("failed to marshal configuration to YAML : %w" , err )
853854	}
854855
855856	var  m  map [string ]interface {}
856- 	err  =  json .Unmarshal (cfgJSON , & m )
857+ 	err  =  yaml .Unmarshal (cfgYAML , & m )
857858	if  err  !=  nil  {
858- 		return  fmt .Errorf ("failed to unmarshal JSON  to map: %w" , err )
859+ 		return  fmt .Errorf ("failed to unmarshal YAML  to map: %w" , err )
859860	}
860861	if  dp  {
861862		// remove the port 
@@ -871,12 +872,12 @@ func (s *VllmSimulator) showConfig(dp bool) error {
871872		delete (field , "LorasString" )
872873	}
873874
874- 	// show in JSON  
875- 	cfgJSON , err  =  json . MarshalIndent ( m ,  "" ,  "  " )
875+ 	// show in YAML  
876+ 	cfgYAML , err  =  yaml . Marshal ( m )
876877	if  err  !=  nil  {
877- 		return  fmt .Errorf ("failed to marshal configuration to JSON : %w" , err )
878+ 		return  fmt .Errorf ("failed to marshal configuration to YAML : %w" , err )
878879	}
879- 	s .logger .Info ("Configuration:" , "" , string (cfgJSON ))
880+ 	s .logger .Info ("Configuration:" , "" , string (cfgYAML ))
880881	return  nil 
881882}
882883
0 commit comments