Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Add RPC metrics emitter as Observer/SpanObserver #103

Merged
merged 8 commits into from
Mar 3, 2017

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Feb 25, 2017

No description provided.

@yurishkuro yurishkuro changed the title Implement RPC metrics emitter as Observer/SpanObserver WIP: Implement RPC metrics emitter as Observer/SpanObserver Mar 2, 2017
@yurishkuro yurishkuro changed the title WIP: Implement RPC metrics emitter as Observer/SpanObserver Implement RPC metrics emitter as Observer/SpanObserver Mar 3, 2017
@yurishkuro yurishkuro changed the title Implement RPC metrics emitter as Observer/SpanObserver Add RPC metrics emitter as Observer/SpanObserver Mar 3, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+1.1%) to 83.229% when pulling e1df9f2 on metrics-observer into 1f64068 on master.

norm = n.normalizer.Normalize(name)
n.mux.Lock()
defer n.mux.Unlock()
if len(n.names) >= n.maxSize {
Copy link

Choose a reason for hiding this comment

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

Maybe move this check to before we call n.normalizer.Normalize. Why call "Normalize" if we might be over max cache size and we will just return ""?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it so that the call to Normalize is done outside of the exclusive lock. But you're right that if the service ever reaches the upper limit of the cache it will be paying normalization cost for every call.

metricsByEndpoint *MetricsByEndpoint
}

// NewObserver creates a new observer that can emit RPC metricso.
Copy link

Choose a reason for hiding this comment

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

type: metrico -> metrics

@coveralls
Copy link

Coverage Status

Coverage increased (+1.2%) to 83.272% when pulling adc742b on metrics-observer into 1f64068 on master.

err bool
}

// NewSpanObserver creates a new SpanObserver that can emit RPC metricso.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

@coveralls
Copy link

Coverage Status

Coverage increased (+1.2%) to 83.272% when pulling c5ad810 on metrics-observer into 1f64068 on master.

@yurishkuro yurishkuro merged commit fc18ec3 into master Mar 3, 2017
@yurishkuro yurishkuro deleted the metrics-observer branch May 5, 2021 21:57
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.

4 participants