Unverified Commit c00f28cd authored by James Bartlett's avatar James Bartlett Committed by Copybara
Browse files

Track unnamed script execution times.


Summary: Previously, we ignored unnamed script executions when tracking query exec time metrics. This diff changes the behaviour such that all unnamed scripts execution time are tracked together in a single summary.

Test Plan: Tested in skaffold, saw the metrics in the testing vzmetrics.

Reviewers: philkuz, vihang, nserrino

Reviewed By: philkuz, vihang
Signed-off-by: default avatarJames Bartlett <jamesbartlett@pixielabs.ai>

Differential Revision: https://phab.corp.pixielabs.ai/D11386

GitOrigin-RevId: 48e047c85fc9b05e7d00fd66ea8d6cd26e29101c
Showing with 4 additions and 3 deletions
+4 -3
......@@ -155,8 +155,9 @@ func (q *QueryExecutorImpl) Run(ctx context.Context, req *vizierpb.ExecuteScript
q.queryID = queryID
}
if req.QueryName != "" {
q.queryName = req.QueryName
q.queryName = req.QueryName
if q.queryName == "" {
q.queryName = "unnamed"
}
resultCh := make(chan *vizierpb.ExecuteScriptResponse)
......@@ -174,7 +175,7 @@ func (q *QueryExecutorImpl) Wait() error {
err := q.eg.Wait()
if err == nil {
// Only track execution time for named scripts.
if q.queryExecTimeSummary != nil && q.queryName != "" {
if q.queryExecTimeSummary != nil {
d := time.Since(q.startTime)
q.queryExecTimeSummary.With(prometheus.Labels{"script_name": q.queryName}).Observe(float64(d.Milliseconds()))
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment