| 379 | } |
| 380 | |
| 381 | func newDataToEncode(c *cache.Cache) *dataToEncode { |
| 382 | return &dataToEncode{ |
| 383 | cache: c, |
| 384 | |
| 385 | metricNames: mapset.NewSet[string](), |
| 386 | labelNames: mapset.NewSet[string](), |
| 387 | labelValues: mapset.NewSet[string](), |
| 388 | metricAPPLabelLayouts: mapset.NewSet[cache.LayoutKey](), |
| 389 | labels: mapset.NewSet[cache.LabelKey](), |
| 390 | metricNameToLabelNames: make(map[string]mapset.Set[string], 0), |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | func (d *dataToEncode) cardinality() int { |
| 395 | return d.metricNames.Cardinality() + d.labelNames.Cardinality() + d.labelValues.Cardinality() + |