Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Fix #1011: Group dynamic metrics in cache under appropriate keys #1025

Merged
merged 1 commit into from
Jun 24, 2016
Merged

Fix #1011: Group dynamic metrics in cache under appropriate keys #1025

merged 1 commit into from
Jun 24, 2016

Conversation

geauxvirtual
Copy link
Contributor

Fixes #1011

Summary of changes:

  • Adds control/strategy/cache_small_test.go file
  • Adds TestUpdateCache method to cache_small_test.go to test adding static and dynamic metric entries to the cache
  • Reimplement updateCache method to properly store dynamic metrics in cache under the metrics dynamic namespace instead of the namespace returned from the plugin.

Testing done:

  • Wrote new tests to verify functionality of code changes.

@intelsdi-x/snap-maintainers

tmp.version = mt.Version()
dc[key] = tmp
dc[key].metrics = append(dc[key].metrics, mt)
for _, v := range dc {
Copy link
Contributor

Choose a reason for hiding this comment

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

For each dynamic metric, we are doing n2 writes where n is the number of metrics which are a result of the query.

This loop should be moved outside of the outer mts loop, and done iff len(dc) > 0.

@pittma
Copy link
Contributor

pittma commented Jun 24, 2016

LGTM

Landing.

@pittma pittma merged commit e68b1a3 into intelsdi-x:master Jun 24, 2016
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