소스 검색

[fixes #188] expose a constructor for SampleSnapshot

mihasya 9 년 전
부모
커밋
1df74d5c34
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")