Streamlining Tenant AI Usage Reporting in Breniapp
Introduction
Reporting on tenant AI usage is crucial for understanding resource consumption and billing in Breniapp, a multi-tenant application. However, overly complex reports can obscure key metrics. We recently simplified the tenant AI usage table to focus on the most essential data points.
The Problem
The original tenant AI usage table contained redundant information and unnecessary calculations, which made it harder to quickly grasp the essential metrics:
- Duplicated cost information in multiple currencies (USD and EUR).
- Irrelevant details about model types.
- Lack of clear sorting, making it difficult to identify the most recent usage.
These issues led to confusion and inefficiency in monitoring tenant AI usage.
The Solution: Simplified Table and Sorting
We streamlined the table by:
- Removing the
cost_eurcolumn to standardize on USD. - Removing the model type badge and total tokens columns to reduce visual clutter.
- Maintaining the visibility of
image_countandvideo_secondscolumns for relevant usage data. - Implementing default sorting by
created_atin descending order to display the newest usage records first. - Formatting the
cost_usdto four decimal places for precise cost representation.
Here's an example of how the cost is now formatted in PHP:
<?php
$cost_usd = 12.3456789;
$formatted_cost = number_format($cost_usd, 4);
echo $formatted_cost; // Output: 12.3457
?>
This code snippet demonstrates how the number_format function in PHP is used to format the cost to four decimal places, ensuring accuracy and consistency in the displayed data.
Benefits
These changes provide several benefits:
- Improved clarity and focus on essential metrics.
- Reduced complexity and cognitive load for users.
- Enhanced efficiency in monitoring recent tenant AI usage.
- Standardized cost reporting in USD.
Getting Started
- Identify the key metrics for your tenant AI usage reporting.
- Remove any redundant or irrelevant information.
- Implement clear sorting to prioritize recent usage.
- Format numerical data for consistency and accuracy.
Key Insight
Focusing on essential data and presenting it in a clear, organized manner can significantly improve the usability and effectiveness of tenant AI usage reporting.