AddRandomSeconds

AddRandomSeconds

Adds a random number (between [min, max] parameters) of seconds to the referenced date.

Attributes
Name Description Required Min Max Allowed Values
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
disableRng Content type: Boolean
If set to true, instead of choosing a random date within the date range, use the the current row id as position marker to traverse the date range from start to end.
Default: false
no 0 1
  • true
  • false
  • 0
  • 1
endDate Content type: Date or property
End of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
historicalEndDate Content type: Date or property
Sets a separate date range in case your historical range (range [0,1[ or in case 'historicalTimeIDsCount' is set [0,historicalTimeIDsCount[) differs from the normal range ([startDate, endDate]). The normal range will be used for the update parts of a table in that case.End of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
startDate Content type: Date or property
Begin of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
max Content type: Long
maximum value of seconds to add to the referenced date.
yes 1 1
historicalStartDate Content type: Date or property
Sets a separate date range in case your historical range (range [0,1[ or in case 'historicalTimeIDsCount' is set [0,historicalTimeIDsCount[) differs from the normal range ([startDate, endDate]). The normal range will be used for the update parts of a table in that case.Begin of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
inputFormat Content type: String
Date or time input format for 'startDate', 'endDate', 'historicalStartDate' and 'historicalEndDate'. Default format: yyyy-MM-dd HH:mm:ss. Format specification: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
no 0 1
min Content type: Long
minimum value of seconds to add to the referenced date.
yes 1 1
historicalTimeIDsCount Content type: Integer
Number of timeID's treated logically as 'historical'. Logically, historical timeIDs can have a different date/time range than 'normal' timeID's. For historical timeIDs the date/time range: [historicalStartDate, historicalEndDate] is used
Default: 1
no 0 1
reference reference. Possible references are: id="startDateRef", id="endDateRef", id="historicalStartDateRef", id="historicalEndDateRef yes 1 1
useFixedStepSize Content type: Boolean
If set to false, each date_n will be computed with: date_n = date_n-1 + random. If set to true, each date will have a distance of [startDate, endDate] / numberOfRows to its next date.
Default: false
no 0 1
  • true
  • false
  • 0
  • 1
outputFormat Content type: String
Date or time output format. Default format: yyyy-MM-dd HH:mm:ss. Format specification: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
no 0 1

Example

  1. Random Date with Minor Random Tolerance

    Generates a random date time between January 1st 00:00:00 and 24:00:00. A random amount of seconds between 1 and 10 seconds is then added to the generated date time.

    Schema config for Random Date with Minor Random Tolerance
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="ADD_RANDOM_SECONDS">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random Date with Minor Random Tolerance-->
          <!--
            Generates a random date time between January 1st 00:00:00 and 24:00:00. A random amount of seconds between 1 and
            10 seconds is then added to the generated date time.
          -->
          <field name="time" size="" type="DATE">
            <gen_DateTime>
              <startDate>2016-01-01 00:00:00</startDate>
              <endDate>2016-01-01 24:00:00</endDate>
              <outputFormat>HH:mm:ss</outputFormat>
            </gen_DateTime>
          </field>
          <field name="time_plus_tolerance" size="" type="DATE">
            <gen_AddRandomSeconds>
              <reference field="time"/>
              <min>0</min>
              <max>10</max>
              <outputFormat>HH:mm:ss</outputFormat>
            </gen_AddRandomSeconds>
          </field>
          </table>
    </schema>
    
    Output for Random Date with Minor Random Tolerance
    16:47:08|16:47:17
    00:43:49|00:43:50
    21:38:56|21:38:58
    08:42:25|08:42:34
    04:38:58|04:39:02
    16:47:08|16:47:16
    13:29:31|13:29:40
    08:42:25|08:42:35
    16:47:08|16:47:15
    08:42:25|08:42:26
2.7-83fb0 | 2020-04-22