Skip to content

Commit 6864455

Browse files
committed
Fix: Legend box size and add webhook duration debugging
1. Changed pointStyleWidth to boxWidth for proper circular legend markers 2. Added debug logging to investigate duration = 0 issue 3. Improved duration parsing to handle both string and number types 4. Will help identify if duration field is null/undefined/0
1 parent 5257d90 commit 6864455

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

addon/components/widget/api-metrics.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,30 @@ export default class WidgetApiMetricsComponent extends Component {
251251
})
252252
.then((webhookRequestLogs) => {
253253
const records = webhookRequestLogs.toArray();
254+
255+
// Debug: Check first record
256+
if (records.length > 0) {
257+
console.log('[webhook-timing] First record:', {
258+
duration: records[0].duration,
259+
type: typeof records[0].duration,
260+
parsed: parseFloat(records[0].duration || 0),
261+
ms: parseFloat(records[0].duration || 0) * 1000
262+
});
263+
}
264+
254265
const data = records.map((req) => {
255-
// Duration is in seconds, convert to milliseconds
256-
const durationMs = parseFloat(req.duration || 0) * 1000;
266+
// Duration might be a string, ensure it's parsed as float
267+
const duration = req.duration;
268+
const durationFloat = typeof duration === 'string' ? parseFloat(duration) : (duration || 0);
269+
const durationMs = durationFloat * 1000;
270+
257271
return {
258272
x: new Date(req.created_at),
259273
y: durationMs,
260274
};
261275
});
276+
277+
console.log('[webhook-timing] Data points:', data.length, 'Sample:', data[0]);
262278

263279
// Show points if we have sparse data
264280
const showPoints = records.length < 50;
@@ -305,7 +321,7 @@ export default class WidgetApiMetricsComponent extends Component {
305321
labels: {
306322
color: '#9CA3AF',
307323
usePointStyle: true,
308-
pointStyleWidth: 8,
324+
boxWidth: 8,
309325
boxHeight: 8,
310326
padding: 15,
311327
font: {

0 commit comments

Comments
 (0)