Commit Graph

9 Commits

Author SHA1 Message Date
Victor Agababov 92c9752a4c
Add RecordN method to permit recording of N measurements simultaneously. (#1025)
* Add RecordN method to permit recording of N measurements simultaneously.

In serving we have many places where we try to record several metrics at the same time.
Besides very repetetive code, this also brings inefficiences, since metrics code has to do _some_ work
for every call, which is completely avoidable.

This way we can record N measurements with one hit.

* tests and nits

* review items per discussion with Evan:

- remove ros
- make measurements ...

* review
2020-01-31 11:26:28 -08:00
Matt Moore e96196e347 golang format tools (#876)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign n3wscott
2019-11-13 15:49:28 -08:00
Evan Anderson a9bdd123b7 Start moving Stackdriver and Prometheus-specific code to a strategy pattern (#812)
* Start moving Stackdriver and Prometheus-specific code to a strategy pattern.

* Respond to review feedback, add test.

* gofmt
2019-11-04 16:05:21 -08:00
Yanwei Guo 4befa47ec5 Change built-in metrics to use internal ones for activator and revision (#795)
* metrics/

* fix tests
2019-10-23 22:19:36 -07:00
Matt Moore ecb98001f2 Implement workqueue.MetricsProvider (#678)
The kubernetes workqueue provides a facility for collecting metrics by registering a workqueue.MetricsProvider
via workqueue.SetProvider.

This change implements that interface to expose the workqueue metrics into opencensus.

This is loosely based on some work started by @grantr [here](https://github.com/kubernetes-sigs/controller-runtime/compare/master...grantr:opencensus-replace#diff-bb94124aff8d568cb4e82854c7d44fd1)

Fixes: https://github.com/knative/pkg/issues/522
2019-09-16 09:55:41 -07:00
Ignacio Cano ec2f20ae67 Eventing Stackdriver integration (#612)
* adding eventing metrics, and tried to split separable things to ease
future refactors.

* updates

* updates after code review
2019-08-30 09:13:49 -07:00
Annie Fu 84d3910c56 Add metrics to webhook package (#503)
* Add metrics to webhook package

Add metricstest package for shared helper functions for testing metrics

* Address PR

* Cleanup

* Fix import paths to fix build issues

* Fix import package path for test file

* Remove unnecessary formatting from error message

* Remove helper function only used once

* Add metric name to all error messages, make checkRowTags testing helper function

* Add common histogram bucket generator function to metrics package

* Fix CheckStatsNotReported check

* Reset metrics before each test so the tests are idempotent

* Make CheckStatsNotReported conditional clearer
2019-07-08 16:00:44 -07:00
Yanwei Guo 060135fc89 Record metrics if config is nil (#315)
* record if nil

* some more comment

* some more comment

* return
2019-03-11 13:28:43 -07:00
Yanwei Guo b4a3bde045 Decide whether to record metrics according to current metrics config (#292)
* split and update

* bug fixed

* change the copyright year

* use fake metadata in tests

* exclude test coverage for gcp_metadata

* add record

* add tests

* revert 2019 and add a new var

* change documents

* address comment

* change line
2019-03-07 10:26:42 -08:00