瀏覽代碼

[fixes #188] expose a constructor for SampleSnapshot

mihasya 9 年之前
父節點
當前提交
22d219e7f2
共有 1 個文件被更改,包括 7 次插入0 次删除
  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")