Skip to content

Commit

Permalink
acpq: render debug logs early
Browse files Browse the repository at this point in the history
  • Loading branch information
majewsky committed Dec 16, 2024
1 parent 084a81b commit a416f55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/datamodel/apply_computed_project_quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ func ApplyComputedProjectQuota(serviceType db.ServiceType, resourceName liquid.R

// evaluate QD algorithm
// AZ separated basequota will be assigned to all available AZs
target, allowsQuotaOvercommit := acpqComputeQuotas(stats, cfg, constraints, resInfo)
if logg.ShowDebug {
// NOTE: The structs that contain pointers must be printed as JSON to actually show all values.
logg.Debug("ACPQ for %s/%s: stats = %#v", serviceType, resourceName, stats)
logg.Debug("ACPQ for %s/%s: cfg = %#v", serviceType, resourceName, cfg)
buf, _ := json.Marshal(constraints) //nolint:errcheck
logg.Debug("ACPQ for %s/%s: constraints = %s", serviceType, resourceName, string(buf))
}
target, allowsQuotaOvercommit := acpqComputeQuotas(stats, cfg, constraints, resInfo)
if logg.ShowDebug {
logg.Debug("ACPQ for %s/%s: allowsQuotaOvercommit = %#v", serviceType, resourceName, allowsQuotaOvercommit)
buf, _ = json.Marshal(target) //nolint:errcheck
buf, _ := json.Marshal(target) //nolint:errcheck
logg.Debug("ACPQ for %s/%s: target = %s", serviceType, resourceName, string(buf))
}

Expand Down

0 comments on commit a416f55

Please sign in to comment.