Add more data to pageview seeds (#2471)

This commit is contained in:
Vini Brasil 2022-11-25 07:53:33 -03:00 committed by GitHub
parent ffbfb14714
commit b9367941f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,14 @@ Enum.flat_map(-720..0, fn day_index ->
attrs = [ attrs = [
domain: site.domain, domain: site.domain,
hostname: site.domain, hostname: site.domain,
timestamp: fn -> put_random_time.(date) end timestamp: fn -> put_random_time.(date) end,
referrer_source: fn -> Enum.random(["", "Facebook", "Twitter", "DuckDuckGo", "Google"]) end,
browser: fn -> Enum.random(["Edge", "Chrome", "Safari", "Firefox", "Vivaldi"]) end,
browser_version: fn -> 0..50 |> Enum.random() |> to_string() end,
country_code: fn -> Enum.random(["ZZ", "BR", "EE", "US", "DE", "PL", ""]) end,
screen_size: fn -> Enum.random(["Mobile", "Tablet", "Desktop", "Laptop"]) end,
operating_system: fn -> Enum.random(["Windows", "macOS", "Linux"]) end,
operating_system_version: fn -> 0..15 |> Enum.random() |> to_string() end
] ]
Plausible.Factory.build_list(number_of_events, :pageview, attrs) Plausible.Factory.build_list(number_of_events, :pageview, attrs)