MCPcopy
hub / github.com/weaviate/weaviate / NewAutoSchemaManager

Function NewAutoSchemaManager

usecases/objects/auto_schema.go:51–80  ·  view source on GitHub ↗
(schemaManager schemaManager, vectorRepo VectorRepo,
	config *config.WeaviateConfig, logger logrus.FieldLogger,
	reg prometheus.Registerer,
)

Source from the content-addressed store, hash-verified

49}
50
51func NewAutoSchemaManager(schemaManager schemaManager, vectorRepo VectorRepo,
52 config *config.WeaviateConfig, logger logrus.FieldLogger,
53 reg prometheus.Registerer,
54) *AutoSchemaManager {
55 r := promauto.With(reg)
56
57 tenantsCount := r.NewCounter(
58 prometheus.CounterOpts{
59 Name: "weaviate_auto_tenant_total",
60 Help: "Total number of tenants processed",
61 },
62 )
63
64 opDuration := r.NewHistogramVec(
65 prometheus.HistogramOpts{
66 Name: "weaviate_auto_tenant_duration_seconds",
67 Help: "Time spent in auto tenant operations",
68 },
69 []string{"operation"},
70 )
71
72 return &AutoSchemaManager{
73 schemaManager: schemaManager,
74 vectorRepo: vectorRepo,
75 config: config.Config.AutoSchema,
76 logger: logger,
77 tenantsCount: tenantsCount,
78 opsDuration: opDuration,
79 }
80}
81
82func (m *AutoSchemaManager) autoSchema(ctx context.Context, principal *models.Principal,
83 allowCreateClass bool, classes map[string]versioned.Class, objects ...*models.Object,

Calls 1

WithMethod · 0.80

Used in the wild real call sites across dependent graphs

searching dependent graphs…