@@ -193,11 +193,11 @@ public static List<object> BuildTsCreateArgs(string key, long? retentionTime, IR
193
193
return args ;
194
194
}
195
195
196
- public static List < object > BuildTsAlterArgs ( string key , long ? retentionTime , IReadOnlyCollection < TimeSeriesLabel > labels )
196
+ public static List < object > BuildTsAlterArgs ( string key , long ? retentionTime , IReadOnlyCollection < TimeSeriesLabel > ? labels )
197
197
{
198
198
var args = new List < object > { key } ;
199
199
args . AddRetentionTime ( retentionTime ) ;
200
- args . AddLabels ( labels ) ;
200
+ if ( labels != null ) args . AddLabels ( labels ) ;
201
201
return args ;
202
202
}
203
203
@@ -213,14 +213,14 @@ public static List<object> BuildTsAddArgs(string key, TimeStamp timestamp, doubl
213
213
return args ;
214
214
}
215
215
216
- public static List < object > BuildTsIncrDecrByArgs ( string key , double value , TimeStamp timestamp , long ? retentionTime ,
217
- IReadOnlyCollection < TimeSeriesLabel > labels , bool ? uncompressed , long ? chunkSizeBytes )
216
+ public static List < object > BuildTsIncrDecrByArgs ( string key , double value , TimeStamp ? timestamp , long ? retentionTime ,
217
+ IReadOnlyCollection < TimeSeriesLabel > ? labels , bool ? uncompressed , long ? chunkSizeBytes )
218
218
{
219
219
var args = new List < object > { key , value } ;
220
- args . AddTimeStamp ( timestamp ) ;
220
+ if ( timestamp != null ) args . AddTimeStamp ( timestamp ) ;
221
221
args . AddRetentionTime ( retentionTime ) ;
222
222
args . AddChunkSize ( chunkSizeBytes ) ;
223
- args . AddLabels ( labels ) ;
223
+ if ( labels != null ) args . AddLabels ( labels ) ;
224
224
args . AddUncompressed ( uncompressed ) ;
225
225
return args ;
226
226
}
@@ -252,33 +252,40 @@ public static List<object> BuildTsMgetArgs(IReadOnlyCollection<string> filter, b
252
252
return args ;
253
253
}
254
254
255
- public static List < object > BuildRangeArgs ( string key , TimeStamp fromTimeStamp , TimeStamp toTimeStamp , long ? count ,
256
- TsAggregation ? aggregation , long ? timeBucket , IReadOnlyCollection < TimeStamp > filterByTs , ( long , long ) ? filterByValue ,
257
- TimeStamp align )
255
+ public static List < object > BuildRangeArgs ( string key ,
256
+ TimeStamp fromTimeStamp ,
257
+ TimeStamp toTimeStamp ,
258
+ long ? count ,
259
+ TsAggregation ? aggregation ,
260
+ long ? timeBucket ,
261
+ IReadOnlyCollection < TimeStamp > ? filterByTs ,
262
+ ( long , long ) ? filterByValue ,
263
+ TimeStamp ? align )
258
264
{
259
265
var args = new List < object > ( )
260
266
{ key , fromTimeStamp . Value , toTimeStamp . Value } ;
261
- args . AddFilterByTs ( filterByTs ) ;
267
+
268
+ if ( filterByTs != null ) args . AddFilterByTs ( filterByTs ) ;
262
269
args . AddFilterByValue ( filterByValue ) ;
263
270
args . AddCount ( count ) ;
264
- args . AddAlign ( align ) ;
271
+ if ( align != null ) args . AddAlign ( align ) ;
265
272
args . AddAggregation ( aggregation , timeBucket ) ;
266
273
return args ;
267
274
}
268
275
269
276
270
277
public static List < object > BuildMultiRangeArgs ( TimeStamp fromTimeStamp , TimeStamp toTimeStamp ,
271
278
IReadOnlyCollection < string > filter , long ? count , TsAggregation ? aggregation , long ? timeBucket ,
272
- bool ? withLabels , ( string , TsReduce ) ? groupbyTuple , IReadOnlyCollection < TimeStamp > filterByTs ,
273
- ( long , long ) ? filterByValue , IReadOnlyCollection < string > selectLabels , TimeStamp align )
279
+ bool ? withLabels , ( string , TsReduce ) ? groupbyTuple , IReadOnlyCollection < TimeStamp > ? filterByTs ,
280
+ ( long , long ) ? filterByValue , IReadOnlyCollection < string > ? selectLabels , TimeStamp ? align )
274
281
{
275
282
var args = new List < object > ( ) { fromTimeStamp . Value , toTimeStamp . Value } ;
276
- args . AddFilterByTs ( filterByTs ) ;
283
+ if ( filterByTs != null ) args . AddFilterByTs ( filterByTs ) ;
277
284
args . AddFilterByValue ( filterByValue ) ;
278
285
args . AddCount ( count ) ;
279
- args . AddAlign ( align ) ;
286
+ if ( align != null ) args . AddAlign ( align ) ;
280
287
args . AddAggregation ( aggregation , timeBucket ) ;
281
- args . AddWithLabels ( withLabels , selectLabels ) ;
288
+ if ( selectLabels != null ) args . AddWithLabels ( withLabels , selectLabels ) ;
282
289
args . AddFilters ( filter ) ;
283
290
args . AddGroupby ( groupbyTuple ) ;
284
291
return args ;
0 commit comments