Loading...
Loading...
Compare original and translation side by side
undefinedundefineddef add_application(self, app: ApplicationAssessment):
"""Add application to migration assessment"""
self.applications.append(app)
def recommend_migration_strategy(self, app: ApplicationAssessment) -> MigrationStrategy:
"""Recommend migration strategy based on application characteristics"""
if app.complexity == ApplicationComplexity.LOW:
return MigrationStrategy.LIFT_AND_SHIFT
elif app.complexity == ApplicationComplexity.MEDIUM:
# Check if cost savings justify refactoring
annual_savings = app.current_costs - app.cloud_costs_estimate
refactor_cost = app.estimated_effort * 500 # cost per day
payback_months = (refactor_cost / annual_savings) * 12 if annual_savings > 0 else float('inf')
if payback_months < 6:
return MigrationStrategy.REFACTOR
else:
return MigrationStrategy.REPLATFORM
else: # HIGH complexity
# Evaluate if modernization is worthwhile
if app.business_criticality >= 8:
return MigrationStrategy.REFACTOR
else:
return MigrationStrategy.RETIRE # Consider retiring
def create_migration_wave_plan(self) -> Dict:
"""Create phased migration plan"""
# Sort by criticality and dependencies
sorted_apps = sorted(
self.applications,
key=lambda x: (len(x.dependencies), -x.business_criticality)
)
waves = {
'wave_1': [], # Low-risk, few dependencies
'wave_2': [], # Medium-risk
'wave_3': [] # High-risk or critical
}
migrated = set()
for app in sorted_apps:
# Check if dependencies are satisfied
deps_satisfied = all(dep in migrated for dep in app.dependencies)
if not deps_satisfied:
continue
if app.complexity == ApplicationComplexity.LOW:
waves['wave_1'].append(app.name)
elif app.complexity == ApplicationComplexity.MEDIUM:
waves['wave_2'].append(app.name)
else:
waves['wave_3'].append(app.name)
migrated.add(app.name)
return {
'waves': waves,
'total_applications': len(self.applications),
'migrated_count': len(migrated),
'total_effort_days': sum(app.estimated_effort for app in self.applications)
}
def calculate_roi(self) -> Dict:
"""Calculate migration ROI"""
total_current_costs = sum(app.current_costs for app in self.applications)
total_cloud_costs = sum(app.cloud_costs_estimate for app in self.applications)
annual_savings = total_current_costs - total_cloud_costs
# Estimate migration costs
total_effort = sum(app.estimated_effort for app in self.applications)
migration_cost = total_effort * 250 # cost per day
payback_months = (migration_cost / annual_savings) * 12 if annual_savings > 0 else float('inf')
return {
'total_current_costs': total_current_costs,
'total_cloud_costs': total_cloud_costs,
'annual_savings': annual_savings,
'migration_cost': migration_cost,
'payback_months': payback_months,
'year1_savings': annual_savings - migration_cost,
'year3_savings': (annual_savings * 3) - migration_cost
}def add_application(self, app: ApplicationAssessment):
"""Add application to migration assessment"""
self.applications.append(app)
def recommend_migration_strategy(self, app: ApplicationAssessment) -> MigrationStrategy:
"""Recommend migration strategy based on application characteristics"""
if app.complexity == ApplicationComplexity.LOW:
return MigrationStrategy.LIFT_AND_SHIFT
elif app.complexity == ApplicationComplexity.MEDIUM:
# Check if cost savings justify refactoring
annual_savings = app.current_costs - app.cloud_costs_estimate
refactor_cost = app.estimated_effort * 500 # cost per day
payback_months = (refactor_cost / annual_savings) * 12 if annual_savings > 0 else float('inf')
if payback_months < 6:
return MigrationStrategy.REFACTOR
else:
return MigrationStrategy.REPLATFORM
else: # HIGH complexity
# Evaluate if modernization is worthwhile
if app.business_criticality >= 8:
return MigrationStrategy.REFACTOR
else:
return MigrationStrategy.RETIRE # Consider retiring
def create_migration_wave_plan(self) -> Dict:
"""Create phased migration plan"""
# Sort by criticality and dependencies
sorted_apps = sorted(
self.applications,
key=lambda x: (len(x.dependencies), -x.business_criticality)
)
waves = {
'wave_1': [], # Low-risk, few dependencies
'wave_2': [], # Medium-risk
'wave_3': [] # High-risk or critical
}
migrated = set()
for app in sorted_apps:
# Check if dependencies are satisfied
deps_satisfied = all(dep in migrated for dep in app.dependencies)
if not deps_satisfied:
continue
if app.complexity == ApplicationComplexity.LOW:
waves['wave_1'].append(app.name)
elif app.complexity == ApplicationComplexity.MEDIUM:
waves['wave_2'].append(app.name)
else:
waves['wave_3'].append(app.name)
migrated.add(app.name)
return {
'waves': waves,
'total_applications': len(self.applications),
'migrated_count': len(migrated),
'total_effort_days': sum(app.estimated_effort for app in self.applications)
}
def calculate_roi(self) -> Dict:
"""Calculate migration ROI"""
total_current_costs = sum(app.current_costs for app in self.applications)
total_cloud_costs = sum(app.cloud_costs_estimate for app in self.applications)
annual_savings = total_current_costs - total_cloud_costs
# Estimate migration costs
total_effort = sum(app.estimated_effort for app in self.applications)
migration_cost = total_effort * 250 # cost per day
payback_months = (migration_cost / annual_savings) * 12 if annual_savings > 0 else float('inf')
return {
'total_current_costs': total_current_costs,
'total_cloud_costs': total_cloud_costs,
'annual_savings': annual_savings,
'migration_cost': migration_cost,
'payback_months': payback_months,
'year1_savings': annual_savings - migration_cost,
'year3_savings': (annual_savings * 3) - migration_cost
}undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined