From 71b976250175dbdb2bd0519ec3061ee9d4d728bc Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Fri, 10 Apr 2020 16:47:15 -0500 Subject: [PATCH] Address review feedback again --- executor.go | 1 - fragment.go | 2 +- server/grpc.go | 26 ++++---------------------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/executor.go b/executor.go index f2cd94dff..702d0321c 100644 --- a/executor.go +++ b/executor.go @@ -2251,7 +2251,6 @@ func (e *executor) executeRowShard(ctx context.Context, index string, c *pql.Cal return rows[0], nil } row := rows[0].Union(rows[1:]...) - f.Stats.Count(MetricRow, 1, 1.0) return row, nil } diff --git a/fragment.go b/fragment.go index 285092732..78ef0597f 100644 --- a/fragment.go +++ b/fragment.go @@ -575,7 +575,7 @@ func (f *fragment) unprotectedSetBit(rowID, columnID uint64) (changed bool, err // a new copy if no one's reading it. f.rowCache.Add(rowID, nil) - f.stats.Count(MetricSetBit, 1, 0.001) + f.stats.Count(MetricSetBit, 1, 1.0) // Update row count if they have increased. if rowID > f.maxRowID { diff --git a/server/grpc.go b/server/grpc.go index 3e0ada18b..dcac5cc02 100644 --- a/server/grpc.go +++ b/server/grpc.go @@ -66,7 +66,6 @@ func (h grpcHandler) QueryPQL(req *pb.QueryPQLRequest, stream pb.Pilosa_QueryPQL Index: req.Index, Query: req.Pql, } - statsTags := make([]string, 0, 5) t := time.Now() resp, err := h.api.Query(context.Background(), &query) @@ -87,16 +86,8 @@ func (h grpcHandler) QueryPQL(req *pb.QueryPQLRequest, stream pb.Pilosa_QueryPQL } } durFormat := time.Since(t) - if query.Remote { - statsTags = append(statsTags, "where:external") - } else { - statsTags = append(statsTags, "where:internal") - } - stats := h.stats.WithTags(statsTags...) - if stats != nil { - stats.Timing(pilosa.MetricGRPCStreamQueryDurationSeconds, durQuery, 0.1) - stats.Timing(pilosa.MetricGRPCStreamFormatDurationSeconds, durFormat, 0.1) - } + h.stats.Timing(pilosa.MetricGRPCStreamQueryDurationSeconds, durQuery, 0.1) + h.stats.Timing(pilosa.MetricGRPCStreamFormatDurationSeconds, durFormat, 0.1) return nil } @@ -107,7 +98,6 @@ func (h grpcHandler) QueryPQLUnary(ctx context.Context, req *pb.QueryPQLRequest) Index: req.Index, Query: req.Pql, } - statsTags := make([]string, 0, 5) t := time.Now() resp, err := h.api.Query(context.Background(), &query) @@ -131,16 +121,8 @@ func (h grpcHandler) QueryPQLUnary(ctx context.Context, req *pb.QueryPQLRequest) response.Rows = append(response.Rows, &pb.Row{Columns: row.Columns}) } durFormat := time.Since(t) - if query.Remote { - statsTags = append(statsTags, "where:external") - } else { - statsTags = append(statsTags, "where:internal") - } - stats := h.stats.WithTags(statsTags...) - if stats != nil { - h.stats.Timing(pilosa.MetricGRPCUnaryQueryDurationSeconds, durQuery, 0.1) - h.stats.Timing(pilosa.MetricGRPCUnaryFormatDurationSeconds, durFormat, 0.1) - } + h.stats.Timing(pilosa.MetricGRPCUnaryQueryDurationSeconds, durQuery, 0.1) + h.stats.Timing(pilosa.MetricGRPCUnaryFormatDurationSeconds, durFormat, 0.1) return response, nil }