From 6991fdb4cb5f51e54469584381b6b4eddc86054d Mon Sep 17 00:00:00 2001 From: balanza Date: Thu, 7 Nov 2024 17:44:02 +0100 Subject: [PATCH] change dump format --- lib/mix/tasks/dump_scenario.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mix/tasks/dump_scenario.ex b/lib/mix/tasks/dump_scenario.ex index ddfc47dddb..299421b74a 100644 --- a/lib/mix/tasks/dump_scenario.ex +++ b/lib/mix/tasks/dump_scenario.ex @@ -58,6 +58,7 @@ defmodule Mix.Tasks.DumpScenario do events = Discovery.get_current_discovery_events() Enum.map(events, fn %DiscoveryEvent{ + id: id, agent_id: agent_id, discovery_type: discovery_type, payload: payload @@ -72,8 +73,10 @@ defmodule Mix.Tasks.DumpScenario do scenario_path = Path.join(path, scenario_name) File.mkdir_p!(scenario_path) + index = id |> Integer.to_string() |> String.pad_leading(4, "0") + scenario_path - |> Path.join("#{agent_id}_#{discovery_type}.json") + |> Path.join("#{index}_#{agent_id}_#{discovery_type}.json") |> File.write!(data) end) end