Skip to content
Snippets Groups Projects
Commit f0f25bfa authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Forecaster component:

- Removed TODO.txt file
parent b85b910d
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!160Resolve "(CTTC) Forecaster component"
## PathComp Impact
After retrieving the topology, if the service has a duration constraint configured, the PathComp component should interrogate the Forecaster and request a topology forecast according to the requested duration of the service. The computed link capacity forecast should be used as link capacity in path computations.
```
link_capacities : Dict[str, float] = dict() # link_uuid => available_capacity_gbps
service_duration = get_service_duration(request.service)
if service_duration is None:
topology = context_client.GetTopologyDetails(topology_id)
for link in topology.links:
link_capacities[link.link_id.uuid] = link.available_capacity_gbps
else:
forecast_request = ForecastTopology(
topology_id = TopologyId(service.context_id, admin),
forecast_window_seconds = service.duration
)
forecast_reply = forecaster_client.ComputeTopologyForecast(forecast_request)
for link_capacity in forecast_reply.link_capacities:
total_capacity_gbps = link_capacity.total_capacity_gbps
forecast_used_capacity_gbps = link_capacity.forecast_used_capacity_gbps
forecast_available_capacity_gbps = total_capacity_gbps - forecast_used_capacity_gbps
link_capacities[link_capacity.link_id.uuid] = forecast_available_capacity_gbps
# Continue path computation passing link_capacities to the path comp algorithms.
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment