Documentation
¶
Index ¶
- Constants
- Variables
- type Datasets
- type DetailedFeedback
- type DumpStats
- type Master
- func (m *Master) CreateWebService()
- func (m *Master) GetItem(score cache.Score) (any, error)
- func (m *Master) GetMeta(ctx context.Context, nodeInfo *protocol.NodeInfo) (*protocol.Meta, error)
- func (m *Master) GetUser(score cache.Score) (any, error)
- func (m *Master) LoadDataFromDatabase(ctx context.Context, database data.Database, ...) (ctrDataset *ctr.Dataset, dataSet *dataset.Dataset, err error)
- func (m *Master) LoginFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- func (m *Master) PushProgress(_ context.Context, in *protocol.PushProgressRequest) (*protocol.PushProgressResponse, error)
- func (m *Master) Restore(r io.ReadCloser) (stats DumpStats, err error)
- func (m *Master) RunTasksLoop()
- func (m *Master) Serve()
- func (m *Master) Shutdown()
- func (m *Master) StartHttpServer()
- type OnlineEvaluator
- type ScoreUser
- type ScoredItem
- type SinglePageAppFileSystem
- type Status
- type User
- type UserInfo
- type UserIterator
Constants ¶
View Source
const ( LabelFeedbackType = "feedback_type" LabelStep = "step" LabelData = "data" )
View Source
const ( EOF = int64(0) UserStream = int64(-1) ItemStream = int64(-2) FeedbackStream = int64(-3) )
Variables ¶
View Source
var ( LoadDatasetStepSecondsVec = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "load_dataset_step_seconds", }, []string{LabelStep}) LoadDatasetTotalSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "load_dataset_total_seconds", }) FindUserNeighborsSecondsVec = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "find_user_neighbors_seconds", }, []string{LabelStep}) FindUserNeighborsTotalSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "find_user_neighbors_total_seconds", }) FindItemNeighborsSecondsVec = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "find_item_neighbors_seconds", }, []string{"step"}) FindItemNeighborsTotalSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "find_item_neighbors_total_seconds", }) UpdateUserNeighborsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "update_user_neighbors_total", }) UpdateItemNeighborsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "update_item_neighbors_total", }) CacheScannedTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "cache_scanned_total", }) CacheReclaimedTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "cache_reclaimed_total", }) CacheScannedSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "cache_scanned_seconds", }) CollaborativeFilteringFitSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "collaborative_filtering_fit_seconds", }) CollaborativeFilteringSearchSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "collaborative_filtering_search_seconds", }) CollaborativeFilteringNDCG10 = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "collaborative_filtering_ndcg_10", }) CollaborativeFilteringPrecision10 = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "collaborative_filtering_precision_10", }) CollaborativeFilteringRecall10 = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "collaborative_filtering_recall_10", }) CollaborativeFilteringSearchPrecision10 = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "collaborative_filtering_search_precision_10", }) RankingFitSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "ranking_fit_seconds", }) RankingSearchSeconds = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "ranking_search_seconds", }) RankingPrecision = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "ranking_model_precision", }) RankingRecall = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "ranking_model_recall", }) RankingAUC = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "ranking_model_auc", }) RankingSearchPrecision = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "ranking_search_precision", }) UsersTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "users_total", }) ActiveUsersTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "active_users_total", }) InactiveUsersTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "inactive_users_total", }) ItemsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "items_total", }) ActiveItemsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "active_items_total", }) InactiveItemsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "inactive_items_total", }) UserLabelsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "user_labels_total", }) ItemLabelsTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "item_labels_total", }) FeedbacksTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "feedbacks_total", }) ImplicitFeedbacksTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "implicit_feedbacks_total", }) PositiveFeedbacksTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "positive_feedbacks_total", }) NegativeFeedbackTotal = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "negative_feedbacks_total", }) MemoryInUseBytesVec = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "gorse", Subsystem: "master", Name: "memory_inuse_bytes", }, []string{LabelData}) )
Functions ¶
This section is empty.
Types ¶
type DetailedFeedback ¶
type Master ¶
type Master struct {
protocol.UnimplementedMasterServer
server.RestServer
// contains filtered or unexported fields
}
Master is the master node.
func (*Master) CreateWebService ¶
func (m *Master) CreateWebService()
func (*Master) LoadDataFromDatabase ¶
func (m *Master) LoadDataFromDatabase( ctx context.Context, database data.Database, posFeedbackTypes, readTypes []expression.FeedbackTypeExpression, itemTTL, positiveFeedbackTTL uint, evaluator *OnlineEvaluator, nonPersonalizedRecommenders []*logics.NonPersonalized, ) (ctrDataset *ctr.Dataset, dataSet *dataset.Dataset, err error)
LoadDataFromDatabase loads dataset from data store.
func (*Master) LoginFilter ¶
func (*Master) PushProgress ¶
func (m *Master) PushProgress( _ context.Context, in *protocol.PushProgressRequest) (*protocol.PushProgressResponse, error)
func (*Master) RunTasksLoop ¶
func (m *Master) RunTasksLoop()
func (*Master) StartHttpServer ¶
func (m *Master) StartHttpServer()
type OnlineEvaluator ¶
type OnlineEvaluator struct {
ReadTypes []expression.FeedbackTypeExpression
ReadFeedback []map[int32]mapset.Set[int32]
PositiveTypes []expression.FeedbackTypeExpression
PositiveFeedback map[string]map[int32]mapset.Set[int32]
WindowSize int
WindowEnd time.Time
}
func NewOnlineEvaluator ¶
func NewOnlineEvaluator(positiveTypes, readTypes []expression.FeedbackTypeExpression) *OnlineEvaluator
func (*OnlineEvaluator) Evaluate ¶
func (evaluator *OnlineEvaluator) Evaluate() []cache.TimeSeriesPoint
type ScoredItem ¶
type SinglePageAppFileSystem ¶
type SinglePageAppFileSystem struct {
// contains filtered or unexported fields
}
SinglePageAppFileSystem is the file system for single page app.
type Status ¶
type Status struct {
BinaryVersion string
NumServers int
NumWorkers int
NumUsers int
NumItems int
NumUserLabels int
NumItemLabels int
NumTotalPosFeedback int
NumValidPosFeedback int
NumValidNegFeedback int
PopularItemsUpdateTime time.Time
LatestItemsUpdateTime time.Time
MatchingModelFitTime time.Time
MatchingModelScore cf.Score
RankingModelFitTime time.Time
RankingModelScore ctr.Score
}
type UserInfo ¶
type UserInfo struct {
Name string `json:"name"`
FamilyName string `json:"family_name"`
GivenName string `json:"given_name"`
MiddleName string `json:"middle_name"`
NickName string `json:"nickname"`
Picture string `json:"picture"`
UpdatedAt string `json:"updated_at"`
Email string `json:"email"`
Verified bool `json:"email_verified"`
AuthType string `json:"auth_type"`
}
type UserIterator ¶
Click to show internal directories.
Click to hide internal directories.