Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Refactor gauge and registry to accommodate cumulative. #1089

Merged
merged 2 commits into from
Apr 3, 2019

Conversation

rghetia
Copy link
Contributor

@rghetia rghetia commented Apr 2, 2019

  • use common baseMetric type to manage gauge and cumulative.
    This will be followed by a PR for cumulative support.

- use common baseMetric type to manage gauge and cumulative.
@rghetia rghetia requested review from rakyll and a team as code owners April 2, 2019 23:08
@rghetia rghetia requested a review from songy23 April 2, 2019 23:09
Copy link
Contributor

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall

metric/common.go Outdated
@@ -0,0 +1,126 @@
// Copyright 2018, OpenCensus Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/2018/2019

metric/common.go Outdated
return m
}

func (bm *baseMetric) mapKey(labelVals []metricdata.LabelValue) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider calling this encodeLabelVals for better readability.

metric/common.go Outdated
return string(vb.Bytes())
}

func (bm *baseMetric) labelValues(s string) []metricdata.LabelValue {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, consider decodeLabelVals.

@rghetia rghetia merged commit ac521c1 into census-instrumentation:dev Apr 3, 2019
@rghetia rghetia deleted the refactor branch April 15, 2019 20:43
rghetia added a commit to rghetia/opencensus-go that referenced this pull request Apr 25, 2019
…mentation#1089)

* Refactor gauge and registry to accomodate cummulative.
- use common baseMetric type to manage gauge and cumulative.

* fix copyright and renamed couple of func.
rghetia added a commit that referenced this pull request Apr 25, 2019
* Refactor gauge and registry to accomodate cummulative.
- use common baseMetric type to manage gauge and cumulative.

* fix copyright and renamed couple of func.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants