github.com/GuanceCloud/cliutils@v1.1.21/pprofparser/service/parsing/display.go (about)

     1  package parsing
     2  
     3  import (
     4  	"github.com/GuanceCloud/cliutils/pprofparser/domain/events"
     5  )
     6  
     7  type DisplayCtl interface {
     8  	ShowInTrace(e events.Type) bool
     9  	ShowInProfile(e events.Type) bool
    10  }
    11  
    12  type DDTrace struct{}
    13  
    14  func (D DDTrace) ShowInTrace(e events.Type) bool {
    15  	return e.GetShowPlaces()&events.ShowInTrace > 0
    16  }
    17  
    18  func (D DDTrace) ShowInProfile(e events.Type) bool {
    19  	return e.GetShowPlaces()&events.ShowInProfile > 0
    20  }
    21  
    22  type PyroscopeNodejs struct{}
    23  
    24  func (p *PyroscopeNodejs) ShowInTrace(_ events.Type) bool {
    25  	return false
    26  }
    27  func (p *PyroscopeNodejs) ShowInProfile(_ events.Type) bool {
    28  	return true
    29  }