Skip to content

Commit

Permalink
(control) Clean up the event log
Browse files Browse the repository at this point in the history
* Generate fewer uninteresting event messages.
* Display fewer irrelevant fields in the overview table.
  • Loading branch information
vlofgren committed Jan 13, 2024
1 parent 71e32c5 commit ecd9c35
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Expand Up @@ -33,7 +33,7 @@ public ServiceEventLog(HikariDataSource dataSource,

logger.info("Starting service {} instance {}", serviceName, instanceUuid);

logEvent("START", "Service starting");
logEvent("SVC-START", serviceName);
}

public void logEvent(String type, String message) {
Expand Down
Expand Up @@ -60,7 +60,7 @@ public Service(BaseServiceParams params,

initialization.addCallback(params.heartbeat::start);
initialization.addCallback(messageQueueInbox::start);
initialization.addCallback(() -> params.eventLog.logEvent("SVC-INIT", ""));
initialization.addCallback(() -> params.eventLog.logEvent("SVC-INIT", serviceName + ":" + config.node()));

if (!initialization.isReady() && ! initialized ) {
initialized = true;
Expand Down
Expand Up @@ -59,7 +59,9 @@ private void register(ControlActor process, ActorPrototype graph) {
}

private void logStateChange(ControlActor process, String state) {
eventLog.logEvent("FSM-STATE-CHANGE", process.id() + " -> " + state);
if ("ERROR".equals(state)) {
eventLog.logEvent("FSM-ERROR", process.id());
}
}

public void startFrom(ControlActor process, String state) throws Exception {
Expand Down
Expand Up @@ -2,16 +2,12 @@

<table id="events" class="table">
<tr>
<th>Service Name</th>
<th>Instance</th>
<th>Event Time</th>
<th>Type</th>
<th>Message</th>
</tr>
{{#each events}}
<tr>
<td>{{serviceName}}</td>
<td>{{{readableUUID instanceFull}}}</td>
<td title="{{eventDateTime}}">{{eventTime}}</td>
<td>{{eventType}}</td>
<td>{{eventMessage}}</td>
Expand Down
Expand Up @@ -79,7 +79,9 @@ private void register(ExecutorActor process, RecordActorPrototype graph) {
}

private void logStateChange(ExecutorActor process, String state) {
eventLog.logEvent("FSM-STATE-CHANGE", process.id() + " -> " + state);
if ("ERROR".equals(state)) {
eventLog.logEvent("FSM-ERROR", process.id());
}
}

public void start(ExecutorActor process) throws Exception {
Expand Down
Expand Up @@ -87,6 +87,7 @@ public boolean trigger(ProcessId processId, String... parameters) throws Excepti
processes.put(processId, process);
}

eventLog.logEvent("PROCESS-START", processId.toString());
try {
new Thread(new ProcessLogStderr(process)).start();
new Thread(new ProcessLogStdout(process)).start();
Expand Down

0 comments on commit ecd9c35

Please sign in to comment.