Home / Function/ Benchmark_StartServices() — fiber Function Reference

Benchmark_StartServices() — fiber Function Reference

Architecture documentation for the Benchmark_StartServices() function in services_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  2b899e39_81d1_99fb_e1ba_1ad5469ab9b5["Benchmark_StartServices()"]
  a3b050d2_f10a_df85_e082_e3ac664a6a6c["services_test.go"]
  2b899e39_81d1_99fb_e1ba_1ad5469ab9b5 -->|defined in| a3b050d2_f10a_df85_e082_e3ac664a6a6c
  style 2b899e39_81d1_99fb_e1ba_1ad5469ab9b5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

services_test.go lines 507–548

func Benchmark_StartServices(b *testing.B) {
	benchmarkFn := func(b *testing.B, services []Service) {
		b.Helper()

		for b.Loop() {
			app := New(Config{
				Services: services,
			})

			ctx := context.Background()
			if err := app.startServices(ctx); err != nil {
				b.Fatal("Expected no error but got", err)
			}
		}
	}

	b.Run("no-services", func(b *testing.B) {
		benchmarkFn(b, []Service{})
	})

	b.Run("single-service", func(b *testing.B) {
		benchmarkFn(b, []Service{
			&mockService{name: "dep1"},
		})
	})

	b.Run("multiple-services", func(b *testing.B) {
		benchmarkFn(b, []Service{
			&mockService{name: "dep1"},
			&mockService{name: "dep2"},
			&mockService{name: "dep3"},
		})
	})

	b.Run("multiple-services-with-delays", func(b *testing.B) {
		benchmarkFn(b, []Service{
			&mockService{name: "dep1", startDelay: 1 * time.Millisecond},
			&mockService{name: "dep2", startDelay: 2 * time.Millisecond},
			&mockService{name: "dep3", startDelay: 3 * time.Millisecond},
		})
	})
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Benchmark_StartServices() do?
Benchmark_StartServices() is a function in the fiber codebase, defined in services_test.go.
Where is Benchmark_StartServices() defined?
Benchmark_StartServices() is defined in services_test.go at line 507.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free