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

Commit

Permalink
Fixes #901: mock2 doesn't update wildcard value
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyfay committed May 5, 2016
1 parent 5c1177e commit e46e99a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin/collector/snap-collector-mock2/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ func (f *Mock) CollectMetrics(mts []plugin.MetricType) ([]plugin.MetricType, err
metrics := []plugin.MetricType{}
for i := range mts {
if c, ok := mts[i].Config().Table()["panic"]; ok && c.(ctypes.ConfigValueBool).Value {
panic("Opps!")
panic("Oops!")
}
if mts[i].Namespace()[2].Value == "*" {
for j := 0; j < 10; j++ {
ns := mts[i].Namespace()
ns := make([]core.NamespaceElement, len(mts[i].Namespace()))
copy(ns, mts[i].Namespace())
ns[2].Value = fmt.Sprintf("host%d", j)
data := randInt(65, 90)
mt := plugin.MetricType{
Expand Down

0 comments on commit e46e99a

Please sign in to comment.