(b *testing.B)
| 550 | } |
| 551 | |
| 552 | func BenchmarkCompression(b *testing.B) { |
| 553 | benchmarks := []struct { |
| 554 | name string |
| 555 | compressionType string |
| 556 | }{ |
| 557 | { |
| 558 | name: "test with gzip compression", |
| 559 | compressionType: "gzip", |
| 560 | }, |
| 561 | { |
| 562 | name: "test with zstd compression", |
| 563 | compressionType: "zstd", |
| 564 | }, |
| 565 | { |
| 566 | name: "test with no compression", |
| 567 | compressionType: "identity", |
| 568 | }, |
| 569 | } |
| 570 | sizes := []struct { |
| 571 | name string |
| 572 | metricCount int |
| 573 | labelCount int |
| 574 | labelLength int |
| 575 | metricLength int |
| 576 | }{ |
| 577 | { |
| 578 | name: "small", |
| 579 | metricCount: 50, |
| 580 | labelCount: 5, |
| 581 | labelLength: 5, |
| 582 | metricLength: 5, |
| 583 | }, |
| 584 | { |
| 585 | name: "medium", |
| 586 | metricCount: 500, |
| 587 | labelCount: 10, |
| 588 | labelLength: 5, |
| 589 | metricLength: 10, |
| 590 | }, |
| 591 | { |
| 592 | name: "large", |
| 593 | metricCount: 5000, |
| 594 | labelCount: 10, |
| 595 | labelLength: 5, |
| 596 | metricLength: 10, |
| 597 | }, |
| 598 | { |
| 599 | name: "extra-large", |
| 600 | metricCount: 50000, |
| 601 | labelCount: 20, |
| 602 | labelLength: 5, |
| 603 | metricLength: 10, |
| 604 | }, |
| 605 | } |
| 606 | |
| 607 | for _, size := range sizes { |
| 608 | reg := prometheus.NewRegistry() |
| 609 | handler := HandlerFor(reg, HandlerOpts{}) |
nothing calls this directly
no test coverage detected