Documentation
¶
Index ¶
- Constants
- func SingleProfileHandlerFactory(name string, _ *json.Decoder, _ fwkplugin.Handle) (fwkplugin.Plugin, error)
- type SingleProfileHandler
- func (h *SingleProfileHandler) Pick(_ context.Context, request *fwksched.InferenceRequest, ...) map[string]fwksched.SchedulerProfile
- func (h *SingleProfileHandler) ProcessResults(_ context.Context, _ *fwksched.InferenceRequest, ...) (*fwksched.SchedulingResult, error)
- func (h *SingleProfileHandler) TypedName() fwkplugin.TypedName
- func (h *SingleProfileHandler) WithName(name string) *SingleProfileHandler
Constants ¶
const (
SingleProfileHandlerType = "single-profile-handler"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SingleProfileHandler ¶
type SingleProfileHandler struct {
// contains filtered or unexported fields
}
SingleProfileHandler handles a single profile which is always the primary profile.
func NewSingleProfileHandler ¶
func NewSingleProfileHandler() *SingleProfileHandler
NewSingleProfileHandler initializes a new SingleProfileHandler and returns its pointer.
func (*SingleProfileHandler) Pick ¶
func (h *SingleProfileHandler) Pick(_ context.Context, request *fwksched.InferenceRequest, profiles map[string]fwksched.SchedulerProfile, profileResults map[string]*fwksched.ProfileRunResult) map[string]fwksched.SchedulerProfile
Pick selects the SchedulingProfiles to run from the list of candidate profiles, while taking into consideration the request properties and the previously executed cycles along with their results.
func (*SingleProfileHandler) ProcessResults ¶
func (h *SingleProfileHandler) ProcessResults(_ context.Context, _ *fwksched.InferenceRequest, profileResults map[string]*fwksched.ProfileRunResult) (*fwksched.SchedulingResult, error)
ProcessResults handles the outcome of the profile runs after all profiles ran. It may aggregate results, log test profile outputs, or apply custom logic. It specifies in the SchedulingResult the key of the primary profile that should be used to get the request selected destination. When a profile run fails, its result in the profileResults map is nil.
func (*SingleProfileHandler) TypedName ¶
func (h *SingleProfileHandler) TypedName() fwkplugin.TypedName
TypedName returns the type and name tuple of this plugin instance.
func (*SingleProfileHandler) WithName ¶
func (h *SingleProfileHandler) WithName(name string) *SingleProfileHandler
WithName sets the name of the profile handler.