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

Fix dConfig in the inputhost; add string validator for dConfig #199

Merged
merged 3 commits into from
May 30, 2017

Conversation

GuillaumeBailey
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 68.335% when pulling a89a8e7 on inputDConfig into e9bb700 on master.

@GuillaumeBailey
Copy link
Contributor Author

gbailey@cherami32-dca1:~$ grep -ie 'val=' /var/log/udocker/cherami-input/docker-process-cherami-input.log 
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:938 SetHostConnLimit\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=10000 \n","stream":"stderr","time":"2017-05-13T05:42:54.320381461Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:895 SetHostConnLimitPerSecond\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=1000 \n","stream":"stderr","time":"2017-05-13T05:42:54.320387734Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:931 SetTokenBucketValue\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=1000 \n","stream":"stderr","time":"2017-05-13T05:42:54.320393368Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:949 SetMaxConnPerDest\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=1000 \n","stream":"stderr","time":"2017-05-13T05:42:54.320398593Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:931 SetTokenBucketValue\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=1000 \n","stream":"stderr","time":"2017-05-13T05:42:54.320403869Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:976 SetTestShortExtentsByPath\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=\"/cheramistress=1\" \n","stream":"stderr","time":"2017-05-13T05:42:54.326553197Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:919 SetConnMsgsLimitPerSecond\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=80000 \n","stream":"stderr","time":"2017-05-13T05:42:54.327588597Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:907 SetExtMsgsLimitPerSecond\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=20000 \n","stream":"stderr","time":"2017-05-13T05:42:54.327912312Z"}
{"log":"time=\"2017-05-13T05:42:54Z\" level=info msg=\"inputhost.go:970 SetNodeStatus\" deploymentName=\"staging_dca1a\" inhoID=8613346b val=UP \n","stream":"stderr","time":"2017-05-13T05:42:54.32800179Z"}

seems to be working well

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 68.167% when pulling b61f8ed on inputDConfig into e9bb700 on master.

@@ -74,6 +75,23 @@ func GenerateIntMaxMinVerifier(dconfigKey string, minV int, maxV int) Verifier {
return verifierFunc
}

// GenerateStringRegexpVerifier return a dconfig Verifier for the dconfigKey
func GenerateStringRegexpVerifier(dconfigKey string, r *regexp.Regexp) Verifier {
verifierFunc := func(_ interface{}, newV interface{}) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should make a local copy of dconfigKey and the regex expression, because the closure capture is by reference and you could end up with weird bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kirg kirg merged commit 417e166 into master May 30, 2017
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

4 participants