v0.1.17 - Fixed more on stats page

This commit is contained in:
Your Name
2025-12-12 17:06:43 -04:00
parent fe27b5e41a
commit 64b9f28444
8 changed files with 18268 additions and 16998 deletions

View File

@@ -44,7 +44,7 @@ let pendingSqlQueries = new Map();
// Real-time event rate chart
let eventRateChart = null;
let previousTotalEvents = 0; // Track previous total for rate calculation
let previousTotalBlobs = 0; // Track previous total for rate calculation
// Relay Events state - now handled by main subscription
@@ -3890,7 +3890,24 @@ function handleViewQueryResponse(viewName, responseData) {
switch (viewName) {
case 'blob_overview':
if (responseData.data && Array.isArray(responseData.data) && responseData.data.length > 0) {
populateStatsOverview(responseData.data[0]);
const overviewData = responseData.data[0];
populateStatsOverview(overviewData);
// Update chart with total blobs count
const currentTotal = overviewData.total_blobs;
if (currentTotal !== undefined) {
// Calculate new blobs since last update for chart
if (previousTotalBlobs > 0) {
const newBlobs = currentTotal - previousTotalBlobs;
if (newBlobs > 0 && eventRateChart) {
console.log(`Adding ${newBlobs} new blobs to rate chart (${currentTotal} - ${previousTotalBlobs})`);
eventRateChart.addValue(newBlobs);
}
}
// Update previous total for next calculation
previousTotalBlobs = currentTotal;
}
}
break;
case 'blob_type_distribution':
@@ -3967,27 +3984,28 @@ function updateStatsFromMonitoringEvent(monitoringData) {
return;
}
// Update total events count and track rate for chart
if (monitoringData.total_events !== undefined) {
const currentTotal = monitoringData.total_events;
// Update total blobs count and track rate for chart
// Support both total_blobs (new) and total_events (legacy) field names
const currentTotal = monitoringData.total_blobs || monitoringData.total_events;
if (currentTotal !== undefined) {
updateStatsCell('total-events', currentTotal.toString());
// Calculate new events since last update for chart
if (previousTotalEvents > 0) {
const newEvents = currentTotal - previousTotalEvents;
if (newEvents > 0 && eventRateChart) {
console.log(`Adding ${newEvents} new events to rate chart (${currentTotal} - ${previousTotalEvents})`);
eventRateChart.addValue(newEvents);
// Calculate new blobs since last update for chart
if (previousTotalBlobs > 0) {
const newBlobs = currentTotal - previousTotalBlobs;
if (newBlobs > 0 && eventRateChart) {
console.log(`Adding ${newBlobs} new blobs to rate chart (${currentTotal} - ${previousTotalBlobs})`);
eventRateChart.addValue(newBlobs);
}
}
// Update previous total for next calculation
previousTotalEvents = currentTotal;
previousTotalBlobs = currentTotal;
}
// Update event kinds table with real-time data
// Update blob types table with real-time data
if (monitoringData.kinds && Array.isArray(monitoringData.kinds)) {
populateStatsKindsFromMonitoring(monitoringData.kinds, monitoringData.total_events);
populateStatsKindsFromMonitoring(monitoringData.kinds, currentTotal);
}
} catch (error) {

Binary file not shown.

Binary file not shown.

Binary file not shown.

1166
debug.log

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -10,8 +10,8 @@
// Version information (auto-updated by build system)
#define VERSION_MAJOR 0
#define VERSION_MINOR 1
#define VERSION_PATCH 16
#define VERSION "v0.1.16"
#define VERSION_PATCH 17
#define VERSION "v0.1.17"
#include <stddef.h>
#include <stdint.h>