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

Commit

Permalink
Update core/metric.go to include Description() and Unit() in
Browse files Browse the repository at this point in the history
CatalogedMetric interface. Add (Namespace)Element() method that returns
the NamespaceElement for the provided index.
  • Loading branch information
geauxvirtual committed May 13, 2016
1 parent da5ab95 commit 783afb3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ func (n Namespace) AddStaticElements(values ...string) Namespace {
return n
}

func (n Namespace) Element(idx int) NamespaceElement {
if idx >= 0 && idx < len(n) {
return n[idx]
}
return NamespaceElement{}
}

// NamespaceElement provides meta data related to the namespace. This is of particular importance when
// the namespace contains data.
type NamespaceElement struct {
Expand Down Expand Up @@ -157,4 +164,6 @@ type CatalogedMetric interface {
RequestedMetric
LastAdvertisedTime() time.Time
Policy() *cpolicy.ConfigPolicyNode
Description() string
Unit() string
}

0 comments on commit 783afb3

Please sign in to comment.