@vpalmisano/webrtcperf 4.2.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/config.ts CHANGED
@@ -413,7 +413,7 @@ calculated using \`Date.now()\``,
413
413
  showPageLog: {
414
414
  doc: `If \`true\`, the pages console logs will be shown on console. Set to false to disable the page logs.`,
415
415
  format: 'Boolean',
416
- default: true,
416
+ default: false,
417
417
  env: 'SHOW_PAGE_LOG',
418
418
  arg: 'show-page-log',
419
419
  },
@@ -445,7 +445,7 @@ on the console. Regexp string allowed.`,
445
445
  userAgent: {
446
446
  doc: `The user agent override.`,
447
447
  format: String,
448
- default: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36',
448
+ default: `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${puppeteer.PUPPETEER_REVISIONS.chrome} Safari/537.36`,
449
449
  nullable: true,
450
450
  env: 'USER_AGENT',
451
451
  arg: 'user-agent',
@@ -456,7 +456,9 @@ If set, the files contents will be executed inside each opened tab page; \
456
456
  the following global variables will be attached to the \`webrtcperf\` global object: \
457
457
  \`WEBRTC_PERF_SESSION\` the session number (0-indexed); \
458
458
  \`WEBRTC_PERF_TAB\` the tab number inside the same session (0-indexed); \
459
- \`WEBRTC_PERF_INDEX\` the page absolute index (0-indexed). \
459
+ \`WEBRTC_PERF_INDEX\` the page absolute index (0-indexed).
460
+ Suggested values:
461
+ - With meet.google.com: https://raw.githubusercontent.com/vpalmisano/webrtcperf/refs/heads/devel/examples/google-meet.js
460
462
  `,
461
463
  format: String,
462
464
  default: '',
@@ -996,8 +998,8 @@ export async function loadConfigFromPrompt(prompt: string) {
996
998
  })
997
999
  if (response.functionCalls && response.functionCalls.length > 0) {
998
1000
  const functionCall = response.functionCalls[0]
999
- log.info('Using function call:', functionCall.name, functionCall.args)
1000
- return loadConfig(undefined, functionCall.args)
1001
+ log.debug('Using function call:', functionCall.name, functionCall.args)
1002
+ return functionCall.args
1001
1003
  } else {
1002
1004
  throw new Error('No function call found in the response. Please check the prompt and try again.')
1003
1005
  }
package/src/session.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { getSessionThrottleValues, throttleLauncher } from '@vpalmisano/throttler'
2
2
  import assert from 'assert'
3
3
  import axios from 'axios'
4
- import chalk from 'chalk'
5
4
  import EventEmitter from 'events'
6
5
  import fs from 'fs'
7
6
  import JSON5 from 'json5'
@@ -50,6 +49,9 @@ import {
50
49
  } from './utils'
51
50
  import { MediaPath } from './media'
52
51
 
52
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
53
+ const { default: chalk } = require('chalk-template')
54
+
53
55
  // eslint-disable-next-line @typescript-eslint/no-require-imports
54
56
  const NavigatorHardwareConcurrency = require('puppeteer-extra-plugin-stealth/evasions/navigator.hardwareConcurrency')
55
57
 
package/src/stats.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import axios from 'axios'
2
- import chalk from 'chalk'
3
2
  import * as events from 'events'
4
3
  import { Stats as FastStats } from 'fast-stats'
5
4
  import * as fs from 'fs'
@@ -20,6 +19,9 @@ export { FastStats }
20
19
 
21
20
  const log = logger('webrtcperf:stats')
22
21
 
22
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
23
+ const { default: chalk } = require('chalk-template')
24
+
23
25
  function calculateFailAmountPercentile(stat: FastStats, percentile = 95): number {
24
26
  return Math.round(stat.percentile(percentile))
25
27
  }
@@ -144,7 +146,7 @@ function formatStats(s: FastStats, forWriter = false): StatsData | string[] {
144
146
  function sprintfStatsTitle(name: string): string {
145
147
  return sprintf(chalk`-- {bold %(name)s} %(fill)s\n`, {
146
148
  name,
147
- fill: '-'.repeat(100 - name.length - 4),
149
+ fill: '-'.repeat(110 - name.length - 4),
148
150
  })
149
151
  }
150
152