Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@embark/cockpit): Switching between tabs resets logs #1396

Merged
merged 1 commit into from Mar 11, 2019

Conversation

emizzle
Copy link
Collaborator

@emizzle emizzle commented Mar 7, 2019

Switching between the two tabs shown on the Dashboard for the cockpit was removing some of the logs that were previously displayed. This was due to an overlap in id’s being assigned to the logs from different processes.

To alleviate this, the reducers has been updated to not only check id but also process.name.

Additionally, the reducer was updated so that the number of logs for each process is set to ELEMENTS_LIMIT. For example, our ELEMENT_LIMIT is currently set to 200 and it would have meant that the total number of process logs across all processes would have been capped at 200. The current changes in this PR allow for 400 total logs, given that we have two processes being monitored for logs.

@emizzle emizzle requested a review from a team March 7, 2019 07:03
Copy link
Contributor

@0x-r4bbit 0x-r4bbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid!

In the future we should definitely see how we can make the multiplier dynamic.

Well done!

@@ -111,14 +111,15 @@ class EmbarkController {
});
},
function (callback) {
engine.startService("embarkListener");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this switched around?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. The EmbarkListener is responsible for listening to any logging output of embark. Because the EmbarkListener was started later in the lifecycle, there were a few logs that were not being captured, and thus the cockpit log output looked a little bit incomplete. I tried to move this above embark.init, but it wasn't happy. You'll notice the only missing logs in the cockpit now are the Welcome to embark at the top.

I will move the engine.startService("embarkListener"); to inside the embark.init callback to try to get all of the missing logs included.

Switching between the two tabs shown on the Dashboard for the cockpit was removing some of the logs that were previously displayed. This was due to an overlap in `id`’s being assigned to the logs from different processes.

To alleviate this, the reducers has been updated to not only check `id` but also `process.name`.

Additionally, the reducer was updated so that the number of logs for **each process** is set to `ELEMENTS_LIMIT`. For example, our `ELEMENT_LIMIT` is currently set to `200` and it would have meant that the total number of process logs across all processes would have been capped at 200. The current changes in this PR allow for 400 total logs, given that we have two processes being monitored for logs.
@emizzle emizzle force-pushed the fix/cockpit/disappearing-logs branch from 827949f to b11a90e Compare March 11, 2019 03:14
@iurimatias iurimatias merged commit a6b15ae into master Mar 11, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/cockpit/disappearing-logs branch March 11, 2019 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants