PHP AI

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:

  1. Duplicated cost information in multiple currencies (USD and EUR).
  2. Irrelevant details about model types.
  3. 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:

  1. Removing the cost_eur column to standardize on USD.
  2. Removing the model type badge and total tokens columns to reduce visual clutter.
  3. Maintaining the visibility of image_count and video_seconds columns for relevant usage data.
  4. Implementing default sorting by created_at in descending order to display the newest usage records first.
  5. Formatting the cost_usd to 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

  1. Identify the key metrics for your tenant AI usage reporting.
  2. Remove any redundant or irrelevant information.
  3. Implement clear sorting to prioritize recent usage.
  4. 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.

Streamlining Tenant AI Usage Reporting in Breniapp
GERARDO RUIZ

GERARDO RUIZ

Author

Share: