flow_constraints
flow_constraints ¤
FlowConstraintEvents ¤
FlowConstraintEvents(
dataframe: DataFrame,
*,
time_column: str = "systime",
event_uuid: str = "prod:flow"
)
Bases: Base
Production: Flow Constraints
- blocked_events: upstream running while downstream not consuming.
- starved_events: downstream idle due to lack of upstream supply.
blocked_events ¤
blocked_events(
*,
roles: Dict[str, str],
tolerance: str = "200ms",
tolerance_before: Optional[str] = None,
tolerance_after: Optional[str] = None,
min_duration: str = "0s"
) -> pd.DataFrame
Blocked: upstream_run=True while downstream_run=False.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
roles
|
Dict[str, str]
|
Dictionary mapping role names to UUIDs. Expected keys: 'upstream_run', 'downstream_run' |
required |
tolerance
|
str
|
Default tolerance for time alignment (used if directional tolerances not provided) |
'200ms'
|
tolerance_before
|
Optional[str]
|
Tolerance for looking backward in time during alignment |
None
|
tolerance_after
|
Optional[str]
|
Tolerance for looking forward in time during alignment |
None
|
min_duration
|
str
|
Minimum duration for an event to be included |
'0s'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: start, end, uuid, source_uuid, is_delta, type, |
DataFrame
|
time_alignment_quality, duration, severity |
Example
roles = {'upstream_run': 'uuid1', 'downstream_run': 'uuid2'}
starved_events ¤
starved_events(
*,
roles: Dict[str, str],
tolerance: str = "200ms",
tolerance_before: Optional[str] = None,
tolerance_after: Optional[str] = None,
min_duration: str = "0s"
) -> pd.DataFrame
Starved: downstream_run=True while upstream_run=False.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
roles
|
Dict[str, str]
|
Dictionary mapping role names to UUIDs. Expected keys: 'upstream_run', 'downstream_run' |
required |
tolerance
|
str
|
Default tolerance for time alignment (used if directional tolerances not provided) |
'200ms'
|
tolerance_before
|
Optional[str]
|
Tolerance for looking backward in time during alignment |
None
|
tolerance_after
|
Optional[str]
|
Tolerance for looking forward in time during alignment |
None
|
min_duration
|
str
|
Minimum duration for an event to be included |
'0s'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: start, end, uuid, source_uuid, is_delta, type, |
DataFrame
|
time_alignment_quality, duration, severity |
Example
roles = {'upstream_run': 'uuid1', 'downstream_run': 'uuid2'}
flow_constraint_analytics ¤
flow_constraint_analytics(
*,
roles: Dict[str, str],
tolerance: str = "200ms",
tolerance_before: Optional[str] = None,
tolerance_after: Optional[str] = None,
min_duration: str = "0s",
minor_threshold: str = "5s",
moderate_threshold: str = "30s"
) -> Dict[str, Any]
Generate comprehensive analytics for flow constraints (blockages and starvations).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
roles
|
Dict[str, str]
|
Dictionary mapping role names to UUIDs. Expected keys: 'upstream_run', 'downstream_run' |
required |
tolerance
|
str
|
Default tolerance for time alignment (used if directional tolerances not provided) |
'200ms'
|
tolerance_before
|
Optional[str]
|
Tolerance for looking backward in time during alignment |
None
|
tolerance_after
|
Optional[str]
|
Tolerance for looking forward in time during alignment |
None
|
min_duration
|
str
|
Minimum duration for an event to be included |
'0s'
|
minor_threshold
|
str
|
Duration threshold for minor severity classification |
'5s'
|
moderate_threshold
|
str
|
Duration threshold for moderate severity classification |
'30s'
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary containing analytics for both blocked and starved events: |
Dict[str, Any]
|
|
Dict[str, Any]
|
|
Dict[str, Any]
|
|
Example
roles = {'upstream_run': 'uuid1', 'downstream_run': 'uuid2'} analytics = flow.flow_constraint_analytics(roles=roles) print(analytics['summary']['blocked_count'])