Skip to content

Commit

Permalink
dont use time.Duration which doesnt have Equal() method in proto
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
  • Loading branch information
owen-d committed Apr 16, 2024
1 parent 2292b40 commit edc19be
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 101 deletions.
2 changes: 1 addition & 1 deletion pkg/logql/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func RecordRangeAndInstantQueryMetrics(
"index_total_chunks", stats.Index.TotalChunks,
"index_post_bloom_filter_chunks", stats.Index.PostFilterChunks,
"index_bloom_filter_ratio", fmt.Sprintf("%.2f", bloomRatio),
"index_shard_resolver_duration", stats.Index.ShardsDuration,
"index_shard_resolver_duration", time.Duration(stats.Index.ShardsDuration),
}...)

logValues = append(logValues, tagsToKeyValues(queryTags)...)
Expand Down
192 changes: 98 additions & 94 deletions pkg/logqlmodel/stats/stats.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions pkg/logqlmodel/stats/stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ message Index {
// Post-filtered chunks
int64 postFilterChunks = 2 [(gogoproto.jsontag) = "postFilterChunks"];
// Nanosecond duration spent fetching shards
int64 shardsDuration = 3 [
(gogoproto.jsontag) = "shardsDuration",
(gogoproto.customtype) = "time.Duration",
(gogoproto.nullable) = false
];
int64 shardsDuration = 3 [(gogoproto.jsontag) = "shardsDuration"];
}

message Querier {
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (m MonitoredReaderWriter) GetShards(
// 2) when we resolve shards from the index + blooms
// NB(owen-d): since this is measured by the callee, it does not include time in queue,
// over the wire, etc.
shards.Statistics.Index.ShardsDuration = time.Since(start)
shards.Statistics.Index.ShardsDuration = int64(time.Since(start))
}

return err
Expand Down

0 comments on commit edc19be

Please sign in to comment.