Skip to content

Commit afb4ffb

Browse files
committed
event log updates
1 parent 406ebec commit afb4ffb

2 files changed

Lines changed: 14 additions & 20 deletions

File tree

‎src/PerfProblemSimulator/Hubs/MetricsHub.cs‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public async Task RequestMetrics()
130130
/// Used when the dashboard page loads or user interacts with it.
131131
/// </summary>
132132
[UsedImplicitly]
133-
public async Task WakeUp()
133+
public Task WakeUp()
134134
{
135135
var wasIdle = _idleStateService.WakeUp();
136136

@@ -139,19 +139,12 @@ public async Task WakeUp()
139139
_logger.LogInformation("Server woken up by client request from: {ConnectionId}", Context.ConnectionId);
140140
}
141141

142-
// Always send current idle state directly to the caller.
143-
// When waking from idle, the broadcast via MetricsBroadcastService may be
144-
// delayed (queued on the dedicated broadcast thread), so we must send
145-
// the updated state directly to ensure the client knows we're active.
146-
var idleData = new IdleStateData
147-
{
148-
IsIdle = false,
149-
Message = wasIdle
150-
? "App waking up from idle state. There may be gaps in diagnostics and logs."
151-
: "Application is active",
152-
Timestamp = DateTimeOffset.UtcNow
153-
};
154-
await Clients.Caller.ReceiveIdleState(idleData);
142+
// Do NOT send ReceiveIdleState directly here.
143+
// The WakingUp event fired by IdleStateService.WakeUp() is handled by
144+
// MetricsBroadcastService, which broadcasts ReceiveIdleState to all clients.
145+
// Sending it here as well would cause the caller to receive the wake
146+
// message twice (once direct, once broadcast), duplicating the event log entry.
147+
return Task.CompletedTask;
155148
}
156149

157150
/// <summary>

‎src/PerfProblemSimulator/wwwroot/css/dashboard.css‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,13 @@ body.page-secondary {
982982
margin-right: 0.75rem;
983983
}
984984

985-
/* Log entry severity levels (fallback) */
986-
.log-entry.info { color: var(--color-primary); }
987-
.log-entry.success { color: var(--color-success); }
988-
.log-entry.warning { color: var(--color-warning); }
989-
.log-entry.error { color: var(--color-danger); }
985+
/* Log entry non-simulation colors (matches title bar gradient dark end) */
986+
.log-entry.info { color: var(--color-primary-dark); }
987+
.log-entry.success { color: var(--color-primary-dark); }
988+
.log-entry.warning { color: var(--color-primary-dark); }
989+
.log-entry.error { color: var(--color-primary-dark); }
990+
.log-entry.system { color: var(--color-primary-dark); }
991+
.log-entry.idle { color: var(--color-primary-dark); }
990992

991993
/* Log entry simulation-themed colors */
992994
.log-entry.cpu { color: var(--color-cpu); }
@@ -996,7 +998,6 @@ body.page-secondary {
996998
.log-entry.failedrequests { color: #8B4513; } /* Medium brown for failed requests */
997999
.log-entry.crash { color: var(--color-danger); }
9981000
.log-entry.loadtest { color: var(--color-primary); } /* .NET theme: blue */
999-
.log-entry.system { color: var(--color-text-muted); }
10001001

10011002
.log-icon {
10021003
margin-right: 0.35rem;

0 commit comments

Comments
 (0)