File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ class TRandomLogGenerator {
253
253
}
254
254
255
255
TInstant RandomInstant () const {
256
- auto result = TInstant::Now ();
256
+ auto result = TInstant::Now () - TDuration::Seconds (Params. TimestampSubtract ) ;
257
257
i64 millisecondsDiff = 60 * 1000 * NormalRandom<double >(0 ., Params.TimestampStandardDeviationMinutes );
258
258
if (millisecondsDiff >= 0 ) { // TDuration::MilliSeconds can't be negative for some reason...
259
259
result += TDuration::MilliSeconds (millisecondsDiff);
@@ -420,6 +420,8 @@ void TLogWorkloadParams::ConfigureOpts(NLastGetopt::TOpts& opts, const ECommandT
420
420
.DefaultValue (RowsCnt).StoreResult (&RowsCnt);
421
421
opts.AddLongOption (" timestamp_deviation" , " Standard deviation. For each timestamp, a random variable with a specified standard deviation in minutes is added." )
422
422
.DefaultValue (TimestampStandardDeviationMinutes).StoreResult (&TimestampStandardDeviationMinutes);
423
+ opts.AddLongOption (" timestamp_subtract" , " Value in seconds to subtract from timestamp. For each timestamp, this value in seconds is subtracted" )
424
+ .DefaultValue (0 ).StoreResult (&TimestampSubtract);
423
425
opts.AddLongOption (" null-percent" , " Percent of nulls in generated data" )
424
426
.DefaultValue (NullPercent).StoreResult (&NullPercent);
425
427
break ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class TLogWorkloadParams : public TWorkloadParams {
25
25
ui64 KeyColumnsCnt = 0 ;
26
26
ui64 TimestampStandardDeviationMinutes = 0 ;
27
27
ui64 TimestampTtlMinutes = 0 ;
28
+ ui64 TimestampSubtract = 0 ;
28
29
ui64 RowsCnt = 1 ;
29
30
ui32 NullPercent = 10 ;
30
31
bool PartitionsByLoad = true ;
You can’t perform that action at this time.
0 commit comments