Skip to content

Commit

Permalink
fix rtt publishes
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Feb 11, 2024
1 parent 8ea16fd commit 2a002ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions apps/nocapd/src/classes/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class NWWorker {
this.log.info(
`[${chalk.bgBlack(this.calculateProgress())}] `+
`${mute(this.processed)}/${mute(this.total)} `+
`${url}: ${result?.connect?.data? success("online"): failure("offline")} `+
`${url}: ${result?.connect?.data === true? success("online"): failure("offline")} ${result?.read?.data === true? success("readable"): failure("unreadable")} ${result?.write?.data === true? success("writable"): failure("unwritable")} `+
`${(result?.connect?.duration+result?.read?.duration+result?.write?.duration)/1000} seconds `+
`${error? chalk.gray.italic('error'): ''}`)
}
Expand Down Expand Up @@ -437,5 +437,4 @@ const eventDataFromResult = result => {
const k30066 = ev30066(translated)
const k30166 = ev30166(translated)
return [ k30066, k30166 ]
}

}
6 changes: 3 additions & 3 deletions packages/publisher/src/kinds/Kind30066.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export class Kind30066 extends Publisher {
tags.push( ['other', 'network', data.network] )

if(isRtt) {
if(data.connect)
if(data.connect?.data && data.connect?.duration > 0)
tags.push([ 'rtt', 'open', data.connect.duration.toString() ])
if(data?.read)
if(data.read?.data && data?.read?.duration > 0)
tags.push([ 'rtt', 'read', data.read.duration.toString() ])
if(data?.write)
if(data.write?.data && data?.write?.duration > 0)
tags.push([ 'rtt', 'write', data.write.duration.toString() ])
}

Expand Down

0 comments on commit 2a002ca

Please sign in to comment.