Documentation ¶
Index ¶
Constants ¶
View Source
const (
RLServerAddressKey = "RL_SERVER_ADDRESS"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Returns latest metrics present in load Watcher cache GetLatestWatcherMetrics() (*metricstype.WatcherMetrics, error) // for statistics based load variation balancing plugin, reduce some redunant data GetCompactWatcherMetrics() (*metricstype.WatcherMetrics, error) Healthy() error }
Watcher Client API
func NewLibraryClient ¶
func NewLibraryClient(opts metricsprovider.MetricsProviderOpts) (Client, error)
Creates a new watcher client when using watcher as a library
func NewServiceClient ¶
Creates a new watcher client when using watcher as a service
type PredictResponceResult ¶
func (*PredictResponceResult) NKeys ¶
func (rl *PredictResponceResult) NKeys() int
func (*PredictResponceResult) UnmarshalJSONObject ¶
func (rl *PredictResponceResult) UnmarshalJSONObject(dec *gojay.Decoder, key string) error
type RLClient ¶
type RLClient struct {
// contains filtered or unexported fields
}
func NewRLClient ¶
func (RLClient) Predict ¶
func (c RLClient) Predict(request RLClientPredictRequest) (*RLClientPredictResponce, error)
func (RLClient) Update ¶
func (c RLClient) Update(request RLClientUpdateRequest) error
type RLClientPredictRequest ¶
type RLClientPredictRequest struct { PodName string `json:"pod_name"` PodLabel string `json:"pod_label"` Nodes []string `json:"nodes"` }
func MakePredictRequest ¶
func MakePredictRequest(podName, podLabel string, nodes []string) (RLClientPredictRequest, error)
type RLClientPredictResponce ¶
type RLClientPredictResponce struct { State string `json:"state"` Message string `json:"message"` Result PredictResponceResult `json:"result"` }
func (*RLClientPredictResponce) NKeys ¶
func (rl *RLClientPredictResponce) NKeys() int
func (*RLClientPredictResponce) UnmarshalJSONObject ¶
func (rl *RLClientPredictResponce) UnmarshalJSONObject(dec *gojay.Decoder, key string) error
type RLClientUpdateRequest ¶
type RLClientUpdateRequest struct { Timestamp int64 `json:"tiemstamp"` PodName string `json:"pod_name"` Metrics metricstype.WatcherMetrics `json:"metrics"` }
func MakeUpdateReuqest ¶
func MakeUpdateReuqest(podName string, metrics metricstype.WatcherMetrics) (RLClientUpdateRequest, error)
Click to show internal directories.
Click to hide internal directories.