Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

MetadataMgr: Move back to controllerhost #47

Merged
merged 10 commits into from
Feb 1, 2017
Merged

MetadataMgr: Move back to controllerhost #47

merged 10 commits into from
Feb 1, 2017

Conversation

venkat1109
Copy link
Contributor

This patch moves the MetadataMgr interface & impl within the controller (where it originally belonged). Now the controller implementation is just a decorator around the common metadata client (that emits metrics).

@coveralls
Copy link

Coverage Status

Coverage increased (+1.03%) to 56.083% when pulling 86e0c12 on md-mgr into 5eefb79 on master.

@@ -173,7 +173,7 @@ func NewController(cfg configure.CommonAppConfig, sVice *common.Service, metadat

context.dstLock = lockMgr
context.m3Client = metrics.NewClient(instance.Service.GetMetricsReporter(), metrics.Controller)
context.mm = common.NewMetadataMgr(metadataClient, context.m3Client, context.log)
context.mm = NewMetadataMgr(metadataClient, context.m3Client, context.log)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of metadataClient, you should probably use "instance.mClient" .. after initializing instance.mClient (above) to use "common/metadata" metadataMgr .. that emits metrics. this would ensure that all calls to metadata (via the metadataClient) would emit necessary metrics.

import mm "github.com/uber/cherami-server/common/metadata"
...
	instance.mClient = mm.NewMetadataMetricsMgr(metadataClient, context.m3Client, logger)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

m.m3.IncCounter(metrics.MetadataReadDestinationScope, metrics.MetadataFailures)
if _, ok := err.(*shared.EntityNotExistsError); !ok {
m.m3.IncCounter(metrics.MetadataReadDestinationScope, metrics.MetadataFailures)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is something i had missed .. thanks for taking care of it.

@@ -173,7 +174,8 @@ func NewController(cfg configure.CommonAppConfig, sVice *common.Service, metadat

context.dstLock = lockMgr
context.m3Client = metrics.NewClient(instance.Service.GetMetricsReporter(), metrics.Controller)
context.mm = common.NewMetadataMgr(metadataClient, context.m3Client, context.log)
mClient := metadata.NewMetadataMetricsMgr(metadataClient, context.m3Client, context.log)
Copy link
Contributor

Choose a reason for hiding this comment

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

you should probably update the global (Mcp.mClient) to use the instance that emits metrics .. so that other sub-components (within controllerhost) that calls into metadata would automatically emit metrics. i see that retention manager instantiate another instance of metadata-metrics within its code -- we should probably remove that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, done !

@coveralls
Copy link

Coverage Status

Coverage increased (+1.3%) to 56.11% when pulling 6c8a871 on md-mgr into 79c1855 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.3%) to 56.061% when pulling 6c8a871 on md-mgr into 79c1855 on master.

Copy link
Contributor

@kirg kirg left a comment

Choose a reason for hiding this comment

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

LoGoToMe.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.4%) to 56.131% when pulling 3a432e3 on md-mgr into 79c1855 on master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling abdd1bc on md-mgr into ** on master**.

@venkat1109 venkat1109 merged commit 9ea8b07 into master Feb 1, 2017
@venkat1109 venkat1109 deleted the md-mgr branch February 1, 2017 17:34
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.

None yet

3 participants