Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: filters/count/count.go

Issue 1247283003: Improve docs (Closed) Base URL: https://github.com/luci/gae.git@reduce_size
Patch Set: fix comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « filter/featureBreaker/tq.go ('k') | filters/count/count_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filters/count/count.go
diff --git a/filters/count/count.go b/filters/count/count.go
deleted file mode 100644
index a5478868128be9bcbb3d29e476ffe816e4f14bf6..0000000000000000000000000000000000000000
--- a/filters/count/count.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Package count contains 'counter' filters for all the gae services. This
-// serves as a set of simple example filters, and also enables other filters
-// to test to see if certain underlying APIs are called when they should be
-// (e.g. for the datastore mcache filter, for example).
-package count
-
-import (
- "sync/atomic"
-)
-
-// Entry is a success/fail pair for a single API method. It's returned
-// by the Counter interface.
-type Entry struct {
- Successes int64
- Errors int64
-}
-
-// Total is a convenience function for getting the total number of calls to
-// this API. It's Successes+Errors.
-func (e Entry) Total() int64 { return e.Successes + e.Errors }
-
-func (e *Entry) up(errs ...error) error {
- err := error(nil)
- if len(errs) > 0 {
- err = errs[0]
- }
- if err == nil {
- atomic.AddInt64(&e.Successes, 1)
- } else {
- atomic.AddInt64(&e.Errors, 1)
- }
- return err
-}
« no previous file with comments | « filter/featureBreaker/tq.go ('k') | filters/count/count_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698