Skip to content

Commit 030136f

Browse files
committed
fix: remove unused modelTypeTag and format Go files for CI
1 parent d524ece commit 030136f

7 files changed

Lines changed: 40 additions & 45 deletions

File tree

coordinator/api/consumer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,12 @@ func (s *Server) handleChatCompletions(w http.ResponseWriter, r *http.Request) {
690690
}
691691
pr.Timing.QueuedAt = time.Now()
692692
if err := s.registry.Queue().Enqueue(queuedReq); err != nil {
693-
s.ddIncr("routing.decisions", []string{"model:" + model, "model_type:" + s.registry.ModelType(model), "outcome:over_capacity"})
693+
s.ddIncr("routing.decisions", []string{"model:" + model, "model_type:" + s.registry.ModelType(model), "outcome:over_capacity"})
694694
refundReservation()
695695
writeJSON(w, http.StatusServiceUnavailable, errorResponse("model_not_available", fmt.Sprintf("no hardware-trusted provider available for model %q and queue is full", model)))
696696
return
697697
}
698-
s.ddIncr("routing.decisions", []string{"model:" + model, "model_type:" + s.registry.ModelType(model), "outcome:queued"})
698+
s.ddIncr("routing.decisions", []string{"model:" + model, "model_type:" + s.registry.ModelType(model), "outcome:queued"})
699699

700700
s.logger.Info("request queued, waiting for provider",
701701
"model", model,

coordinator/api/server.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,6 @@ func (s *Server) ddGauge(name string, value float64, tags []string) {
362362
// modelTypeTag returns a DogStatsD tag "model_type:<type>" for the given
363363
// model ID, resolved from the registry. Returns "model_type:unknown" if
364364
// the model is not found.
365-
func (s *Server) modelTypeTag(model string) string {
366-
return "model_type:" + s.registry.ModelType(model)
367-
}
368-
369-
// emitPanic is the panic-specific emit helper. Captures stack separately.
370365
func (s *Server) emitPanic(ctx context.Context, message, stack string, fields map[string]any) {
371366
if s.emitter == nil {
372367
return

coordinator/registry/registry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ type Registry struct {
376376

377377
logger *slog.Logger
378378

379-
onlineCount atomic.Int64
380-
modelProviders map[string]*atomic.Int64
379+
onlineCount atomic.Int64
380+
modelProviders map[string]*atomic.Int64
381381
modelProvidersMu sync.Mutex
382382
}
383383

e2e/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"github.com/eigeninference/d-inference/coordinator/payments"
2020
"github.com/eigeninference/d-inference/e2e/testbed"
2121
tbassert "github.com/eigeninference/d-inference/e2e/testbed/assert"
22-
tbprofile "github.com/eigeninference/d-inference/e2e/testbed/profile"
2322
"github.com/eigeninference/d-inference/e2e/testbed/profile"
23+
tbprofile "github.com/eigeninference/d-inference/e2e/testbed/profile"
2424
)
2525

2626
var httpTimeout = 300 * time.Second

e2e/testbed/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ type ModelSpec struct {
88
}
99

1010
var KnownModelSizes = map[string]string{
11-
"mlx-community/Qwen3.5-0.8B-MLX-4bit": "0.5 GB",
12-
"mlx-community/gemma-3-270m-4bit": "0.2 GB",
11+
"mlx-community/Qwen3.5-0.8B-MLX-4bit": "0.5 GB",
12+
"mlx-community/gemma-3-270m-4bit": "0.2 GB",
1313
}
1414

1515
type TrustLevel string

e2e/testbed/load.go

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -313,36 +313,36 @@ func (r *LoadResult) SummaryTable() string {
313313

314314
if r.ProfileRun != nil && len(r.ProfileRun.SegmentTimings) > 0 {
315315
s.WriteString("\n")
316-
s.WriteString(fmt.Sprintf("%-30s %8s %8s %8s %8s %8s\n", "SEGMENT", "COUNT", "MEAN", "P50", "P95", "MAX"))
317-
s.WriteString("─────────────────────────────────────────────────────────────────────\n")
318-
319-
for _, seg := range []Segment{
320-
SegmentTotalE2E,
321-
SegmentParse,
322-
SegmentReserve,
323-
SegmentRoute,
324-
SegmentQueueWait,
325-
SegmentEncrypt,
326-
SegmentDispatch,
327-
SegmentCoordinatorToProvider,
328-
SegmentTTFT,
329-
} {
330-
durations, ok := r.ProfileRun.SegmentTimings[seg]
331-
if !ok || len(durations) == 0 {
332-
continue
333-
}
334-
stats := computeStats(durations)
335-
precision := time.Millisecond
336-
if stats.Max < time.Millisecond {
337-
precision = time.Microsecond
338-
}
339-
s.WriteString(fmt.Sprintf("%-30s %8d %8s %8s %8s %8s\n",
340-
seg, stats.Count,
341-
stats.Mean.Round(precision),
342-
stats.Median.Round(precision),
343-
stats.P95.Round(precision),
344-
stats.Max.Round(precision),
345-
))
316+
s.WriteString(fmt.Sprintf("%-30s %8s %8s %8s %8s %8s\n", "SEGMENT", "COUNT", "MEAN", "P50", "P95", "MAX"))
317+
s.WriteString("─────────────────────────────────────────────────────────────────────\n")
318+
319+
for _, seg := range []Segment{
320+
SegmentTotalE2E,
321+
SegmentParse,
322+
SegmentReserve,
323+
SegmentRoute,
324+
SegmentQueueWait,
325+
SegmentEncrypt,
326+
SegmentDispatch,
327+
SegmentCoordinatorToProvider,
328+
SegmentTTFT,
329+
} {
330+
durations, ok := r.ProfileRun.SegmentTimings[seg]
331+
if !ok || len(durations) == 0 {
332+
continue
333+
}
334+
stats := computeStats(durations)
335+
precision := time.Millisecond
336+
if stats.Max < time.Millisecond {
337+
precision = time.Microsecond
338+
}
339+
s.WriteString(fmt.Sprintf("%-30s %8d %8s %8s %8s %8s\n",
340+
seg, stats.Count,
341+
stats.Mean.Round(precision),
342+
stats.Median.Round(precision),
343+
stats.P95.Round(precision),
344+
stats.Max.Round(precision),
345+
))
346346
}
347347
}
348348

e2e/testbed/suite.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ func execCommandContext(ctx context.Context, name string, args ...string) *exec.
4444
}
4545

4646
type Suite struct {
47-
Ctx context.Context
48-
Logger *slog.Logger
49-
Config SuiteConfig
47+
Ctx context.Context
48+
Logger *slog.Logger
49+
Config SuiteConfig
5050

5151
Pg *deps.PostgresLifecycle
5252
PgStore store.Store

0 commit comments

Comments
 (0)