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 {
253253 }
254254
255255 TInstant RandomInstant () const {
256- auto result = TInstant::Now ();
256+ auto result = TInstant::Now () - TDuration::Seconds (Params. TimestampSubtract ) ;
257257 i64 millisecondsDiff = 60 * 1000 * NormalRandom<double >(0 ., Params.TimestampStandardDeviationMinutes );
258258 if (millisecondsDiff >= 0 ) { // TDuration::MilliSeconds can't be negative for some reason...
259259 result += TDuration::MilliSeconds (millisecondsDiff);
@@ -420,6 +420,8 @@ void TLogWorkloadParams::ConfigureOpts(NLastGetopt::TOpts& opts, const ECommandT
420420 .DefaultValue (RowsCnt).StoreResult (&RowsCnt);
421421 opts.AddLongOption (" timestamp_deviation" , " Standard deviation. For each timestamp, a random variable with a specified standard deviation in minutes is added." )
422422 .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);
423425 opts.AddLongOption (" null-percent" , " Percent of nulls in generated data" )
424426 .DefaultValue (NullPercent).StoreResult (&NullPercent);
425427 break ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class TLogWorkloadParams : public TWorkloadParams {
2525 ui64 KeyColumnsCnt = 0 ;
2626 ui64 TimestampStandardDeviationMinutes = 0 ;
2727 ui64 TimestampTtlMinutes = 0 ;
28+ ui64 TimestampSubtract = 0 ;
2829 ui64 RowsCnt = 1 ;
2930 ui32 NullPercent = 10 ;
3031 bool PartitionsByLoad = true ;
You can’t perform that action at this time.
0 commit comments