Permalink
Browse files

Add Metric constructor NewMetric

  • Loading branch information...
1 parent 7ab152b commit d32ebc24d1a949ba2dbc07f5f8a06a0a5ea961db @wellle wellle committed Mar 13, 2014
Showing with 8 additions and 0 deletions.
  1. +8 −0 metric.go
View
@@ -12,6 +12,14 @@ type Metric struct {
Timestamp int64
}
+func NewMetric(name, value string, timestamp int64) Metric {
+ return Metric{
+ Name: name,
+ Value: value,
+ Timestamp: timestamp,
+ }
+}
+
func (metric Metric) String() string {
return fmt.Sprintf(
"%s %s %s",

0 comments on commit d32ebc2

Please sign in to comment.