-
Notifications
You must be signed in to change notification settings - Fork 294
Fixes #871 - Metric schema and metadata #872
Conversation
func validateMetricNamespace(ns []string) error { | ||
name := strings.Join(ns, "") | ||
func validateMetricNamespace(ns core.Namespace) error { | ||
// name := strings.Join(ns, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove this.
@@ -1035,20 +1035,20 @@ func (r *requestedPlugin) Config() *cdata.ConfigDataNode { | |||
// ------------------- helper struct and function for grouping metrics types ------ | |||
|
|||
// just a tuple of loadedPlugin and metricType slice | |||
type pluginMetricTypes struct { | |||
type metricTypes struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overloading types here for the different packages. Is it a good practice in Golang? I just noticed that it's local. It's probably fine. Even that it could be confusing.
// NewNamespace takes an array of strings and returns a Namespace. A Namespace | ||
// is an array of NamespaceElements. The provided array of strings is used to | ||
// set the corresponding Value fields in the array of NamespaceElements. | ||
func NewNamespace(ns []string) Namespace { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that only "NamespaceElement.Value" is used now. Would you please elaborate the potential use of Name field?
👍 all tests passed. Other than my minor questions, LGTM. |
// Reapply standard tags after collection as a precaution. It is common for | ||
// plugin authors to inadvertently overwrite or not pass along the data | ||
// passed to CollectMetrics so we will help them out here. | ||
for i, _ := range m { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gofmt complains about this line on travis. Need to omit the _.
So(m[1].Data(), ShouldResemble, "2") | ||
}) | ||
|
||
Convey("error on bad corrupt data", func() { | ||
a = []byte{1, 0, 1, 1, 1, 1, 1, 0, 0, 1} | ||
m, e = UnmarshallPluginMetricTypes("snap.gob", a) | ||
m, e = UnmarshallMetricTypes("snap.gob", a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was from before...but Unmarshal has only one l
Other than typos that were already there (so could be changed later...) 👍 |
I've just added labels to show that this pull request is a good example of using |
Fixes #871 - Metric schema metadata
Summary of changes:
Testing done:
@intelsdi-x/snap-maintainers