kubernetes / perf-tests
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,363 units with 16,800 lines of code in units (38.6% of code).
    • 1 very long units (118 lines of code)
    • 18 long units (1,208 lines of code)
    • 222 medium size units (6,717 lines of code)
    • 328 small units (4,737 lines of code)
    • 794 very small units (4,020 lines of code)
<1% | 7% | 39% | 28% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go<1% | 7% | 39% | 28% | 23%
py0% | 5% | 39% | 22% | 32%
js0% | 0% | 60% | 38% | 1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
clusterloader2/cmd38% | 0% | 23% | 26% | 11%
clusterloader2/pkg0% | 5% | 40% | 27% | 26%
network/benchmarks0% | 25% | 38% | 22% | 12%
compare/src0% | 24% | 47% | 18% | 9%
slo-monitor/src0% | 20% | 16% | 42% | 20%
perfdash0% | 6% | 57% | 26% | 10%
dns/py0% | 9% | 32% | 18% | 39%
perfdash/www0% | 0% | 60% | 38% | 1%
util-images/network0% | 0% | 30% | 47% | 21%
benchmark/pkg0% | 0% | 30% | 36% | 33%
verify0% | 0% | 56% | 37% | 5%
dns/dnsperfgo0% | 0% | 53% | 38% | 8%
clusterloader2/api0% | 0% | 21% | 33% | 45%
benchmark/cmd0% | 0% | 54% | 30% | 15%
dns/jsonify0% | 0% | 31% | 46% | 21%
util-images/access-tokens0% | 0% | 61% | 15% | 23%
verify/boilerplate0% | 0% | 35% | 21% | 43%
util-images/probes0% | 0% | 0% | 55% | 44%
util-images/sleep0% | 0% | 0% | 65% | 34%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in clusterloader2/cmd/clusterloader.go
118 33 0
func main()
in compare/src/main/result-comparator.go
91 26 0
func()
in slo-monitor/src/monitors/pod_monitor.go
89 8 1
func createRCs()
in network/benchmarks/netperf/launch.go
85 6 1
func()
in clusterloader2/pkg/measurement/common/wait_for_controlled_pods.go
75 14 1
func NewResourceUsageGatherer()
in clusterloader2/pkg/measurement/util/gatherers/container_resource_gatherer.go
73 18 6
func()
in clusterloader2/pkg/measurement/common/resource_usage.go
73 17 1
func createServices()
in network/benchmarks/netperf/launch.go
71 5 1
func()
in clusterloader2/pkg/imagepreload/imagepreload.go
68 12 1
func ProcessSingleTest()
in compare/src/scraper.go
66 17 2
func()
in clusterloader2/pkg/measurement/common/wait_for_controlled_pods.go
65 15 1
func()
in clusterloader2/pkg/prometheus/prometheus.go
63 23 1
func NewController()
in clusterloader2/pkg/prometheus/prometheus.go
60 10 1
func run()
in perfdash/perfdash.go
57 11 0
func()
in clusterloader2/pkg/measurement/common/metrics/metrics_grabber.go
56 14 1
def go()
in dns/py/runner.py
56 11 1
func WaitForPods()
in clusterloader2/pkg/measurement/util/wait_for_pods.go
55 20 3
func allocateWorkToClient()
in network/benchmarks/netperf/nptest/nptest.go
53 15 2
func()
in clusterloader2/pkg/measurement/common/loadbalancer_nodesync_latency.go
52 12 1
func()
in clusterloader2/pkg/measurement/common/slos/api_responsiveness_prometheus.go
50 11 1