Skip to content

Latest commit

 

History

History
207 lines (195 loc) · 9.73 KB

File metadata and controls

207 lines (195 loc) · 9.73 KB

Synthetic IP addresses

When a field generator type is ipaddress, a random IP address is created.

Field Description Possible values Required? Default
type The data type for the dimension. ipaddress Yes
name The unique name for the dimension. String Yes
cardinality Indicates the number of unique values for this dimension. Use zero for unconstrained cardinality. Integer Yes
cardinality_distribution Skews the cardinality selection of the generated values. A distribution object. Yes, if cardinality not 0.
percent_missing The stochastic frequency for omitting this dimension from records (inclusive). Integer between 0 and 100. No. 0
percent_nulls The stochastic frequency (inclusive) for generating null values. Integer between 0 and 100. No. 0
distribution The distribution of IP address values the driver generates. A distribution object. Yes

Following standard practices, the integers generated by the distribution function are converted into IP addresses by the generator.

IP Address Range Integer Range Purpose
0.0.0.0 – 0.255.255.255 0 – 16,777,215 Current network
10.0.0.0 – 10.255.255.255 167,772,160 – 184,549,375 Private network
127.0.0.0 – 127.255.255.255 2,127,008,768 – 2,143,825,023 Loopback
169.254.0.0 – 169.254.255.255 2,842,085,376 – 2,842,150,911 Link-local
172.16.0.0 – 172.31.255.255 2,884,182,016 – 2,884,997,119 Private network
192.0.0.0 – 192.0.0.255 3,221,225,472 – 3,221,225,727 IETF Protocol Assignments
192.168.0.0 – 192.168.255.255 3,232,235,520 – 3,232,497,663 Private network
224.0.0.0 – 239.255.255.255 3,758,096,384 – 4,028,717,055 Multicast
240.0.0.0 – 255.255.255.255 4,028,717,056 – 4,294,967,295 Reserved for future use

In this example, session_start spawns a new worker every 5–10 seconds. A gateway:exclusive routes 60% to getting and 40% to posting, each preceded by a timer matching their original delay distribution, cycling continuously.

The emitters example_event_1 and example_event_2 are associated with getting and posting respectively.

Both getting and posting will generate:

  • An ipaddress-type dimension called server using a uniform-type distribution.
  • A second ipaddress-type dimension, client. This uses a different range of integers that fall into a naive public IP range. The cardinality of the generated values has been set to 5, limiting the output values to a distinct set. This is accompanied by a cardinality_distribution to inform the data generator how to select from that list.

They then both generate an endpoint and response_time_ms, but the list of values for the enum dimension are different, as are the distribution functions that create the int values for response_time_ms.

{
  "states": [
    {
      "name": "session_start",
      "type": "event:start:timer",
      "cardinality_distribution": { "type": "uniform", "min": 5, "max": 10 },
      "next": "route_request"
    },
    {
      "name": "route_request",
      "type": "gateway:exclusive",
      "transitions": [
        { "next": "pause_getting", "probability": 0.6 },
        { "next": "pause_posting", "probability": 0.4 }
      ]
    },
    {
      "name": "pause_getting",
      "type": "event:intermediate:timer",
      "cardinality_distribution": { "type": "uniform", "min": 5, "max": 10 },
      "next": "emit_getting"
    },
    {
      "name": "emit_getting",
      "type": "activity",
      "emitter": "example_event_1",
      "next": "route_request"
    },
    {
      "name": "pause_posting",
      "type": "event:intermediate:timer",
      "cardinality_distribution": { "type": "uniform", "min": 2, "max": 8 },
      "next": "emit_posting"
    },
    {
      "name": "emit_posting",
      "type": "activity",
      "emitter": "example_event_2",
      "next": "route_request"
    }
  ],
  "emitters": [
    {
      "name": "example_event_1",
      "dimensions": [
        {
          "name": "server",
          "type": "ipaddress",
          "cardinality": 0,
          "distribution": {
            "type": "uniform",
            "min": 2130706433,
            "max": 2130706440
          }
        },
        {
          "name": "client",
          "type": "ipaddress",
          "cardinality": 5,
          "cardinality_distribution": { "type": "uniform", "min": 0, "max": 5 },
          "distribution": {
            "type": "uniform",
            "min": 184549376,
            "max": 2127008767
          }
        },
        {
          "name": "endpoint",
          "type": "enum",
          "values": [
            "GET /api/articles",
            "GET /api/articles/42",
            "GET /api/articles/102/history",
            "GET /api/articles/56/contributors",
            "GET /api/categories",
            "GET /api/categories/7/articles",
            "GET /api/search?q=quantum-mechanics",
            "GET /api/users/18",
            "GET /api/users/73/contributions",
            "GET /api/recent-changes"
          ],
          "cardinality_distribution": { "type": "uniform", "min": 0, "max": 9 }
        },
        {
          "name": "response_time_ms",
          "type": "int",
          "distribution": { "type": "uniform", "min": 10, "max": 500 },
          "cardinality": 0
        }
      ]
    },
    {
      "name": "example_event_2",
      "dimensions": [
        {
          "name": "server",
          "type": "ipaddress",
          "cardinality": 0,
          "distribution": {
            "type": "uniform",
            "min": 2130706433,
            "max": 2130706440
          }
        },
        {
          "name": "client",
          "type": "ipaddress",
          "cardinality": 5,
          "cardinality_distribution": { "type": "uniform", "min": 0, "max": 5 },
          "distribution": {
            "type": "uniform",
            "min": 184549376,
            "max": 2127008767
          }
        },
        {
          "name": "endpoint",
          "type": "enum",
          "values": [
            "POST /api/articles",
            "POST /api/articles/99/edit",
            "POST /api/articles/150/comment",
            "POST /api/articles/83/flag",
            "POST /api/users/signup",
            "POST /api/users/login",
            "POST /api/users/logout",
            "POST /api/articles/200/lock",
            "POST /api/articles/13/restore",
            "POST /api/feedback" ],
          "cardinality_distribution": { "type": "uniform", "min": 0, "max": 9 }
        },
        {
          "name": "response_time_ms",
          "type": "int",
          "distribution": { "type": "exponential", "mean": 50000},
          "cardinality": 0
        }
      ]
    }
  ]
}

This is an example of the output:

{"time":"2001-12-20T13:13:12.132","server":"127.0.0.1","client":"116.79.212.140","endpoint":"GET /api/articles/56/contributors","response_time_ms":284}
{"time":"2001-12-20T13:13:18.941","server":"127.0.0.8","client":"97.91.64.7","endpoint":"GET /api/articles/102/history","response_time_ms":72}
{"time":"2001-12-20T13:13:19.350","server":"127.0.0.4","client":"97.91.64.7","endpoint":"GET /api/articles/42","response_time_ms":96}
{"time":"2001-12-20T13:13:24.999","server":"127.0.0.7","client":"36.95.101.166","endpoint":"GET /api/recent-changes","response_time_ms":325}
{"time":"2001-12-20T13:13:25.537","server":"127.0.0.6","client":"43.136.216.164","endpoint":"POST /api/articles/13/restore","response_time_ms":961}
{"time":"2001-12-20T13:13:28.872","server":"127.0.0.5","client":"65.110.231.109","endpoint":"POST /api/users/logout","response_time_ms":3016}
{"time":"2001-12-20T13:13:30.151","server":"127.0.0.2","client":"116.79.212.140","endpoint":"GET /api/search?q=quantum-mechanics","response_time_ms":258}
{"time":"2001-12-20T13:13:30.262","server":"127.0.0.5","client":"56.40.21.140","endpoint":"GET /api/articles/56/contributors","response_time_ms":405}
{"time":"2001-12-20T13:13:33.305","server":"127.0.0.2","client":"56.40.21.140","endpoint":"GET /api/articles/102/history","response_time_ms":388}
{"time":"2001-12-20T13:13:35.196","server":"127.0.0.4","client":"56.40.21.140","endpoint":"GET /api/search?q=quantum-mechanics","response_time_ms":248}
{"time":"2001-12-20T13:13:36.867","server":"127.0.0.8","client":"97.91.64.7","endpoint":"GET /api/users/18","response_time_ms":145}
{"time":"2001-12-20T13:13:39.107","server":"127.0.0.5","client":"110.243.39.35","endpoint":"POST /api/articles/150/comment","response_time_ms":55535}
{"time":"2001-12-20T13:13:40.298","server":"127.0.0.1","client":"110.243.39.35","endpoint":"POST /api/feedback","response_time_ms":22929}
{"time":"2001-12-20T13:13:40.539","server":"127.0.0.5","client":"36.95.101.166","endpoint":"GET /api/articles/56/contributors","response_time_ms":71}
{"time":"2001-12-20T13:13:45.428","server":"127.0.0.6","client":"56.40.21.140","endpoint":"GET /api/articles/56/contributors","response_time_ms":295}
{"time":"2001-12-20T13:13:45.711","server":"127.0.0.5","client":"56.40.21.140","endpoint":"GET /api/users/18","response_time_ms":128}
{"time":"2001-12-20T13:13:45.976","server":"127.0.0.2","client":"68.80.111.41","endpoint":"GET /api/articles/102/history","response_time_ms":471}
{"time":"2001-12-20T13:13:46.227","server":"127.0.0.1","client":"68.80.111.41","endpoint":"GET /api/recent-changes","response_time_ms":326}
{"time":"2001-12-20T13:13:47.857","server":"127.0.0.3","client":"97.91.64.7","endpoint":"GET /api/recent-changes","response_time_ms":243}
{"time":"2001-12-20T13:13:48.613","server":"127.0.0.8","client":"110.243.39.35","endpoint":"POST /api/users/login","response_time_ms":42428}