@@ -28,7 +28,7 @@ func TestCumulative(t *testing.T) {
2828 f , _ := r .AddFloat64Cumulative ("TestCumulative" ,
2929 WithLabelKeys ("k1" , "k2" ))
3030 e , _ := f .GetEntry (metricdata.LabelValue {}, metricdata.LabelValue {})
31- e .Set (5 )
31+ e .Inc (5 )
3232 e , _ = f .GetEntry (metricdata .NewLabelValue ("k1v1" ), metricdata.LabelValue {})
3333 e .Inc (1 )
3434 e , _ = f .GetEntry (metricdata .NewLabelValue ("k1v1" ), metricdata.LabelValue {})
@@ -103,20 +103,14 @@ func readAndCompareInt64Val(testname string, r *Registry, want int64, t *testing
103103 }
104104}
105105
106- func TestInt64CumulativeEntry_IncAndSet (t * testing.T ) {
106+ func TestInt64CumulativeEntry_IncNegative (t * testing.T ) {
107107 r := NewRegistry ()
108108 g , _ := r .AddInt64Cumulative ("bm" )
109109 e , _ := g .GetEntry ()
110110 e .Inc (5 )
111111 readAndCompareInt64Val ("inc" , r , 5 , t )
112112 e .Inc (- 2 )
113113 readAndCompareInt64Val ("inc negative" , r , 5 , t )
114- e .Set (- 2 )
115- readAndCompareInt64Val ("set negative" , r , 5 , t )
116- e .Set (4 )
117- readAndCompareInt64Val ("set lower" , r , 5 , t )
118- e .Set (9 )
119- readAndCompareInt64Val ("set higher" , r , 9 , t )
120114}
121115
122116func readAndCompareFloat64Val (testname string , r * Registry , want float64 , t * testing.T ) {
@@ -126,20 +120,14 @@ func readAndCompareFloat64Val(testname string, r *Registry, want float64, t *tes
126120 }
127121}
128122
129- func TestFloat64CumulativeEntry_IncAndSet (t * testing.T ) {
123+ func TestFloat64CumulativeEntry_IncNegative (t * testing.T ) {
130124 r := NewRegistry ()
131125 g , _ := r .AddFloat64Cumulative ("bm" )
132126 e , _ := g .GetEntry ()
133127 e .Inc (5.0 )
134128 readAndCompareFloat64Val ("inc" , r , 5.0 , t )
135129 e .Inc (- 2.0 )
136130 readAndCompareFloat64Val ("inc negative" , r , 5.0 , t )
137- e .Set (- 2.0 )
138- readAndCompareFloat64Val ("set negative" , r , 5.0 , t )
139- e .Set (4.0 )
140- readAndCompareFloat64Val ("set lower" , r , 5.0 , t )
141- e .Set (9.9 )
142- readAndCompareFloat64Val ("set higher" , r , 9.9 , t )
143131}
144132
145133func TestCumulativeWithSameNameDiffType (t * testing.T ) {
0 commit comments