apf: add initial and final seats to httplog

This commit is contained in:
Abu Kashem 2021-11-23 10:26:10 -05:00
parent 0cae5f5006
commit be085b6345
No known key found for this signature in database
GPG Key ID: 33A4FA7088DB68A9

View File

@ -111,6 +111,7 @@ func WithPriorityAndFairness(
httplog.AddKeyValue(ctx, "apf_pl", truncateLogField(pl.Name)) httplog.AddKeyValue(ctx, "apf_pl", truncateLogField(pl.Name))
httplog.AddKeyValue(ctx, "apf_fs", truncateLogField(fs.Name)) httplog.AddKeyValue(ctx, "apf_fs", truncateLogField(fs.Name))
httplog.AddKeyValue(ctx, "apf_fd", truncateLogField(flowDistinguisher)) httplog.AddKeyValue(ctx, "apf_fd", truncateLogField(flowDistinguisher))
<<<<<<< HEAD
} }
// estimateWork is called, if at all, after noteFn // estimateWork is called, if at all, after noteFn
estimateWork := func() flowcontrolrequest.WorkEstimate { estimateWork := func() flowcontrolrequest.WorkEstimate {
@ -123,7 +124,12 @@ func WithPriorityAndFairness(
return workEstimator(r, "", "") return workEstimator(r, "", "")
} }
return workEstimator(r, classification.FlowSchemaName, classification.PriorityLevelName) workEstimate := workEstimator(r, classification.FlowSchemaName, classification.PriorityLevelName)
if klog.V(4).Enabled() {
httplog.AddKeyValue(ctx, "apf_iseats", workEstimate.InitialSeats)
httplog.AddKeyValue(ctx, "apf_fseats", workEstimate.FinalSeats)
}
return workEstimate
} }
var served bool var served bool