You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/10/13 16:07:30 UTC

[GitHub] [beam] lostluck commented on a change in pull request #15717: [BEAM-11097] Update cache with metrics counting, windowing

lostluck commented on a change in pull request #15717:
URL: https://github.com/apache/beam/pull/15717#discussion_r728225713



##########
File path: sdks/go/pkg/beam/core/runtime/harness/statecache/statecache.go
##########
@@ -44,18 +52,19 @@ type token string
 type SideInputCache struct {
 	capacity    int
 	mu          sync.Mutex
-	cache       map[token]exec.ReStream
+	cache       map[cacheKey]exec.ReStream
 	idsToTokens map[string]token
 	validTokens map[token]int8 // Maps tokens to active bundle counts
 	metrics     CacheMetrics
 }
 
 // CacheMetrics stores metrics for the cache across a pipeline run.
 type CacheMetrics struct {
-	Hits           int64
-	Misses         int64
-	Evictions      int64
-	InUseEvictions int64
+	Hits           *metrics.Counter
+	Misses         *metrics.Counter
+	Evictions      *metrics.Counter
+	InUseEvictions *metrics.Counter
+	ReStreamErrors *metrics.Counter

Review comment:
       style nit: Go permits singlelining field declarations when the types are the same, for scenarios exactly like this.
   `Hits, Misses, Evictions, InUseEvictions, ReStreamErrors int64`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org