dv-flow-mgr 1.8.14920283751rc0__py3-none-any.whl → 1.8.14931268525rc0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dv_flow/mgr/__init__.py +1 -1
- dv_flow/mgr/task_listener_trace.py +86 -70
- {dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/METADATA +1 -1
- {dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/RECORD +8 -8
- {dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/WHEEL +0 -0
- {dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/entry_points.txt +0 -0
- {dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/licenses/LICENSE +0 -0
- {dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/top_level.txt +0 -0
dv_flow/mgr/__init__.py
CHANGED
@@ -3,6 +3,7 @@ import json
|
|
3
3
|
import time
|
4
4
|
from typing import Dict, List, TextIO
|
5
5
|
from .task_node import TaskNode
|
6
|
+
from .fileset import FileSet
|
6
7
|
|
7
8
|
@dc.dataclass
|
8
9
|
class TaskListenerTrace(object):
|
@@ -58,6 +59,36 @@ class TaskListenerTrace(object):
|
|
58
59
|
del self._task_tid_map[task]
|
59
60
|
self._free_tids.append(tid)
|
60
61
|
|
62
|
+
def _get_task_data(self, task: TaskNode) -> dict:
|
63
|
+
"""Extract serializable task data"""
|
64
|
+
data = {}
|
65
|
+
|
66
|
+
# Add any parameters
|
67
|
+
if hasattr(task, 'params') and task.params:
|
68
|
+
# If params is a dataclass or has __dict__, get its fields
|
69
|
+
if hasattr(task.params, '__dict__'):
|
70
|
+
data['params'] = task.params.__dict__
|
71
|
+
elif isinstance(task.params, dict):
|
72
|
+
data['params'] = task.params
|
73
|
+
|
74
|
+
# Add inputs if present
|
75
|
+
if hasattr(task, 'needs') and task.needs:
|
76
|
+
inputs = []
|
77
|
+
for need, _ in task.needs:
|
78
|
+
if hasattr(need, 'output') and need.output:
|
79
|
+
_items = []
|
80
|
+
for out in need.output.output:
|
81
|
+
if hasattr(out, 'model_dump'):
|
82
|
+
_items.append(out.model_dump())
|
83
|
+
inputs.append({
|
84
|
+
'task': need.name,
|
85
|
+
'data': _items
|
86
|
+
})
|
87
|
+
if inputs:
|
88
|
+
data['inputs'] = inputs
|
89
|
+
|
90
|
+
return data
|
91
|
+
|
61
92
|
def event(self, task: TaskNode, reason: str):
|
62
93
|
"""Record a task execution event.
|
63
94
|
|
@@ -74,87 +105,72 @@ class TaskListenerTrace(object):
|
|
74
105
|
# Get current timestamp in microseconds
|
75
106
|
ts = int(time.time() * 1_000_000) if reason == "enter" else int(task.end.timestamp() * 1_000_000)
|
76
107
|
|
77
|
-
# Create the duration event
|
108
|
+
# Create the duration event with initial args
|
109
|
+
args = {}
|
110
|
+
|
111
|
+
# Add task data
|
112
|
+
if reason == "enter":
|
113
|
+
# Add input data on task start
|
114
|
+
input_data = self._get_task_data(task)
|
115
|
+
if input_data:
|
116
|
+
args = input_data
|
117
|
+
|
118
|
+
elif reason == 'leave':
|
119
|
+
if task.result:
|
120
|
+
# Add status and change info
|
121
|
+
args["status"] = task.result.status
|
122
|
+
args["changed"] = task.result.changed
|
123
|
+
|
124
|
+
# Add output data if present
|
125
|
+
if hasattr(task.result, 'output') and task.result.output:
|
126
|
+
args["output"] = [
|
127
|
+
out.__dict__ if hasattr(out, '__dict__') else out
|
128
|
+
for out in task.result.output
|
129
|
+
]
|
130
|
+
|
131
|
+
self._release_tid(task)
|
132
|
+
|
133
|
+
# Create the event with collected args
|
78
134
|
event = {
|
79
135
|
"name": task.name,
|
80
136
|
"cat": "task",
|
81
137
|
"ph": ph,
|
82
138
|
"pid": 1,
|
83
139
|
"tid": tid,
|
84
|
-
"ts": ts
|
140
|
+
"ts": ts,
|
141
|
+
"args": args
|
85
142
|
}
|
86
143
|
|
87
144
|
# Store the duration event
|
88
145
|
self._events.append(event)
|
89
146
|
|
147
|
+
# Add flow event for dependencies
|
90
148
|
if reason == "enter":
|
91
|
-
# When
|
149
|
+
# When task starts, add flow event from each dependency
|
92
150
|
for need, _ in task.needs:
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
# "ts": ts,
|
104
|
-
# "id": flow_id,
|
105
|
-
# "bp": "e" # Connect to enclosing slice
|
106
|
-
# }
|
107
|
-
# self._events.append(flow_end)
|
108
|
-
|
109
|
-
# # Add flow start event from dependency
|
110
|
-
# flow_start = {
|
111
|
-
# "name": f"{need.name} -> {task.name}",
|
112
|
-
# "cat": "flow",
|
113
|
-
# "ph": "b", # Flow begin
|
114
|
-
# "pid": 1,
|
115
|
-
# "tid": self._task_tid_map.get(need, 0), # Source task's thread
|
116
|
-
# "ts": int(need.end.timestamp() * 1_000_000) if need.end else ts,
|
117
|
-
# "id": flow_id,
|
118
|
-
# "bp": "e" # Connect to enclosing slice
|
119
|
-
# }
|
120
|
-
# self._events.append(flow_start)
|
121
|
-
|
122
|
-
elif reason == 'leave':
|
123
|
-
# For completed tasks, emit flow start events
|
124
|
-
if task.result:
|
125
|
-
event["args"] = {
|
126
|
-
"status": task.result.status,
|
127
|
-
"changed": task.result.changed
|
151
|
+
# Create flow start from completed task to this one
|
152
|
+
flow = {
|
153
|
+
"name": f"{need.name} -> {task.name}",
|
154
|
+
"cat": "flow",
|
155
|
+
"ph": "s", # Flow start
|
156
|
+
"pid": 1,
|
157
|
+
"tid": self._task_tid_map.get(need, 0),
|
158
|
+
"ts": int(need.end.timestamp() * 1_000_000) if need.end else ts,
|
159
|
+
"id": self._next_flow_id,
|
160
|
+
"bp": "e"
|
128
161
|
}
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
# self._events.append(flow)
|
145
|
-
|
146
|
-
# # Create flow end event
|
147
|
-
# flow_end = {
|
148
|
-
# "name": f"{task.name} -> {dep_task.name}",
|
149
|
-
# "cat": "flow",
|
150
|
-
# "ph": "f", # Flow finish
|
151
|
-
# "pid": 1,
|
152
|
-
# "tid": dep_tid, # Target task's thread
|
153
|
-
# "ts": ts, # Will be updated when target task starts
|
154
|
-
# "id": self._next_flow_id,
|
155
|
-
# "bp": "e" # Connect to enclosing slice
|
156
|
-
# }
|
157
|
-
# self._events.append(flow_end)
|
158
|
-
self._next_flow_id += 1
|
159
|
-
|
160
|
-
self._release_tid(task)
|
162
|
+
self._events.append(flow)
|
163
|
+
|
164
|
+
# Create flow finish at the start of this task
|
165
|
+
flow_end = {
|
166
|
+
"name": f"{need.name} -> {task.name}",
|
167
|
+
"cat": "flow",
|
168
|
+
"ph": "f", # Flow finish
|
169
|
+
"pid": 1,
|
170
|
+
"tid": tid,
|
171
|
+
"ts": ts,
|
172
|
+
"id": self._next_flow_id,
|
173
|
+
"bp": "e"
|
174
|
+
}
|
175
|
+
self._events.append(flow_end)
|
176
|
+
self._next_flow_id += 1
|
{dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
dv_flow/mgr/__init__.py,sha256=
|
1
|
+
dv_flow/mgr/__init__.py,sha256=oKr6XoYlfmr7HcnXVV6xho2mkUJB4ROiJB-2tfirtYA,1315
|
2
2
|
dv_flow/mgr/__main__.py,sha256=BogNdBkXhgg05E8_IumNkVoag6WwvfbpiI8346oOtPo,3844
|
3
3
|
dv_flow/mgr/cond_def.py,sha256=2ZkzPusqVkN1fFMTvkDl9O_OJLPdD_cK3xzX9J75RMw,343
|
4
4
|
dv_flow/mgr/config.py,sha256=b2MVlVVNB0psk8x4bQRAYshkpNJrtyMtV1Ymhmx9AfM,137
|
@@ -37,7 +37,7 @@ dv_flow/mgr/task_def.py,sha256=8NPwtTROfWDkMqcO9mKXV4dw0sC4mCMmnsNuv8uTdTY,5094
|
|
37
37
|
dv_flow/mgr/task_graph_builder.py,sha256=q7BS7OLYkS6uZwQLvo6P_CtJkhIvPal_tXLZHgUuLpU,28172
|
38
38
|
dv_flow/mgr/task_graph_dot_writer.py,sha256=qK4Imy9o2_F1aKoU1tJ-qoBHslq2BhSMbdjAUPfpN7I,6009
|
39
39
|
dv_flow/mgr/task_listener_log.py,sha256=Ai-6X5BOoGsaNTgnlXEW0-czrjJm7__ShNK501CUmko,4337
|
40
|
-
dv_flow/mgr/task_listener_trace.py,sha256=
|
40
|
+
dv_flow/mgr/task_listener_trace.py,sha256=7B-V2YK8uXd_QSGBq_7USmbe5CleVvwumU0CpsmxZvg,6224
|
41
41
|
dv_flow/mgr/task_node.py,sha256=OC3rkeRSFv9wmgkMZ_7eJu7nuXGJcwW_b6FGQM-w7AU,5231
|
42
42
|
dv_flow/mgr/task_node_compound.py,sha256=0biBPT_2SpCPJL7DFaFY27_K7kNxJ1taIut3Fv12HXk,3347
|
43
43
|
dv_flow/mgr/task_node_ctor.py,sha256=YsoVMX5WbpbzcHvEK7ps_ZRV-J7MZ3F8NNozQw7vbog,4418
|
@@ -74,9 +74,9 @@ dv_flow/mgr/util/util.py,sha256=BO7iqP_c9ttmXkojq7nKDN-g8wl1_Pco9k-KnrXxjwE,1889
|
|
74
74
|
dv_flow/mgr/util/cmds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
dv_flow/mgr/util/cmds/cmd_schema.py,sha256=IJzZdxCSEgIQ79LpYiM7UqJ9RJ-7yraqmBN2XVgAgXA,1752
|
76
76
|
dv_flow/mgr/util/cmds/cmd_workspace.py,sha256=egmaIXpe5L-TePwmcfisfrG6tdiTUWSjqa9Za5WChVs,890
|
77
|
-
dv_flow_mgr-1.8.
|
78
|
-
dv_flow_mgr-1.8.
|
79
|
-
dv_flow_mgr-1.8.
|
80
|
-
dv_flow_mgr-1.8.
|
81
|
-
dv_flow_mgr-1.8.
|
82
|
-
dv_flow_mgr-1.8.
|
77
|
+
dv_flow_mgr-1.8.14931268525rc0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
78
|
+
dv_flow_mgr-1.8.14931268525rc0.dist-info/METADATA,sha256=xtNJAHBujbtKSu7qN8OAoN_tAMUOtvUFzmd9eFKAwRU,13335
|
79
|
+
dv_flow_mgr-1.8.14931268525rc0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
80
|
+
dv_flow_mgr-1.8.14931268525rc0.dist-info/entry_points.txt,sha256=1roy8wAFM48LabOvr6jiOw0MUs-qE8X3Vf8YykPazxk,50
|
81
|
+
dv_flow_mgr-1.8.14931268525rc0.dist-info/top_level.txt,sha256=amfVTkggzYPtWwLqNmRukfz1Buu0pGS2SrYBBLhXm04,8
|
82
|
+
dv_flow_mgr-1.8.14931268525rc0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
{dv_flow_mgr-1.8.14920283751rc0.dist-info → dv_flow_mgr-1.8.14931268525rc0.dist-info}/top_level.txt
RENAMED
File without changes
|