Example: writing metrics to an Excel file