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

feat: add first version of dogfooding app #68

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Conversation

adklempner
Copy link
Member

@adklempner adklempner commented May 15, 2024

Resolves #69

@adklempner adklempner requested a review from a team as a code owner May 15, 2024 04:41
@adklempner adklempner marked this pull request as draft May 15, 2024 04:41
Comment on lines 28 to 39
intervalId = setInterval(async () => {
const result = await node.lightPush.send(encoder, {
payload: utf8ToBytes(String(i)),
timestamp: new Date(),
});
controller.enqueue({ result, i });
i++;
if (i >= numMessages) {
clearInterval(intervalId);
controller.close();
}
}, period);
Copy link
Contributor

Choose a reason for hiding this comment

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

note if lightpush.send() takes period time (3s) -- requests will start to pile up.
do we want to change this to a setTimeout?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, fixed

const start = (numMessages: number, period: number = 3000) => {
let intervalId: NodeJS.Timeout;
let i = 0;
const stream = new ReadableStream({
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we using ReadableStream? any advantages?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed since scope has changed

@adklempner adklempner force-pushed the feat/send-receive-ratio branch from 6f478dd to 4350138 Compare May 21, 2024 03:43
@adklempner adklempner changed the title feat: add example for measuring ratio of messages sent to received feat: add first version of dogfooding app May 21, 2024
@adklempner adklempner force-pushed the feat/send-receive-ratio branch 2 times, most recently from 0e18bb5 to c548323 Compare May 21, 2024 05:27
@adklempner adklempner marked this pull request as ready for review May 21, 2024 05:28
@adklempner adklempner force-pushed the feat/send-receive-ratio branch from c548323 to bda114c Compare June 24, 2024 02:47
}
telemetryClient.push<TelemetryPushFilter>([
{
messageType: TelemetryType.LIGHT_PUSH_FILTER,
Copy link
Collaborator

Choose a reason for hiding this comment

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

hm. is it lightPush or filter?
if first - I read it as sent by lightPush
if second - received by filter

Copy link
Member Author

Choose a reason for hiding this comment

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

It's both. If Sender and Reporter are the same, it's considered sent via light push. If different, then received via filter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

so, we can avoid this altogether?

@adklempner adklempner force-pushed the feat/send-receive-ratio branch from bda114c to f34a75c Compare June 27, 2024 16:21

// TODO: https://github.com/waku-org/js-waku/issues/2079
// Dialing bootstrap peers right on start in order to have Filter subscription initiated properly
await node.dial("/dns4/node-01.do-ams3.waku.test.status.im/tcp/8000/wss");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mitigation for waku-org/js-waku#2079

console.log("light push failures: ", result.failures.length);
if (result.successes.length > 0) {
// Push to telemetry client
telemetryClient.push<TelemetryPushFilter>([
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to report failures with a message of failure.
What columns can be used for that @adklempner ?

@weboko weboko merged commit e2ab5ae into master Jul 22, 2024
7 checks passed
@weboko weboko deleted the feat/send-receive-ratio branch July 22, 2024 23:35
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.

feat: Create first version of Waku dogfooding app
3 participants