Browse Source

Merge pull request #190 from rcrowley/samplesnapshot_constructor

[fixes #188] expose a constructor for SampleSnapshot
Mikhail P 9 years ago
parent
commit
550432d8a7
1 changed files with 7 additions and 0 deletions
  1. 7 0
      sample.go

+ 7 - 0
sample.go

@@ -302,6 +302,13 @@ type SampleSnapshot struct {
 	values []int64
 }
 
+func NewSampleSnapshot(count int64, values []int64) *SampleSnapshot {
+	return &SampleSnapshot{
+		count:  count,
+		values: values,
+	}
+}
+
 // Clear panics.
 func (*SampleSnapshot) Clear() {
 	panic("Clear called on a SampleSnapshot")