awslabs / multi-model-server
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 993 units with 7,697 lines of code in units (75.8% of code).
    • 1 very long units (113 lines of code)
    • 15 long units (996 lines of code)
    • 78 medium size units (2,484 lines of code)
    • 81 small units (1,170 lines of code)
    • 818 very small units (2,934 lines of code)
1% | 12% | 32% | 15% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py6% | 11% | 30% | 20% | 32%
java0% | 13% | 32% | 13% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mms20% | 0% | 46% | 10% | 22%
frontend/server0% | 16% | 30% | 13% | 39%
benchmarks0% | 36% | 17% | 18% | 27%
model-archiver/model_archiver0% | 18% | 34% | 17% | 30%
mms/protocol0% | 32% | 12% | 20% | 33%
frontend/modelarchive0% | 0% | 40% | 10% | 49%
frontend/cts0% | 0% | 57% | 18% | 23%
mms/model_service0% | 0% | 41% | 27% | 31%
mms/utils0% | 0% | 25% | 47% | 26%
plugins/endpoints0% | 0% | 28% | 31% | 40%
mms/metrics0% | 0% | 0% | 26% | 73%
ROOT0% | 0% | 0% | 60% | 39%
serving-sdk/src0% | 0% | 0% | 0% | 100%
model-archiver0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def start()
in mms/model_server.py
113 37 0
private void initModelStore()
in frontend/server/src/main/java/com/amazonaws/ml/mms/ModelServer.java
100 17 0
def run_single_benchmark()
in benchmarks/benchmark.py
84 22 2
public void run()
in frontend/server/src/main/java/com/amazonaws/ml/mms/metrics/MetricCollector.java
82 15 0
private static Operation getRegisterOperation()
in frontend/server/src/main/java/com/amazonaws/ml/mms/openapi/OpenApiUtils.java
74 2 0
private void connect()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/WorkerThread.java
74 8 0
def export_model_args_parser()
in model-archiver/model_archiver/arg_parser.py
65 2 0
private void handleRegisterModel()
in frontend/server/src/main/java/com/amazonaws/ml/mms/http/ManagementRequestHandler.java
65 8 3
public void startBackendServer()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/WorkerLifeCycle.java
64 8 1
private void runWorker()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/WorkerThread.java
58 8 0
public void run()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/WorkerThread.java
58 15 0
protected void decode()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/codec/ModelResponseDecoder.java
55 10 3
public String toSerializable()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/logging/QLogLayout.java
55 10 1
public ChannelFuture initializeServer()
in frontend/server/src/main/java/com/amazonaws/ml/mms/ModelServer.java
54 6 4
private static Operation getDescribeModelOperation()
in frontend/server/src/main/java/com/amazonaws/ml/mms/openapi/OpenApiUtils.java
54 1 0
def create_predict_response()
in mms/protocol/otf_message_handler.py
54 13 5
def convert_onnx_model()
in model-archiver/model_archiver/model_packaging_utils.py
50 11 3
public static void sendHttpResponse()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/NettyUtils.java
50 17 3
private ConfigManager()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/ConfigManager.java
50 11 1
private void updateModelWorkers()
in frontend/server/src/main/java/com/amazonaws/ml/mms/http/ManagementRequestHandler.java
50 6 6