v0.1.17 - Fixed more on stats page
This commit is contained in:
46
api/index.js
46
api/index.js
@@ -44,7 +44,7 @@ let pendingSqlQueries = new Map();
|
|||||||
|
|
||||||
// Real-time event rate chart
|
// Real-time event rate chart
|
||||||
let eventRateChart = null;
|
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
|
// Relay Events state - now handled by main subscription
|
||||||
|
|
||||||
@@ -3890,7 +3890,24 @@ function handleViewQueryResponse(viewName, responseData) {
|
|||||||
switch (viewName) {
|
switch (viewName) {
|
||||||
case 'blob_overview':
|
case 'blob_overview':
|
||||||
if (responseData.data && Array.isArray(responseData.data) && responseData.data.length > 0) {
|
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;
|
break;
|
||||||
case 'blob_type_distribution':
|
case 'blob_type_distribution':
|
||||||
@@ -3967,27 +3984,28 @@ function updateStatsFromMonitoringEvent(monitoringData) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update total events count and track rate for chart
|
// Update total blobs count and track rate for chart
|
||||||
if (monitoringData.total_events !== undefined) {
|
// Support both total_blobs (new) and total_events (legacy) field names
|
||||||
const currentTotal = monitoringData.total_events;
|
const currentTotal = monitoringData.total_blobs || monitoringData.total_events;
|
||||||
|
if (currentTotal !== undefined) {
|
||||||
updateStatsCell('total-events', currentTotal.toString());
|
updateStatsCell('total-events', currentTotal.toString());
|
||||||
|
|
||||||
// Calculate new events since last update for chart
|
// Calculate new blobs since last update for chart
|
||||||
if (previousTotalEvents > 0) {
|
if (previousTotalBlobs > 0) {
|
||||||
const newEvents = currentTotal - previousTotalEvents;
|
const newBlobs = currentTotal - previousTotalBlobs;
|
||||||
if (newEvents > 0 && eventRateChart) {
|
if (newBlobs > 0 && eventRateChart) {
|
||||||
console.log(`Adding ${newEvents} new events to rate chart (${currentTotal} - ${previousTotalEvents})`);
|
console.log(`Adding ${newBlobs} new blobs to rate chart (${currentTotal} - ${previousTotalBlobs})`);
|
||||||
eventRateChart.addValue(newEvents);
|
eventRateChart.addValue(newBlobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update previous total for next calculation
|
// 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)) {
|
if (monitoringData.kinds && Array.isArray(monitoringData.kinds)) {
|
||||||
populateStatsKindsFromMonitoring(monitoringData.kinds, monitoringData.total_events);
|
populateStatsKindsFromMonitoring(monitoringData.kinds, currentTotal);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
build/main.o
BIN
build/main.o
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -10,8 +10,8 @@
|
|||||||
// Version information (auto-updated by build system)
|
// Version information (auto-updated by build system)
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 1
|
#define VERSION_MINOR 1
|
||||||
#define VERSION_PATCH 16
|
#define VERSION_PATCH 17
|
||||||
#define VERSION "v0.1.16"
|
#define VERSION "v0.1.17"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user