(schemaManager schemaManager, vectorRepo VectorRepo, config *config.WeaviateConfig, logger logrus.FieldLogger, reg prometheus.Registerer, )
| 49 | } |
| 50 | |
| 51 | func 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 | |
| 82 | func (m *AutoSchemaManager) autoSchema(ctx context.Context, principal *models.Principal, |
| 83 | allowCreateClass bool, classes map[string]versioned.Class, objects ...*models.Object, |
searching dependent graphs…